/// Getter for collection
coll_t coll() const { return parent_coll; }
+
+ /// Getter for parent
+ std::tr1::shared_ptr<CollectionIndex> get_index() const {
+ return parent_ref;
+ }
};
public:
/// Type of returned paths
#include <vector>
#include <tr1/memory>
-#include "CollectionIndex.h"
+#include "IndexManager.h"
#include "ObjectMap.h"
#include "KeyValueDB.h"
#include "DBObjectMap.h"
ObjectMap::ObjectMapIterator DBObjectMap::get_iterator(
const hobject_t &hoid,
- CollectionIndex::IndexedPath path)
+ Index index)
{
- Header header = lookup_map_header(path->coll(), hoid);
+ Header header = lookup_map_header(index->coll(), hoid);
if (!header)
return ObjectMapIterator(new EmptyIteratorImpl());
return _get_iterator(header);
}
int DBObjectMap::set_keys(const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const map<string, bufferlist> &set)
{
KeyValueDB::Transaction t = db->get_transaction();
- Header header = lookup_create_map_header(path->coll(), hoid, t);
+ Header header = lookup_create_map_header(index->coll(), hoid, t);
if (!header)
return -EINVAL;
}
int DBObjectMap::set_header(const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const bufferlist &bl)
{
KeyValueDB::Transaction t = db->get_transaction();
- Header header = lookup_create_map_header(path->coll(), hoid, t);
+ Header header = lookup_create_map_header(index->coll(), hoid, t);
if (!header)
return -EINVAL;
_set_header(header, bl, t);
}
int DBObjectMap::get_header(const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
bufferlist *bl)
{
- Header header = lookup_map_header(path->coll(), hoid);
+ Header header = lookup_map_header(index->coll(), hoid);
if (!header) {
return 0;
}
}
int DBObjectMap::clear(const hobject_t &hoid,
- CollectionIndex::IndexedPath path)
+ Index index)
{
KeyValueDB::Transaction t = db->get_transaction();
- Header header = lookup_map_header(path->coll(), hoid);
+ Header header = lookup_map_header(index->coll(), hoid);
if (!header)
return -ENOENT;
- remove_map_header(path->coll(), hoid, header, t);
+ remove_map_header(index->coll(), hoid, header, t);
assert(header->num_children > 0);
header->num_children--;
int r = _clear(header, t);
}
int DBObjectMap::rm_keys(const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const set<string> &to_clear)
{
- Header header = lookup_map_header(path->coll(), hoid);
+ Header header = lookup_map_header(index->coll(), hoid);
if (!header)
return -ENOENT;
KeyValueDB::Transaction t = db->get_transaction();
}
int DBObjectMap::get(const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
bufferlist *_header,
map<string, bufferlist> *out)
{
- Header header = lookup_map_header(path->coll(), hoid);
+ Header header = lookup_map_header(index->coll(), hoid);
if (!header)
return -ENOENT;
_get_header(header, _header);
}
int DBObjectMap::get_keys(const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
set<string> *keys)
{
- Header header = lookup_map_header(path->coll(), hoid);
+ Header header = lookup_map_header(index->coll(), hoid);
if (!header)
return -ENOENT;
- ObjectMapIterator iter = get_iterator(hoid, path);
+ ObjectMapIterator iter = get_iterator(hoid, index);
for (; iter->valid(); iter->next()) {
if (iter->status())
return iter->status();
}
int DBObjectMap::get_values(const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const set<string> &keys,
map<string, bufferlist> *out)
{
- Header header = lookup_map_header(path->coll(), hoid);
+ Header header = lookup_map_header(index->coll(), hoid);
if (!header)
return -ENOENT;
return scan(header, keys, 0, out);;
}
int DBObjectMap::check_keys(const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const set<string> &keys,
set<string> *out)
{
- Header header = lookup_map_header(path->coll(), hoid);
+ Header header = lookup_map_header(index->coll(), hoid);
if (!header)
return -ENOENT;
return scan(header, keys, out, 0);
}
int DBObjectMap::get_xattrs(const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const set<string> &to_get,
map<string, bufferlist> *out)
{
- Header header = lookup_map_header(path->coll(), hoid);
+ Header header = lookup_map_header(index->coll(), hoid);
if (!header)
return -ENOENT;
return db->get(xattr_prefix(header), to_get, out);
}
int DBObjectMap::get_all_xattrs(const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
set<string> *out)
{
- Header header = lookup_map_header(path->coll(), hoid);
+ Header header = lookup_map_header(index->coll(), hoid);
if (!header)
return -ENOENT;
KeyValueDB::Iterator iter = db->get_iterator(xattr_prefix(header));
}
int DBObjectMap::set_xattrs(const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const map<string, bufferlist> &to_set)
{
KeyValueDB::Transaction t = db->get_transaction();
- Header header = lookup_create_map_header(path->coll(), hoid, t);
+ Header header = lookup_create_map_header(index->coll(), hoid, t);
if (!header)
return -EINVAL;
t->set(xattr_prefix(header), to_set);
}
int DBObjectMap::remove_xattrs(const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const set<string> &to_remove)
{
KeyValueDB::Transaction t = db->get_transaction();
- Header header = lookup_map_header(path->coll(), hoid);
+ Header header = lookup_map_header(index->coll(), hoid);
if (!header)
return -ENOENT;
t->rmkeys(xattr_prefix(header), to_remove);
}
int DBObjectMap::clone(const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const hobject_t &target,
- CollectionIndex::IndexedPath target_path)
+ Index target_index)
{
KeyValueDB::Transaction t = db->get_transaction();
{
- Header destination = lookup_map_header(target_path->coll(), target);
+ Header destination = lookup_map_header(target_index->coll(), target);
if (destination) {
- remove_map_header(target_path->coll(), target, destination, t);
+ remove_map_header(target_index->coll(), target, destination, t);
destination->num_children--;
_clear(destination, t);
}
}
- Header parent = lookup_map_header(path->coll(), hoid);
+ Header parent = lookup_map_header(index->coll(), hoid);
if (!parent)
return db->submit_transaction(t);
- Header source = generate_new_header(path->coll(), hoid, parent);
- Header destination = generate_new_header(target_path->coll(), target, parent);
+ Header source = generate_new_header(index->coll(), hoid, parent);
+ Header destination = generate_new_header(target_index->coll(), target, parent);
_Header lsource, ldestination;
source->num_children = parent->num_children;
lsource.parent = source->seq;
set_header(parent, t);
set_header(source, t);
set_header(destination, t);
- set_map_header(target_path->coll(), target, ldestination, t);
+ set_map_header(target_index->coll(), target, ldestination, t);
map<string, bufferlist> to_set;
KeyValueDB::Iterator xattr_iter = db->get_iterator(xattr_prefix(parent));
}
int DBObjectMap::link(const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const hobject_t &target,
- CollectionIndex::IndexedPath target_path)
+ Index target_index)
{
KeyValueDB::Transaction t = db->get_transaction();
{
- Header destination = lookup_map_header(target_path->coll(), target);
+ Header destination = lookup_map_header(target_index->coll(), target);
if (destination) {
- remove_map_header(target_path->coll(), target, destination, t);
+ remove_map_header(target_index->coll(), target, destination, t);
destination->num_children--;
_clear(destination, t);
}
}
- Header header = lookup_create_map_header(path->coll(), hoid, t);
+ Header header = lookup_create_map_header(index->coll(), hoid, t);
assert(header->num_children > 0);
header->num_children++;
set_header(header, t);
_Header ldestination;
ldestination.parent = header->seq;
- set_map_header(target_path->coll(), target, ldestination, t);
+ set_map_header(target_index->coll(), target, ldestination, t);
return db->submit_transaction(t);
}
#include <tr1/memory>
#include <boost/scoped_ptr.hpp>
-#include "CollectionIndex.h"
+#include "IndexManager.h"
#include "ObjectMap.h"
#include "KeyValueDB.h"
#include "osd/osd_types.h"
int set_keys(
const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const map<string, bufferlist> &set
);
int set_header(
const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const bufferlist &bl
);
int get_header(
const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
bufferlist *bl
);
int clear(
const hobject_t &hoid,
- CollectionIndex::IndexedPath path
+ Index index
);
int rm_keys(
const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const set<string> &to_clear
);
int get(
const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
bufferlist *header,
map<string, bufferlist> *out
);
int get_keys(
const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
set<string> *keys
);
int get_values(
const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const set<string> &keys,
map<string, bufferlist> *out
);
int check_keys(
const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const set<string> &keys,
set<string> *out
);
int get_xattrs(
const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const set<string> &to_get,
map<string, bufferlist> *out
);
int get_all_xattrs(
const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
set<string> *out
);
int set_xattrs(
const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const map<string, bufferlist> &to_set
);
int remove_xattrs(
const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const set<string> &to_remove
);
int clone(
const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const hobject_t &target,
- CollectionIndex::IndexedPath target_path
+ Index target_index
);
int link(
const hobject_t &hoid,
- CollectionIndex::IndexedPath path,
+ Index index,
const hobject_t &target,
- CollectionIndex::IndexedPath target_path
+ Index target_index
);
/// Read initial state from backing store
int sync();
ObjectMapIterator get_iterator(const hobject_t &hoid,
- CollectionIndex::IndexedPath path);
+ Index index);
static const string USER_PREFIX;
static const string XATTR_PREFIX;
if (r < 0)
return -errno;
- r = object_map->link(o, path_old, o, path_new);
+ r = object_map->link(o, path_old->get_index(),
+ o, path_new->get_index());
if (r < 0)
return r;
r = index->lookup(o, &path, &exist);
if (r < 0)
return r;
- object_map->clear(o, path);
+ object_map->clear(o, path->get_index());
if (r < 0 && r != -ENOENT)
return r;
}
if (r < 0)
r = -errno;
dout(20) << "objectmap clone" << dendl;
- r = object_map->clone(oldoid, from, newoid, to);
+ r = object_map->clone(oldoid, from->get_index(), newoid, to->get_index());
// clone is non-idempotent; record our work.
_set_replay_guard(n, spos);
int r = lfn_find(c, hoid, &path);
if (r < 0)
return r;
- return object_map->get(hoid, path, header, out);
+ return object_map->get(hoid, path->get_index(), header, out);
}
int FileStore::omap_get_header(coll_t c, const hobject_t &hoid,
int r = lfn_find(c, hoid, &path);
if (r < 0)
return r;
- return object_map->get_header(hoid, path, bl);
+ return object_map->get_header(hoid, path->get_index(), bl);
}
int FileStore::omap_get_keys(coll_t c, const hobject_t &hoid, set<string> *keys)
int r = lfn_find(c, hoid, &path);
if (r < 0)
return r;
- return object_map->get_keys(hoid, path, keys);
+ return object_map->get_keys(hoid, path->get_index(), keys);
}
int FileStore::omap_get_values(coll_t c, const hobject_t &hoid,
int r = lfn_find(c, hoid, &path);
if (r < 0)
return r;
- return object_map->get_values(hoid, path, keys, out);
+ return object_map->get_values(hoid, path->get_index(), keys, out);
}
int FileStore::omap_check_keys(coll_t c, const hobject_t &hoid,
int r = lfn_find(c, hoid, &path);
if (r < 0)
return r;
- return object_map->check_keys(hoid, path, keys, out);
+ return object_map->check_keys(hoid, path->get_index(), keys, out);
}
ObjectMap::ObjectMapIterator FileStore::get_omap_iterator(coll_t c,
int r = lfn_find(c, hoid, &path);
if (r < 0)
return ObjectMap::ObjectMapIterator();
- return object_map->get_iterator(hoid, path);
+ return object_map->get_iterator(hoid, path->get_index());
}
int FileStore::_create_collection(coll_t c)
int r = lfn_find(cid, hoid, &path);
if (r < 0)
return r;
- return object_map->clear(hoid, path);
+ return object_map->clear(hoid, path->get_index());
}
int FileStore::_omap_setkeys(coll_t cid, const hobject_t &hoid,
const map<string, bufferlist> &aset) {
int r = lfn_find(cid, hoid, &path);
if (r < 0)
return r;
- return object_map->set_keys(hoid, path, aset);
+ return object_map->set_keys(hoid, path->get_index(), aset);
}
int FileStore::_omap_rmkeys(coll_t cid, const hobject_t &hoid,
const set<string> &keys) {
int r = lfn_find(cid, hoid, &path);
if (r < 0)
return r;
- return object_map->rm_keys(hoid, path, keys);
+ return object_map->rm_keys(hoid, path->get_index(), keys);
}
int FileStore::_omap_setheader(coll_t cid, const hobject_t &hoid,
const bufferlist &bl)
int r = lfn_find(cid, hoid, &path);
if (r < 0)
return r;
- return object_map->set_header(hoid, path, bl);
+ return object_map->set_header(hoid, path->get_index(), bl);
}
#include "include/types.h"
#include "include/buffer.h"
#include "osd/osd_types.h"
+#include <errno.h>
#include "HashIndex.h"
#include <sys/param.h>
#endif
+#include <errno.h>
+
#include "common/Mutex.h"
#include "common/Cond.h"
#include "common/config.h"
#include "osd/osd_types.h"
#include "include/object.h"
#include "common/ceph_crypto.h"
-#include "ObjectStore.h"
#include "CollectionIndex.h"
#include <vector>
#include <tr1/memory>
-#include "CollectionIndex.h"
+#include "IndexManager.h"
/**
* Encapsulates the FileStore key value store
/// Set keys and values from specified map
virtual int set_keys(
const hobject_t &hoid, ///< [in] object containing map
- CollectionIndex::IndexedPath path, ///< [in] Path to hoid
+ Index index, ///< [in] Path to hoid
const map<string, bufferlist> &set ///< [in] key to value map to set
) = 0;
/// Set header
virtual int set_header(
const hobject_t &hoid, ///< [in] object containing map
- CollectionIndex::IndexedPath path, ///< [in] Path to hoid
+ Index index, ///< [in] Path to hoid
const bufferlist &bl ///< [in] header to set
) = 0;
/// Retrieve header
virtual int get_header(
const hobject_t &hoid, ///< [in] object containing map
- CollectionIndex::IndexedPath path, ///< [in] Path to hoid
+ Index index, ///< [in] Path to hoid
bufferlist *bl ///< [out] header to set
) = 0;
/// Clear all map keys and values from hoid
virtual int clear(
const hobject_t &hoid, ///< [in] object containing map
- CollectionIndex::IndexedPath path ///< [in] Path to hoid
+ Index index ///< [in] Path to hoid
) = 0;
/// Clear all map keys and values from hoid
virtual int rm_keys(
const hobject_t &hoid, ///< [in] object containing map
- CollectionIndex::IndexedPath path, ///< [in] Path to hoid
+ Index index, ///< [in] Path to hoid
const set<string> &to_clear ///< [in] Keys to clear
) = 0;
/// Get all keys and values
virtual int get(
const hobject_t &hoid, ///< [in] object containing map
- CollectionIndex::IndexedPath path, ///< [in] Path to hoid
+ Index index, ///< [in] Path to hoid
bufferlist *header, ///< [out] Returned Header
map<string, bufferlist> *out ///< [out] Returned keys and values
) = 0;
/// Get values for supplied keys
virtual int get_keys(
const hobject_t &hoid, ///< [in] object containing map
- CollectionIndex::IndexedPath path, ///< [in] Path to hoid
+ Index index, ///< [in] Path to hoid
set<string> *keys ///< [out] Keys defined on hoid
) = 0;
/// Get values for supplied keys
virtual int get_values(
const hobject_t &hoid, ///< [in] object containing map
- CollectionIndex::IndexedPath path, ///< [in] Path to hoid
+ Index index, ///< [in] Path to hoid
const set<string> &keys, ///< [in] Keys to get
map<string, bufferlist> *out ///< [out] Returned keys and values
) = 0;
/// Check key existence
virtual int check_keys(
const hobject_t &hoid, ///< [in] object containing map
- CollectionIndex::IndexedPath path, ///< [in] Path to hoid
+ Index index, ///< [in] Path to hoid
const set<string> &keys, ///< [in] Keys to check
set<string> *out ///< [out] Subset of keys defined on hoid
) = 0;
/// Get xattrs
virtual int get_xattrs(
const hobject_t &hoid, ///< [in] object
- CollectionIndex::IndexedPath path, ///< [in] path to hoid
+ Index index, ///< [in] path to hoid
const set<string> &to_get, ///< [in] keys to get
map<string, bufferlist> *out ///< [out] subset of attrs/vals defined
) = 0;
/// Get all xattrs
virtual int get_all_xattrs(
const hobject_t &hoid, ///< [in] object
- CollectionIndex::IndexedPath path, ///< [in] path to hoid
+ Index index, ///< [in] path to hoid
set<string> *out ///< [out] attrs and values
) = 0;
/// set xattrs in to_set
virtual int set_xattrs(
const hobject_t &hoid, ///< [in] object
- CollectionIndex::IndexedPath path, ///< [in] path to object
+ Index index, ///< [in] path to object
const map<string, bufferlist> &to_set ///< [in] attrs/values to set
) = 0;
/// remove xattrs in to_remove
virtual int remove_xattrs(
const hobject_t &hoid, ///< [in] object
- CollectionIndex::IndexedPath path, ///< [in] path to hoid
+ Index index, ///< [in] path to hoid
const set<string> &to_remove ///< [in] attrs to remove
) = 0;
/// Clone keys efficiently from hoid map to target map
virtual int clone(
const hobject_t &hoid, ///< [in] object containing map
- CollectionIndex::IndexedPath path, ///< [in] Path to hoid
+ Index index, ///< [in] Path to hoid
const hobject_t &target, ///< [in] target of clone
- CollectionIndex::IndexedPath target_path ///< [in] path to target
+ Index target_index ///< [in] path to target
) { return 0; }
/// Efficiently tie <target, target_path> to same key space as <hoid, path>
virtual int link(
const hobject_t &hoid, ///< [in] object containing map
- CollectionIndex::IndexedPath path, ///< [in] Path to hoid
+ Index index, ///< [in] Path to hoid
const hobject_t &target, ///< [in] target of link
- CollectionIndex::IndexedPath target_path ///< [in] path to target
+ Index target_index ///< [in] path to target
) { return 0; }
/// Ensure all previous writes are durable
};
typedef std::tr1::shared_ptr<ObjectMapIteratorImpl> ObjectMapIterator;
virtual ObjectMapIterator get_iterator(const hobject_t &hoid,
- CollectionIndex::IndexedPath path) {
+ Index index) {
return ObjectMapIterator();
}
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
#include <tr1/memory>
#include <map>
#include <set>
#include <boost/scoped_ptr.hpp>
-#include "os/CollectionIndex.h"
+#include "os/IndexManager.h"
#include "include/buffer.h"
#include "test/ObjectMap/KeyValueDBMemory.h"
#include "os/KeyValueDB.h"
#include "os/DBObjectMap.h"
+#include "os/HashIndex.h"
#include "os/LevelDBStore.h"
#include <sys/types.h>
#include "global/global_init.h"
map<string, map<string, string> > omap;
map<string, string > hmap;
map<string, map<string, string> > xattrs;
- CollectionIndex::IndexedPath def_collection;
+ Index def_collection;
unsigned seq;
ObjectMapTest() : db(), seq(0) {}
key, value);
}
- void set_key(hobject_t hoid, CollectionIndex::IndexedPath path,
+ void set_key(hobject_t hoid, Index path,
string key, string value) {
map<string, bufferlist> to_write;
bufferptr bp(value.c_str(), value.size());
db->set_keys(hoid, path, to_write);
}
- void set_xattr(hobject_t hoid, CollectionIndex::IndexedPath path,
+ void set_xattr(hobject_t hoid, Index path,
string key, string value) {
map<string, bufferlist> to_write;
bufferptr bp(value.c_str(), value.size());
value);
}
- void set_header(hobject_t hoid, CollectionIndex::IndexedPath path,
+ void set_header(hobject_t hoid, Index path,
const string &value) {
bufferlist header;
header.append(bufferptr(value.c_str(), value.size() + 1));
value);
}
- int get_header(hobject_t hoid, CollectionIndex::IndexedPath path,
+ int get_header(hobject_t hoid, Index path,
string *value) {
bufferlist header;
int r = db->get_header(hoid, path, &header);
key, value);
}
- int get_xattr(hobject_t hoid, CollectionIndex::IndexedPath path,
+ int get_xattr(hobject_t hoid, Index path,
string key, string *value) {
set<string> to_get;
to_get.insert(key);
key, value);
}
- int get_key(hobject_t hoid, CollectionIndex::IndexedPath path,
+ int get_key(hobject_t hoid, Index path,
string key, string *value) {
set<string> to_get;
to_get.insert(key);
key);
}
- void remove_key(hobject_t hoid, CollectionIndex::IndexedPath path,
+ void remove_key(hobject_t hoid, Index path,
string key) {
set<string> to_remove;
to_remove.insert(key);
key);
}
- void remove_xattr(hobject_t hoid, CollectionIndex::IndexedPath path,
+ void remove_xattr(hobject_t hoid, Index path,
string key) {
set<string> to_remove;
to_remove.insert(key);
hobject_t(sobject_t(target, CEPH_NOSNAP)), def_collection);
}
- void clone(hobject_t hoid, CollectionIndex::IndexedPath path,
- hobject_t hoid2, CollectionIndex::IndexedPath path2) {
+ void clone(hobject_t hoid, Index path,
+ hobject_t hoid2, Index path2) {
db->clone(hoid, path, hoid2, path2);
}
clear(hobject_t(sobject_t(objname, CEPH_NOSNAP)), def_collection);
}
- void clear(hobject_t hoid, CollectionIndex::IndexedPath path) {
+ void clear(hobject_t hoid, Index path) {
db->clear(hoid, path);
}
}
void init_default_collection(const string &coll_name) {
- def_collection = CollectionIndex::get_testing_path(
- "/" + coll_name, coll_t(coll_name));
+ def_collection = Index(new HashIndex(coll_t(coll_name),
+ ("/" + coll_name).c_str(),
+ 2,
+ 2,
+ CollectionIndex::HASH_INDEX_TAG_2));
}
void auto_set_xattr(ostream &out) {
TEST_F(ObjectMapTest, CreateOneObject) {
hobject_t hoid(sobject_t("foo", CEPH_NOSNAP));
- CollectionIndex::IndexedPath path = CollectionIndex::get_testing_path(
- "/bar", coll_t("foo_coll"));
-
+ Index path = Index(new HashIndex(coll_t("foo_coll"),
+ string("/bar").c_str(),
+ 2,
+ 2,
+ CollectionIndex::HASH_INDEX_TAG_2));
map<string, bufferlist> to_set;
string key("test");
string val("test_val");
TEST_F(ObjectMapTest, CloneOneObject) {
hobject_t hoid(sobject_t("foo", CEPH_NOSNAP));
hobject_t hoid2(sobject_t("foo2", CEPH_NOSNAP));
- CollectionIndex::IndexedPath path = CollectionIndex::get_testing_path(
- "/bar", coll_t("foo_coll"));
+ Index path = Index(new HashIndex(coll_t("foo_coll"),
+ string("/bar").c_str(),
+ 2,
+ 2,
+ CollectionIndex::HASH_INDEX_TAG_2));
set_key(hoid, path, "foo", "bar");
set_key(hoid, path, "foo2", "bar2");
hobject_t hoid(sobject_t("foo", CEPH_NOSNAP));
hobject_t hoid2(sobject_t("foo2", CEPH_NOSNAP));
hobject_t hoid_link(sobject_t("foo_link", CEPH_NOSNAP));
- CollectionIndex::IndexedPath path = CollectionIndex::get_testing_path(
- "/bar", coll_t("foo_coll"));
-
+ Index path = Index(new HashIndex(coll_t("foo_coll"),
+ string("/bar").c_str(),
+ 2,
+ 2,
+ CollectionIndex::HASH_INDEX_TAG_2));
for (unsigned i = 0; i < 1000; ++i) {
set_key(hoid, path, "foo" + num_str(i), "bar" + num_str(i));