summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2012-05-25 15:06:55 -0700
committerSamuel Just <sam.just@inktank.com>2012-06-05 16:09:49 -0700
commit761140a0fa5408668f72740fb240e0f9d2a3c5a6 (patch)
tree000427e27e5e3d30c554edace0fac865a64f09da /src/test
parent9ceed879c86e28888819d8f114988f5031fe43f2 (diff)
downloadceph-761140a0fa5408668f72740fb240e0f9d2a3c5a6.tar.gz
FileStore,DBObjectMap: remove ObjectMap link method
hobject_t's are now globally unique in filestore. Essentially, there is a 1-to-1 mapping from inodes to hobject_t's. The entry in the DBObjectMap is now tied to the inode/hobject_t. Thus, links needn't be tracked. Rather, we delete the ObjectMap entry when nlink == 0. Signed-off-by: Samuel Just <sam.just@inktank.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ObjectMap/test_object_map.cc14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/test/ObjectMap/test_object_map.cc b/src/test/ObjectMap/test_object_map.cc
index a00a742e936..c8ac76942c4 100644
--- a/src/test/ObjectMap/test_object_map.cc
+++ b/src/test/ObjectMap/test_object_map.cc
@@ -656,18 +656,16 @@ TEST_F(ObjectMapTest, CloneOneObject) {
TEST_F(ObjectMapTest, OddEvenClone) {
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));
Index path = Index(new HashIndex(coll_t("foo_coll"),
string("/bar").c_str(),
2,
2,
- CollectionIndex::HASH_INDEX_TAG_2));
+ CollectionIndex::HOBJECT_WITH_POOL));
for (unsigned i = 0; i < 1000; ++i) {
set_key(hoid, path, "foo" + num_str(i), "bar" + num_str(i));
}
- db->link(hoid, path, hoid_link, path);
db->clone(hoid, path, hoid2, path);
int r = 0;
@@ -680,9 +678,6 @@ TEST_F(ObjectMapTest, OddEvenClone) {
ASSERT_EQ(1, r);
ASSERT_EQ("bar" + num_str(i), result);
- r = get_key(hoid2, path, "foo" + num_str(i), &result);
- ASSERT_EQ(1, r);
- ASSERT_EQ("bar" + num_str(i), result);
if (i % 2) {
remove_key(hoid, path, "foo" + num_str(i));
} else {
@@ -693,26 +688,19 @@ TEST_F(ObjectMapTest, OddEvenClone) {
for (unsigned i = 0; i < 1000; ++i) {
string result;
string result2;
- string result3;
r = get_key(hoid, path, "foo" + num_str(i), &result);
- int r3 = get_key(hoid_link, path, "foo" + num_str(i), &result3);
int r2 = get_key(hoid2, path, "foo" + num_str(i), &result2);
if (i % 2) {
ASSERT_EQ(0, r);
- ASSERT_EQ(0, r3);
ASSERT_EQ(1, r2);
ASSERT_EQ("bar" + num_str(i), result2);
} else {
ASSERT_EQ(0, r2);
ASSERT_EQ(1, r);
- ASSERT_EQ(1, r3);
ASSERT_EQ("bar" + num_str(i), result);
- ASSERT_EQ("bar" + num_str(i), result3);
}
}
- db->clear(hoid_link, path);
-
{
ObjectMap::ObjectMapIterator iter = db->get_iterator(hoid, path);
iter->seek_to_first();