virtual bool exists(CollectionHandle& c, const ghobject_t& oid) {
return exists(c->get_cid(), oid);
}
+ /**
+ * set_collection_opts -- set pool options for a collectioninformation for an object
+ *
+ * @param cid collection
+ * @param opts new collection options
+ * @returns 0 on success, negative error code on failure.
+ */
+ virtual int set_collection_opts(
+ const coll_t& cid,
+ const pool_opts_t& opts) = 0;
/**
* stat -- get information for an object
*/
virtual uint64_t estimate_objects_overhead(uint64_t num_objects) = 0;
+
// DEBUG
virtual void inject_data_error(const ghobject_t &oid) {}
virtual void inject_mdata_error(const ghobject_t &oid) {}
create_collection(cid, 0);
}
break;
-
case Transaction::OP_COLL_HINT:
{
coll_t cid;
}
return r;
}
+int BlueStore::set_collection_opts(
+ const coll_t& cid,
+ const pool_opts_t& opts)
+{
+ CollectionHandle ch = _get_collection(cid);
+ if (!ch)
+ return -ENOENT;
+ Collection *c = static_cast<Collection*>(ch.get());
+ dout(15) << __func__ << " " << cid << " "
+ << " options " << opts << dendl;
+ RWLock::WLocker l(c->lock);
+
+ c->pool_opts = opts;
+ return 0;
+}
int BlueStore::read(
const coll_t& cid,
return r;
}
+
+
+
// ===========================================
// contention.
OnodeSpace onode_map;
+ //pool options
+ pool_opts_t pool_opts;
+
OnodeRef get_onode(const ghobject_t& oid, bool create);
// the terminology is confusing here, sorry!
bool exists(const coll_t& cid, const ghobject_t& oid) override;
bool exists(CollectionHandle &c, const ghobject_t& oid) override;
+ int set_collection_opts(
+ const coll_t& cid,
+ const pool_opts_t& opts) override;
int stat(
const coll_t& cid,
const ghobject_t& oid,
}
}
+int FileStore::set_collection_opts(
+ const coll_t& cid,
+ const pool_opts_t& opts)
+{
+ return -EOPNOTSUPP;
+}
+
int FileStore::read(
const coll_t& _cid,
const ghobject_t& oid,
const ghobject_t& oid,
struct stat *st,
bool allow_eio = false);
+ using ObjectStore::set_collection_opts;
+ int set_collection_opts(
+ const coll_t& cid,
+ const pool_opts_t& opts);
using ObjectStore::read;
int read(
const coll_t& cid,
#include <unistd.h>
#include "KStore.h"
+#include "osd/osd_types.h"
#include "kv.h"
#include "include/compat.h"
#include "include/stringify.h"
return 0;
}
+int KStore::set_collection_opts(
+ const coll_t& cid,
+ const pool_opts_t& opts)
+{
+ return -EOPNOTSUPP;
+}
+
int KStore::read(
const coll_t& cid,
const ghobject_t& oid,
const ghobject_t& oid,
struct stat *st,
bool allow_eio = false); // struct stat?
+ int set_collection_opts(
+ const coll_t& cid,
+ const pool_opts_t& opts);
using ObjectStore::read;
int read(
const coll_t& cid,
return 0;
}
+int MemStore::set_collection_opts(
+ const coll_t& cid,
+ const pool_opts_t& opts)
+{
+ return -EOPNOTSUPP;
+}
+
int MemStore::read(
const coll_t& cid,
const ghobject_t& oid,
struct stat *st, bool allow_eio = false) override;
int stat(CollectionHandle &c, const ghobject_t& oid,
struct stat *st, bool allow_eio = false) override;
+ int set_collection_opts(
+ const coll_t& cid,
+ const pool_opts_t& opts);
int read(
const coll_t& cid,
const ghobject_t& oid,