]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: reduce intent log obj name time resolution
authorYehuda Sadeh <yehuda@hq.newdream.net>
Wed, 10 Aug 2011 21:40:08 +0000 (14:40 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Wed, 10 Aug 2011 21:40:08 +0000 (14:40 -0700)
src/rgw/rgw_admin.cc
src/rgw/rgw_log.cc

index 51305539eb0586eae381bd8a438865101bc71c3d..c706d8df944ee6fcecacce69209a494e048a22ed 100644 (file)
@@ -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,
index 0088a3502fb412fc9a7d16e7034487e53d7cb578..24b8db5bc4efa7c4d956cdfb7af20a04a6897f7a 100644 (file)
@@ -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);