]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/ObjectMap: tie ObjectMap::ObjectMapIterator to superclass
authorSage Weil <sage@redhat.com>
Fri, 29 Sep 2017 20:53:09 +0000 (15:53 -0500)
committerSage Weil <sage@redhat.com>
Tue, 3 Oct 2017 18:46:23 +0000 (13:46 -0500)
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 <sage@redhat.com>
src/kv/KeyValueDB.h
src/os/ObjectMap.h

index 818884a1a97edbf5dd6c11ab9978776903d0e934..d5bf99c6b942a0331f19d3c2f61c84bbaf8bd8b9 100644 (file)
@@ -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() {}
   };
 
index 32b423c2861681ac41b179a527cd7d9c8c7fbbe9..4db3f17dc4ba59d973051d3f10c0c5778c511b50 100644 (file)
@@ -156,7 +156,7 @@ public:
 
   virtual void compact() {}
 
-  typedef KeyValueDB::GenericIteratorImpl ObjectMapIteratorImpl;
+  typedef KeyValueDB::SimplestIteratorImpl ObjectMapIteratorImpl;
   typedef ceph::shared_ptr<ObjectMapIteratorImpl> ObjectMapIterator;
   virtual ObjectMapIterator get_iterator(const ghobject_t &oid) {
     return ObjectMapIterator();