From: Sage Weil Date: Mon, 18 Jan 2016 14:36:02 +0000 (-0500) Subject: os/ObjectStore: add CollectionHandle X-Git-Tag: v10.0.4~153^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b6df3e1c96bd270b8a514a6e63b1d9ea88c7ee54;p=ceph.git os/ObjectStore: add CollectionHandle Signed-off-by: Sage Weil --- diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index ba9dd76e97ae..49065036adda 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -206,6 +206,20 @@ public: } }; + struct CollectionImpl : public RefCountedObject { + virtual const coll_t &get_cid() = 0; + CollectionImpl() : RefCountedObject(NULL, 0) {} + }; + typedef boost::intrusive_ptr CollectionHandle; + + struct CompatCollectionHandle : public CollectionImpl { + coll_t cid; + CompatCollectionHandle(coll_t c) : cid(c) {} + const coll_t &get_cid() override { + return cid; + } + }; + /********************************* * * Object Contents and semantics @@ -1875,10 +1889,21 @@ public: */ virtual int get_ideal_list_max() { return 64; } + /** - * Synchronous read operations + * get a collection handle + * + * Provide a trivial handle as a default to avoid converting legacy + * implementations. */ + virtual CollectionHandle open_collection(const coll_t &cid) { + return new CompatCollectionHandle(cid); + } + + /** + * Synchronous read operations + */ /** * exists -- Test for existance of object