summaryrefslogtreecommitdiffstats
path: root/src/rgw
diff options
context:
space:
mode:
authorYuval Lifshitz <ylifshit@redhat.com>2022-11-21 13:52:08 +0100
committerYuval Lifshitz <ylifshit@redhat.com>2022-11-30 19:48:16 +0100
commitea7089c091453c8b007e10a42ff5688c3284f524 (patch)
tree347ed389f825a04d6aaf7471de6384dffef12d03 /src/rgw
parentrgw/pubsub: remove pusub subscription functionality (diff)
downloadceph-ea7089c091453c8b007e10a42ff5688c3284f524.tar.xz
ceph-ea7089c091453c8b007e10a42ff5688c3284f524.zip
rgw/pubsub: remove deprecated pubsub event types
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
Diffstat (limited to '')
-rw-r--r--src/rgw/rgw_notify_event_type.cc48
-rw-r--r--src/rgw/rgw_notify_event_type.h2
-rw-r--r--src/rgw/rgw_pubsub.cc2
-rw-r--r--src/rgw/rgw_pubsub.h3
4 files changed, 8 insertions, 47 deletions
diff --git a/src/rgw/rgw_notify_event_type.cc b/src/rgw/rgw_notify_event_type.cc
index 8ee52c674db..7a0ef9568e1 100644
--- a/src/rgw/rgw_notify_event_type.cc
+++ b/src/rgw/rgw_notify_event_type.cc
@@ -56,48 +56,12 @@ namespace rgw::notify {
return "s3:UnknownEvent";
}
- std::string to_ceph_string(EventType t) {
- switch (t) {
- case ObjectCreated:
- case ObjectCreatedPut:
- case ObjectCreatedPost:
- case ObjectCreatedCopy:
- case ObjectCreatedCompleteMultipartUpload:
- return "OBJECT_CREATE";
- case ObjectRemovedDelete:
- return "OBJECT_DELETE";
- case ObjectRemovedDeleteMarkerCreated:
- return "DELETE_MARKER_CREATE";
- case ObjectLifecycle:
- return "OBJECT_LIFECYCLE";
- case ObjectExpiration:
- case ObjectExpirationCurrent:
- case ObjectExpirationNoncurrent:
- case ObjectExpirationDeleteMarker:
- case ObjectExpirationAbortMPU:
- return "OBJECT_EXPIRATION";
- case ObjectTransition:
- case ObjectTransitionCurrent:
- case ObjectTransitionNoncurrent:
- return "OBJECT_TRANSITION";
- case ObjectSynced:
- case ObjectSyncedCreate:
- case ObjectSyncedDelete:
- case ObjectSyncedDeletionMarkerCreated:
- return "OBJECT_SYNCED";
- case ObjectRemoved:
- case UnknownEvent:
- return "UNKNOWN_EVENT";
- }
- return "UNKNOWN_EVENT";
- }
-
std::string to_event_string(EventType t) {
return to_string(t).substr(3);
}
EventType from_string(const std::string& s) {
- if (s == "s3:ObjectCreated:*" || s == "OBJECT_CREATE")
+ if (s == "s3:ObjectCreated:*")
return ObjectCreated;
if (s == "s3:ObjectCreated:Put")
return ObjectCreatedPut;
@@ -109,13 +73,13 @@ namespace rgw::notify {
return ObjectCreatedCompleteMultipartUpload;
if (s == "s3:ObjectRemoved:*")
return ObjectRemoved;
- if (s == "s3:ObjectRemoved:Delete" || s == "OBJECT_DELETE")
+ if (s == "s3:ObjectRemoved:Delete")
return ObjectRemovedDelete;
- if (s == "s3:ObjectRemoved:DeleteMarkerCreated" || s == "DELETE_MARKER_CREATE")
+ if (s == "s3:ObjectRemoved:DeleteMarkerCreated")
return ObjectRemovedDeleteMarkerCreated;
if (s == "s3:ObjectLifecycle:*")
return ObjectLifecycle;
- if (s == "s3:ObjectLifecycle:Expiration:*" || s == "OBJECT_EXPIRATION")
+ if (s == "s3:ObjectLifecycle:Expiration:*")
return ObjectExpiration;
if (s == "s3:ObjectLifecycle:Expiration:Current")
return ObjectExpirationCurrent;
@@ -125,13 +89,13 @@ namespace rgw::notify {
return ObjectExpirationDeleteMarker;
if (s == "s3:ObjectLifecycle:Expiration:AbortMultipartUpload")
return ObjectExpirationAbortMPU;
- if (s == "s3:ObjectLifecycle:Transition:*" || s == "OBJECT_TRANSITION")
+ if (s == "s3:ObjectLifecycle:Transition:*")
return ObjectTransition;
if (s == "s3:ObjectLifecycle:Transition:Current")
return ObjectTransitionCurrent;
if (s == "s3:ObjectLifecycle:Transition:Noncurrent")
return ObjectTransitionNoncurrent;
- if (s == "s3:ObjectSynced:*" || s == "OBJECT_SYNCED")
+ if (s == "s3:ObjectSynced:*")
return ObjectSynced;
if (s == "s3:ObjectSynced:Create")
return ObjectSyncedCreate;
diff --git a/src/rgw/rgw_notify_event_type.h b/src/rgw/rgw_notify_event_type.h
index d09432b1626..4fe1b5c90c6 100644
--- a/src/rgw/rgw_notify_event_type.h
+++ b/src/rgw/rgw_notify_event_type.h
@@ -39,8 +39,6 @@ namespace rgw::notify {
std::string to_string(EventType t);
- std::string to_ceph_string(EventType t);
-
std::string to_event_string(EventType t);
EventType from_string(const std::string& s);
diff --git a/src/rgw/rgw_pubsub.cc b/src/rgw/rgw_pubsub.cc
index bf0e2d46b4c..b9aa54bacd8 100644
--- a/src/rgw/rgw_pubsub.cc
+++ b/src/rgw/rgw_pubsub.cc
@@ -338,7 +338,7 @@ void encode_json(const char *name, const rgw::notify::EventTypeList& l, Formatte
{
f->open_array_section(name);
for (auto iter = l.cbegin(); iter != l.cend(); ++iter) {
- f->dump_string("obj", rgw::notify::to_ceph_string(*iter));
+ f->dump_string("obj", rgw::notify::to_string(*iter));
}
f->close_section();
}
diff --git a/src/rgw/rgw_pubsub.h b/src/rgw/rgw_pubsub.h
index c3b0b4d0775..c0e9e144bb2 100644
--- a/src/rgw/rgw_pubsub.h
+++ b/src/rgw/rgw_pubsub.h
@@ -493,8 +493,7 @@ struct rgw_pubsub_topic_filter {
encode(topic, bl);
// events are stored as a vector of std::strings
std::vector<std::string> tmp_events;
- const auto converter = s3_id.empty() ? rgw::notify::to_ceph_string : rgw::notify::to_string;
- std::transform(events.begin(), events.end(), std::back_inserter(tmp_events), converter);
+ std::transform(events.begin(), events.end(), std::back_inserter(tmp_events), rgw::notify::to_string);
encode(tmp_events, bl);
encode(s3_id, bl);
encode(s3_filter, bl);