From: Sage Weil Date: Fri, 29 Sep 2017 20:53:09 +0000 (-0500) Subject: os/ObjectMap: tie ObjectMap::ObjectMapIterator to superclass X-Git-Tag: v13.0.1~642^2~10 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c9d54b6db1eabc1f2ffc685fcae39942ab053f41;p=ceph-ci.git os/ObjectMap: tie ObjectMap::ObjectMapIterator to superclass These iterfaces are similar but ultimately unrelated! Unfortunately we are stuck with a joined class hiearchy because of DBObjectMap. Someday it would be nice to break this link. Signed-off-by: Sage Weil --- diff --git a/src/kv/KeyValueDB.h b/src/kv/KeyValueDB.h index 818884a1a97..d5bf99c6b94 100644 --- a/src/kv/KeyValueDB.h +++ b/src/kv/KeyValueDB.h @@ -180,7 +180,10 @@ public: return get(prefix, string(key, keylen), value); } - class GenericIteratorImpl { + // This superclass is used both by kv iterators *and* by the ObjectMap + // omap iterator. The class hiearchies are unfortunatley tied together + // by the legacy DBOjectMap implementation :(. + class SimplestIteratorImpl { public: virtual int seek_to_first() = 0; virtual int upper_bound(const std::string &after) = 0; @@ -190,6 +193,11 @@ public: virtual std::string key() = 0; virtual bufferlist value() = 0; virtual int status() = 0; + virtual ~SimplestIteratorImpl() {} + }; + + class GenericIteratorImpl : public SimplestIteratorImpl { + public: virtual ~GenericIteratorImpl() {} }; diff --git a/src/os/ObjectMap.h b/src/os/ObjectMap.h index 32b423c2861..4db3f17dc4b 100644 --- a/src/os/ObjectMap.h +++ b/src/os/ObjectMap.h @@ -156,7 +156,7 @@ public: virtual void compact() {} - typedef KeyValueDB::GenericIteratorImpl ObjectMapIteratorImpl; + typedef KeyValueDB::SimplestIteratorImpl ObjectMapIteratorImpl; typedef ceph::shared_ptr ObjectMapIterator; virtual ObjectMapIterator get_iterator(const ghobject_t &oid) { return ObjectMapIterator();