]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-dencoder: add RGWRegion, RGWZoneParams, RGWOLHInfo support. 5484/head
authorshawn <chen.xiaowei@h3c.com>
Thu, 6 Aug 2015 02:48:23 +0000 (10:48 +0800)
committershawn <chen.xiaowei@h3c.com>
Thu, 6 Aug 2015 02:48:27 +0000 (10:48 +0800)
    since ceph-dencoder does not support the up-list structures, so
    I add these three supports to analyze data more quickly.

Signed-off-by: shawn chen <cxwshawn@gmail.com>
src/rgw/rgw_dencoder.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h
src/test/encoding/types.h

index 10e9961e69e21ee732d4ae16fd5b87c9ab8b2774..82e32958fbe7325e8fcc833f37eb813d0c5190aa 100644 (file)
@@ -419,6 +419,34 @@ void RGWBucketInfo::generate_test_instances(list<RGWBucketInfo*>& o)
   o.push_back(new RGWBucketInfo);
 }
 
+void RGWRegion::generate_test_instances(list<RGWRegion*>& o)
+{
+  RGWRegion *r = new RGWRegion;
+  o.push_back(r);
+  o.push_back(new RGWRegion);
+}
+
+void RGWZone::generate_test_instances(list<RGWZone*> &o)
+{
+  RGWZone *z = new RGWZone;
+  o.push_back(z);
+  o.push_back(new RGWZone);
+}
+
+void RGWZoneParams::generate_test_instances(list<RGWZoneParams*> &o)
+{
+  o.push_back(new RGWZoneParams);
+  o.push_back(new RGWZoneParams); 
+}
+
+void RGWOLHInfo::generate_test_instances(list<RGWOLHInfo*> &o)
+{
+  RGWOLHInfo *olh = new RGWOLHInfo;
+  olh->removed = false;
+  o.push_back(olh);
+  o.push_back(new RGWOLHInfo);
+}
+
 void RGWBucketEnt::generate_test_instances(list<RGWBucketEnt*>& o)
 {
   RGWBucketEnt *e = new RGWBucketEnt;
index b496e17412bcad2cb5f55a92a7867620f5042899..0f4dc0ea29d7de4e96bf1169d53e4e9899a91a09 100644 (file)
@@ -520,7 +520,6 @@ int RGWRegionMap::update(RGWRegion& region)
   return 0;
 }
 
-
 void RGWObjVersionTracker::prepare_op_for_read(ObjectReadOperation *op)
 {
   obj_version *check_objv = version_for_check();
index f164559515db3fabc412aebbd2934dd0a93bc7ad..f9b3a4a69b4765b3b35e419c0f718c74dfc5a73a 100644 (file)
@@ -76,7 +76,7 @@ struct RGWOLHInfo {
      ::decode(removed, bl);
      DECODE_FINISH(bl);
   }
-
+  static void generate_test_instances(list<RGWOLHInfo*>& o);
   void dump(Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(RGWOLHInfo)
@@ -788,6 +788,7 @@ struct RGWZoneParams {
   }
   void dump(Formatter *f) const;
   void decode_json(JSONObj *obj);
+  static void generate_test_instances(list<RGWZoneParams*>& o);
 };
 WRITE_CLASS_ENCODER(RGWZoneParams)
 
@@ -833,6 +834,7 @@ struct RGWZone {
   }
   void dump(Formatter *f) const;
   void decode_json(JSONObj *obj);
+  static void generate_test_instances(list<RGWZone*>& o);
 };
 WRITE_CLASS_ENCODER(RGWZone)
 
@@ -852,6 +854,7 @@ struct RGWDefaultRegionInfo {
   }
   void dump(Formatter *f) const;
   void decode_json(JSONObj *obj);
+  //todo: implement ceph-dencoder
 };
 WRITE_CLASS_ENCODER(RGWDefaultRegionInfo)
 
@@ -954,6 +957,7 @@ struct RGWRegion {
 
   void dump(Formatter *f) const;
   void decode_json(JSONObj *obj);
+  static void generate_test_instances(list<RGWRegion*>& o);
 };
 WRITE_CLASS_ENCODER(RGWRegion)
 
index cb06b15f32e808f1cdf098dffdc7a4b3b4936e8e..93d306642cfc4296617e4e327c8af2c4608380be 100644 (file)
@@ -234,7 +234,11 @@ TYPE(librbd::WatchNotify::ResponseMessage)
 #include "rgw/rgw_rados.h"
 TYPE(RGWObjManifestPart)
 TYPE(RGWObjManifest)
-
+TYPE(RGWOLHInfo)
+TYPE(RGWRegion)
+TYPE(RGWZone)
+TYPE(RGWZoneParams)     
+   
 #include "rgw/rgw_acl.h"
 TYPE(ACLPermission)
 TYPE(ACLGranteeType)