From 5d7cb4c2124aff9e98d3b575c4fc804dc0b15af9 Mon Sep 17 00:00:00 2001 From: shawn Date: Thu, 6 Aug 2015 10:48:23 +0800 Subject: [PATCH] ceph-dencoder: add RGWRegion, RGWZoneParams, RGWOLHInfo support. 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 --- src/rgw/rgw_dencoder.cc | 28 ++++++++++++++++++++++++++++ src/rgw/rgw_rados.cc | 1 - src/rgw/rgw_rados.h | 6 +++++- src/test/encoding/types.h | 6 +++++- 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_dencoder.cc b/src/rgw/rgw_dencoder.cc index 10e9961e69e2..82e32958fbe7 100644 --- a/src/rgw/rgw_dencoder.cc +++ b/src/rgw/rgw_dencoder.cc @@ -419,6 +419,34 @@ void RGWBucketInfo::generate_test_instances(list& o) o.push_back(new RGWBucketInfo); } +void RGWRegion::generate_test_instances(list& o) +{ + RGWRegion *r = new RGWRegion; + o.push_back(r); + o.push_back(new RGWRegion); +} + +void RGWZone::generate_test_instances(list &o) +{ + RGWZone *z = new RGWZone; + o.push_back(z); + o.push_back(new RGWZone); +} + +void RGWZoneParams::generate_test_instances(list &o) +{ + o.push_back(new RGWZoneParams); + o.push_back(new RGWZoneParams); +} + +void RGWOLHInfo::generate_test_instances(list &o) +{ + RGWOLHInfo *olh = new RGWOLHInfo; + olh->removed = false; + o.push_back(olh); + o.push_back(new RGWOLHInfo); +} + void RGWBucketEnt::generate_test_instances(list& o) { RGWBucketEnt *e = new RGWBucketEnt; diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index b496e17412bc..0f4dc0ea29d7 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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(); diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index f164559515db..f9b3a4a69b47 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -76,7 +76,7 @@ struct RGWOLHInfo { ::decode(removed, bl); DECODE_FINISH(bl); } - + static void generate_test_instances(list& 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& 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& 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& o); }; WRITE_CLASS_ENCODER(RGWRegion) diff --git a/src/test/encoding/types.h b/src/test/encoding/types.h index cb06b15f32e8..93d306642cfc 100644 --- a/src/test/encoding/types.h +++ b/src/test/encoding/types.h @@ -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) -- 2.47.3