summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_pubsub.cc
diff options
context:
space:
mode:
authorYuval Lifshitz <yuvalif@yahoo.com>2019-12-01 19:08:12 +0100
committerYuval Lifshitz <yuvalif@yahoo.com>2019-12-03 19:42:20 +0100
commit19832a0daeb7b23006d1c38059ad14f0c239d32a (patch)
tree9a8152410ef6f7e70cd08d3a9d5213e13655a451 /src/rgw/rgw_pubsub.cc
parentrgw/pubsub: fix recerds/event json format to match documentation (diff)
downloadceph-19832a0daeb7b23006d1c38059ad14f0c239d32a.tar.xz
ceph-19832a0daeb7b23006d1c38059ad14f0c239d32a.zip
rgw/pubsub: support eventId in push mode
Signed-off-by: Yuval Lifshitz <yuvalif@yahoo.com>
Diffstat (limited to 'src/rgw/rgw_pubsub.cc')
-rw-r--r--src/rgw/rgw_pubsub.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rgw/rgw_pubsub.cc b/src/rgw/rgw_pubsub.cc
index 6c2f6cd74cc..4fac3ae0727 100644
--- a/src/rgw/rgw_pubsub.cc
+++ b/src/rgw/rgw_pubsub.cc
@@ -15,6 +15,14 @@
#define dout_subsys ceph_subsys_rgw
+void set_event_id(std::string& id, const std::string& hash, const utime_t& ts) {
+ char buf[64];
+ const auto len = snprintf(buf, sizeof(buf), "%010ld.%06ld.%s", (long)ts.sec(), (long)ts.usec(), hash.c_str());
+ if (len > 0) {
+ id.assign(buf, len);
+ }
+}
+
bool rgw_s3_key_filter::decode_xml(XMLObj* obj) {
XMLObjIter iter = obj->find("FilterRule");
XMLObj *o;