Skip to content

Commit

Permalink
Merge pull request ceph#29470 from liu-chunmei/ceph_seastar_cyan_store
Browse files Browse the repository at this point in the history
crimson: futurized CyanStore's member functions and Collection

Reviewed-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov authored Aug 27, 2019
2 parents ad47820 + e0d6212 commit a9469f4
Show file tree
Hide file tree
Showing 20 changed files with 255 additions and 200 deletions.
2 changes: 1 addition & 1 deletion src/crimson/os/cyan_collection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace ceph::os
{

Collection::Collection(const coll_t& c)
: cid{c}
: FuturizedCollection{c}
{}

Collection::~Collection() = default;
Expand Down
18 changes: 5 additions & 13 deletions src/crimson/os/cyan_collection.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include "include/buffer.h"
#include "osd/osd_types.h"

#include "futurized_collection.h"

namespace ceph::os {

class Object;
Expand All @@ -21,15 +23,11 @@ class Object;
* sequence. Transactions queued under different collections may run
* in parallel.
*
* ObjectStore users my get collection handles with open_collection() (or,
* ObjectStore users may get collection handles with open_collection() (or,
* for bootstrapping a new collection, create_new_collection()).
*/
struct Collection : public boost::intrusive_ref_counter<
Collection,
boost::thread_unsafe_counter>
{
struct Collection final : public FuturizedCollection {
using ObjectRef = boost::intrusive_ptr<Object>;
const coll_t cid;
int bits = 0;
// always use bufferlist object for testing
bool use_page_set = false;
Expand All @@ -39,21 +37,15 @@ struct Collection : public boost::intrusive_ref_counter<
bool exists = true;

Collection(const coll_t& c);
~Collection();
~Collection() final;

ObjectRef create_object() const;
ObjectRef get_object(ghobject_t oid);
ObjectRef get_or_create_object(ghobject_t oid);
uint64_t used_bytes() const;

const coll_t &get_cid() const {
return cid;
}

void encode(bufferlist& bl) const;
void decode(bufferlist::const_iterator& p);
};

using CollectionRef = boost::intrusive_ptr<Collection>;

}
Loading

0 comments on commit a9469f4

Please sign in to comment.