aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahoo-inc.com>2016-11-04 13:28:02 +0100
committerGeir Storli <geirst@yahoo-inc.com>2016-11-04 13:28:02 +0100
commit128bba84583fc1249ea30bf4965ac4bc1f881df6 (patch)
treee577d9320b9372f7980befd9bab76e8b1c1c8f0d /searchlib/src/tests
parenta332037c8f2fa3b51e1df3277eb3c4eb7de2cfa6 (diff)
Move datastore code from search::btree -> search::datastore.
Diffstat (limited to 'searchlib/src/tests')
-rw-r--r--searchlib/src/tests/attribute/attribute_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/enumstore/enumstore_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/postinglist/postinglist.cpp10
-rw-r--r--searchlib/src/tests/btree/btreeaggregation_test.cpp1
-rw-r--r--searchlib/src/tests/memoryindex/btree/btree_test.cpp1
-rw-r--r--searchlib/src/tests/memoryindex/compact_document_words_store/compact_document_words_store_test.cpp2
-rw-r--r--searchlib/src/tests/memoryindex/datastore/datastore_test.cpp4
-rw-r--r--searchlib/src/tests/memoryindex/datastore/featurestore_test.cpp1
-rw-r--r--searchlib/src/tests/memoryindex/datastore/wordstore_test.cpp2
-rw-r--r--searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp3
-rw-r--r--searchlib/src/tests/memoryindex/document_remover/document_remover_test.cpp6
-rw-r--r--searchlib/src/tests/predicate/predicate_bounds_posting_list_test.cpp2
-rw-r--r--searchlib/src/tests/predicate/predicate_index_test.cpp2
-rw-r--r--searchlib/src/tests/predicate/predicate_interval_posting_list_test.cpp2
-rw-r--r--searchlib/src/tests/predicate/predicate_zstar_compressed_posting_list_test.cpp2
-rw-r--r--searchlib/src/tests/predicate/simple_index_test.cpp10
16 files changed, 28 insertions, 24 deletions
diff --git a/searchlib/src/tests/attribute/attribute_test.cpp b/searchlib/src/tests/attribute/attribute_test.cpp
index de9bb30914e..8708bc83ff3 100644
--- a/searchlib/src/tests/attribute/attribute_test.cpp
+++ b/searchlib/src/tests/attribute/attribute_test.cpp
@@ -1706,7 +1706,7 @@ AttributeTest::testStatus()
4 + sizeof(EnumStoreBase::Index) * EnumTreeTraits::LEAF_SLOTS;
static constexpr size_t InternalNodeSize =
8 + (sizeof(EnumStoreBase::Index) +
- sizeof(btree::EntryRef)) * EnumTreeTraits::INTERNAL_SLOTS;
+ sizeof(datastore::EntryRef)) * EnumTreeTraits::INTERNAL_SLOTS;
static constexpr size_t NestedVectorSize = 24; // sizeof(vespalib::Array)
{
diff --git a/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp b/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp
index e63889bbeb8..432a86be780 100644
--- a/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp
+++ b/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp
@@ -315,7 +315,7 @@ EnumStoreTest::testAddEnum(bool hasPostings)
uint32_t e = ses.getEnum(indices[i]);
EXPECT_EQUAL(i, e);
EXPECT_TRUE(ses.findEnum(unique[i].c_str(), e));
- EXPECT_TRUE(ses.getEnum(btree::EntryRef(e)) == i);
+ EXPECT_TRUE(ses.getEnum(datastore::EntryRef(e)) == i);
EXPECT_TRUE(ses.findIndex(unique[i].c_str(), idx));
EXPECT_TRUE(idx == indices[i]);
EXPECT_EQUAL(1u, ses.getRefCount(indices[i]));
diff --git a/searchlib/src/tests/attribute/postinglist/postinglist.cpp b/searchlib/src/tests/attribute/postinglist/postinglist.cpp
index 5d340dc5b07..ea53bd49c19 100644
--- a/searchlib/src/tests/attribute/postinglist/postinglist.cpp
+++ b/searchlib/src/tests/attribute/postinglist/postinglist.cpp
@@ -99,7 +99,7 @@ private:
std::vector<RandomValue> _randomValues;
public:
- typedef btree::DataStore<int> IntKeyStore;
+ typedef datastore::DataStore<int> IntKeyStore;
typedef btree::BTreeKeyData<uint32_t, btree::BTreeNoLeafData>
AttributePosting;
typedef btree::BTreeStore<uint32_t,
@@ -109,8 +109,8 @@ public:
btree::BTreeDefaultTraits>
PostingList;
typedef PostingList::NodeAllocatorType PostingListNodeAllocator;
- typedef btree::EntryRef PostingIdx;
- typedef btree::EntryRef StoreIndex;
+ typedef datastore::EntryRef PostingIdx;
+ typedef datastore::EntryRef StoreIndex;
class IntComp {
private:
@@ -593,8 +593,8 @@ AttributePostingListTest::doCompactEnumStore(Tree &tree,
std::vector<uint32_t> toHold;
for (uint32_t bufferId = 0; bufferId < numBuffers; ++bufferId) {
- btree::BufferState &state = valueHandle.getBufferState(bufferId);
- if (state._state == btree::BufferState::ACTIVE) {
+ datastore::BufferState &state = valueHandle.getBufferState(bufferId);
+ if (state._state == datastore::BufferState::ACTIVE) {
toHold.push_back(bufferId);
// Freelists already disabled due to variable sized data
}
diff --git a/searchlib/src/tests/btree/btreeaggregation_test.cpp b/searchlib/src/tests/btree/btreeaggregation_test.cpp
index bb8e86ef49d..51ff66367a1 100644
--- a/searchlib/src/tests/btree/btreeaggregation_test.cpp
+++ b/searchlib/src/tests/btree/btreeaggregation_test.cpp
@@ -24,6 +24,7 @@ LOG_SETUP("btreeaggregation_test");
#include <vespa/searchlib/btree/btreeaggregator.hpp>
using vespalib::GenerationHandler;
+using search::datastore::EntryRef;
namespace search {
namespace btree {
diff --git a/searchlib/src/tests/memoryindex/btree/btree_test.cpp b/searchlib/src/tests/memoryindex/btree/btree_test.cpp
index 5fb6761ba57..deec982b5ab 100644
--- a/searchlib/src/tests/memoryindex/btree/btree_test.cpp
+++ b/searchlib/src/tests/memoryindex/btree/btree_test.cpp
@@ -21,6 +21,7 @@ LOG_SETUP("btree_test");
#include <vespa/searchlib/btree/btreestore.hpp>
using vespalib::GenerationHandler;
+using search::datastore::EntryRef;
namespace search {
namespace btree {
diff --git a/searchlib/src/tests/memoryindex/compact_document_words_store/compact_document_words_store_test.cpp b/searchlib/src/tests/memoryindex/compact_document_words_store/compact_document_words_store_test.cpp
index 736e24332d4..662adbf6b94 100644
--- a/searchlib/src/tests/memoryindex/compact_document_words_store/compact_document_words_store_test.cpp
+++ b/searchlib/src/tests/memoryindex/compact_document_words_store/compact_document_words_store_test.cpp
@@ -10,7 +10,7 @@ LOG_SETUP(".memoryindex.compact_document_words_store_test");
#include <map>
using namespace search;
-using namespace search::btree;
+using namespace search::datastore;
using namespace search::memoryindex;
typedef CompactDocumentWordsStore::Builder Builder;
diff --git a/searchlib/src/tests/memoryindex/datastore/datastore_test.cpp b/searchlib/src/tests/memoryindex/datastore/datastore_test.cpp
index d07634c426c..de673c8c0c9 100644
--- a/searchlib/src/tests/memoryindex/datastore/datastore_test.cpp
+++ b/searchlib/src/tests/memoryindex/datastore/datastore_test.cpp
@@ -7,7 +7,7 @@ LOG_SETUP("datastore_test");
#include <vespa/searchlib/datastore/datastore.hpp>
namespace search {
-namespace btree {
+namespace datastore {
class MyStore : public DataStore<int, EntryRefT<3, 2> > {
private:
@@ -428,5 +428,5 @@ Test::Main()
}
}
-TEST_APPHOOK(search::btree::Test);
+TEST_APPHOOK(search::datastore::Test);
diff --git a/searchlib/src/tests/memoryindex/datastore/featurestore_test.cpp b/searchlib/src/tests/memoryindex/datastore/featurestore_test.cpp
index 87d32c90b78..87a9ab87cb1 100644
--- a/searchlib/src/tests/memoryindex/datastore/featurestore_test.cpp
+++ b/searchlib/src/tests/memoryindex/datastore/featurestore_test.cpp
@@ -6,6 +6,7 @@ LOG_SETUP("featurestore_test");
#include <vespa/searchlib/memoryindex/featurestore.h>
using namespace search::btree;
+using namespace search::datastore;
using namespace search::index;
namespace search
diff --git a/searchlib/src/tests/memoryindex/datastore/wordstore_test.cpp b/searchlib/src/tests/memoryindex/datastore/wordstore_test.cpp
index 825992b3b4f..fcf96d5afe9 100644
--- a/searchlib/src/tests/memoryindex/datastore/wordstore_test.cpp
+++ b/searchlib/src/tests/memoryindex/datastore/wordstore_test.cpp
@@ -5,7 +5,7 @@ LOG_SETUP("wordstore_test");
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/memoryindex/wordstore.h>
-using namespace search::btree;
+using namespace search::datastore;
namespace search {
namespace memoryindex {
diff --git a/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp b/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp
index ef8383b23c7..907e983420c 100644
--- a/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp
+++ b/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp
@@ -45,6 +45,7 @@ namespace search
{
using namespace btree;
+using namespace datastore;
using namespace fef;
using namespace index;
using queryeval::SearchIterator;
@@ -510,7 +511,7 @@ public:
return *this;
}
- btree::EntryRef
+ datastore::EntryRef
getWordRef()
{
return _inserter.getWordRef();
diff --git a/searchlib/src/tests/memoryindex/document_remover/document_remover_test.cpp b/searchlib/src/tests/memoryindex/document_remover/document_remover_test.cpp
index 8c6751adbeb..838e876d284 100644
--- a/searchlib/src/tests/memoryindex/document_remover/document_remover_test.cpp
+++ b/searchlib/src/tests/memoryindex/document_remover/document_remover_test.cpp
@@ -64,7 +64,7 @@ struct Fixture
{
MockRemoveListener _listener;
std::vector<std::unique_ptr<WordStore>> _wordStores;
- std::vector<std::map<vespalib::string, btree::EntryRef>> _wordToRefMaps;
+ std::vector<std::map<vespalib::string, datastore::EntryRef>> _wordToRefMaps;
std::vector<std::unique_ptr<DocumentRemover>> _removers;
Fixture()
: _listener(),
@@ -80,12 +80,12 @@ struct Fixture
}
_wordToRefMaps.resize(numFields);
}
- btree::EntryRef getWordRef(const vespalib::string &word, uint32_t fieldId) {
+ datastore::EntryRef getWordRef(const vespalib::string &word, uint32_t fieldId) {
auto &wordToRefMap = _wordToRefMaps[fieldId];
WordStore &wordStore = *_wordStores[fieldId];
auto itr = wordToRefMap.find(word);
if (itr == wordToRefMap.end()) {
- btree::EntryRef ref = wordStore.addWord(word);
+ datastore::EntryRef ref = wordStore.addWord(word);
wordToRefMap[word] = ref;
return ref;
}
diff --git a/searchlib/src/tests/predicate/predicate_bounds_posting_list_test.cpp b/searchlib/src/tests/predicate/predicate_bounds_posting_list_test.cpp
index c54e6f49cc7..0f7802d63b0 100644
--- a/searchlib/src/tests/predicate/predicate_bounds_posting_list_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_bounds_posting_list_test.cpp
@@ -27,7 +27,7 @@ const uint64_t hash = 0x123;
TEST("require that empty bounds posting list starts at 0.") {
PredicateIndex index(generation_handler, generation_holder, limit_provider, config, 8);
- btree::EntryRef ref;
+ datastore::EntryRef ref;
PredicateBoundsPostingList<PredicateIndex::BTreeIterator>
posting_list(index.getIntervalStore(),
index.getBoundsIndex().getBTreePostingList(ref), 42);
diff --git a/searchlib/src/tests/predicate/predicate_index_test.cpp b/searchlib/src/tests/predicate/predicate_index_test.cpp
index e4d9aeef1f0..5a6b6240e65 100644
--- a/searchlib/src/tests/predicate/predicate_index_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_index_test.cpp
@@ -237,7 +237,7 @@ void checkAllIntervals(Iterator posting_it, IntervalT expected_interval,
for (uint32_t id = 1; id < 100u; ++id) {
ASSERT_TRUE(posting_it.valid());
EXPECT_EQUAL(id, posting_it.getKey());
- btree::EntryRef ref = posting_it.getData();
+ datastore::EntryRef ref = posting_it.getData();
ASSERT_TRUE(ref.valid());
uint32_t size;
IntervalT single;
diff --git a/searchlib/src/tests/predicate/predicate_interval_posting_list_test.cpp b/searchlib/src/tests/predicate/predicate_interval_posting_list_test.cpp
index 1c44c096717..18feb30106f 100644
--- a/searchlib/src/tests/predicate/predicate_interval_posting_list_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_interval_posting_list_test.cpp
@@ -26,7 +26,7 @@ const uint64_t hash = 0x123;
TEST("require that empty posting list starts at 0.") {
PredicateIndex index(generation_handler, generation_holder, limit_provider, config, 8);
- btree::EntryRef ref;
+ datastore::EntryRef ref;
PredicateIntervalPostingList<PredicateIndex::BTreeIterator>
posting_list(index.getIntervalStore(), index.getIntervalIndex().getBTreePostingList(ref));
EXPECT_EQUAL(0u, posting_list.getDocId());
diff --git a/searchlib/src/tests/predicate/predicate_zstar_compressed_posting_list_test.cpp b/searchlib/src/tests/predicate/predicate_zstar_compressed_posting_list_test.cpp
index 2dff14b4417..5946bc926d0 100644
--- a/searchlib/src/tests/predicate/predicate_zstar_compressed_posting_list_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_zstar_compressed_posting_list_test.cpp
@@ -28,7 +28,7 @@ const uint64_t hash = 0x123;
TEST("require that empty posting list starts at 0.") {
PredicateIndex index(generation_handler, generation_holder, limit_provider, config, 8);
- btree::EntryRef ref;
+ datastore::EntryRef ref;
PredicateZstarCompressedPostingList<PredicateIndex::BTreeIterator>
posting_list(index.getIntervalStore(), index.getIntervalIndex().getBTreePostingList(ref));
EXPECT_EQUAL(0u, posting_list.getDocId());
diff --git a/searchlib/src/tests/predicate/simple_index_test.cpp b/searchlib/src/tests/predicate/simple_index_test.cpp
index 59e4fc53c05..f8a1d3f1366 100644
--- a/searchlib/src/tests/predicate/simple_index_test.cpp
+++ b/searchlib/src/tests/predicate/simple_index_test.cpp
@@ -91,7 +91,7 @@ struct Fixture {
SimpleIndex<MyData>::VectorIterator getVectorPostingList(uint64_t k) {
return *_index.getVectorPostingList(k);
}
- SimpleIndex<MyData>::BTreeIterator getBTreePostingList(btree::EntryRef ref) {
+ SimpleIndex<MyData>::BTreeIterator getBTreePostingList(datastore::EntryRef ref) {
return _index.getBTreePostingList(ref);
}
void commit() {
@@ -105,7 +105,7 @@ TEST_F("require that SimpleIndex can insert and remove a value.", Fixture) {
f.commit();
auto it = f.lookup(key);
ASSERT_TRUE(it.valid());
- btree::EntryRef ref = it.getData();
+ datastore::EntryRef ref = it.getData();
auto posting_it = f.getBTreePostingList(ref);
ASSERT_TRUE(posting_it.valid());
EXPECT_EQUAL(doc_id, posting_it.getKey());
@@ -130,7 +130,7 @@ TEST_F("require that SimpleIndex can insert and remove many values.", Fixture) {
f.commit();
auto it = f.lookup(key);
ASSERT_TRUE(it.valid());
- btree::EntryRef ref = it.getData();
+ datastore::EntryRef ref = it.getData();
auto posting_it = f.getBTreePostingList(ref);
for (size_t id = 1; id < 100; ++id) {
ASSERT_TRUE(posting_it.valid());
@@ -174,7 +174,7 @@ TEST_FF("require that SimpleIndex can be serialized and deserialized.", Fixture,
auto it = f2.lookup(key);
ASSERT_TRUE(it.valid());
- btree::EntryRef ref = it.getData();
+ datastore::EntryRef ref = it.getData();
auto posting_it = f1.getBTreePostingList(ref);
for (uint32_t id = 1; id < 100; ++id) {
ASSERT_TRUE(posting_it.valid());
@@ -195,7 +195,7 @@ TEST_F("require that SimpleIndex can update by inserting the same key twice.", F
auto it = f.lookup(key);
ASSERT_TRUE(it.valid());
- btree::EntryRef ref = it.getData();
+ datastore::EntryRef ref = it.getData();
auto posting_it = f.getBTreePostingList(ref);
ASSERT_TRUE(posting_it.valid());
EXPECT_EQUAL(doc_id, posting_it.getKey());