From 762e3e11f483d0ffdd8deeedf1d7a1fd23a50176 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 10 Aug 2011 14:40:08 -0700 Subject: [PATCH] rgw: reduce intent log obj name time resolution --- src/rgw/rgw_admin.cc | 7 ++----- src/rgw/rgw_log.cc | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 51305539eb058..c706d8df944ee 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -364,10 +364,8 @@ class IntentLogNameFilter : public RGWAccessListFilter { string prefix; public: - IntentLogNameFilter(const char *date, const char *hour) { + IntentLogNameFilter(const char *date) { prefix = date; - prefix.append("-"); - prefix.append(hour); } bool filter(string& name, string& key) { return name.compare(prefix) < 0; @@ -892,8 +890,7 @@ int main(int argc, char **argv) int max = 1000; bool is_truncated; - const char *hour = "00"; - IntentLogNameFilter filter(date, hour); + IntentLogNameFilter filter(date); do { int r = store->list_objects(id, bucket, max, prefix, delim, marker, objs, common_prefixes, false, ns, diff --git a/src/rgw/rgw_log.cc b/src/rgw/rgw_log.cc index 0088a3502fb41..24b8db5bc4efa 100644 --- a/src/rgw/rgw_log.cc +++ b/src/rgw/rgw_log.cc @@ -112,7 +112,7 @@ int rgw_log_intent(struct req_state *s, rgw_obj& obj, RGWIntentEvent intent) localtime_r(&t, &bdt); char buf[obj.bucket.size() + 16]; - sprintf(buf, "%.4d-%.2d-%.2d-%.2d-%d-%s", (bdt.tm_year+1900), (bdt.tm_mon+1), bdt.tm_mday, bdt.tm_hour, s->pool_id, obj.bucket.c_str()); + sprintf(buf, "%.4d-%.2d-%.2d-%d-%s", (bdt.tm_year+1900), (bdt.tm_mon+1), bdt.tm_mday, s->pool_id, obj.bucket.c_str()); string oid(buf); rgw_obj log_obj(intent_log_bucket, oid); -- 2.39.5