Reduce EnumStoreDictionary B-tree exposure in PostingListAttribute unit test.
@@ -446,18 +446,18 @@ PostingListAttributeTest::checkPostingList(const VectorType & vec, const std::ve
const RangeGenerator & range)
{
const typename VectorType::EnumStore & enumStore = vec.getEnumStore();
- const typename VectorType::Dictionary & dict = enumStore.get_posting_dictionary();
+ auto& dict = enumStore.get_dictionary();
const typename VectorType::PostingList & postingList = vec.getPostingList();
for (size_t i = 0; i < values.size(); ++i) {
const uint32_t docBegin = range.getBegin(i);
const uint32_t docEnd = range.getEnd(i);
- auto itr = dict.find(enumstore::Index(), enumStore.make_comparator(values[i]));
- ASSERT_TRUE(itr.valid());
+ auto find_result = dict.find_posting_list(enumStore.make_comparator(values[i]), dict.get_frozen_root());
+ ASSERT_TRUE(find_result.first.valid());
typename VectorType::PostingList::Iterator postings;
- postings = postingList.begin(vespalib::datastore::EntryRef(itr.getData()));
+ postings = postingList.begin(find_result.second);
uint32_t doc = docBegin;
uint32_t numHits(0);
@@ -669,14 +669,13 @@ void
PostingListAttributeTest::checkPostingList(AttributeType & vec, ValueType value, DocSet expected)
{
const typename AttributeType::EnumStore & enumStore = vec.getEnumStore();
- const typename AttributeType::Dictionary & dict = enumStore.get_posting_dictionary();
+ auto& dict = enumStore.get_dictionary();
const typename AttributeType::PostingList & postingList = vec.getPostingList();
- auto itr = dict.find(typename AttributeType::EnumIndex(),
- vec.getEnumStore().make_comparator(value));
- ASSERT_TRUE(itr.valid());
+ auto find_result = dict.find_posting_list(vec.getEnumStore().make_comparator(value), dict.get_frozen_root());
+ ASSERT_TRUE(find_result.first.valid());
typename AttributeType::PostingList::Iterator postings;
- postings = postingList.begin(vespalib::datastore::EntryRef(itr.getData()));
+ postings = postingList.begin(find_result.second);
DocSet::iterator docBegin = expected.begin();
DocSet::iterator docEnd = expected.end();
@@ -690,10 +689,9 @@ template <typename AttributeType, typename ValueType>
void
PostingListAttributeTest::checkNonExistantPostingList(AttributeType & vec, ValueType value)
{
- const typename AttributeType::Dictionary & dict = vec.getEnumStore().get_posting_dictionary();
- auto itr = dict.find(typename AttributeType::EnumIndex(),
- vec.getEnumStore().make_comparator(value));
- EXPECT_TRUE(!itr.valid());
+ auto& dict = vec.getEnumStore().get_dictionary();
+ auto find_result = dict.find_posting_list(vec.getEnumStore().make_comparator(value), dict.get_frozen_root());
+ EXPECT_TRUE(!find_result.first.valid());
}
template <typename AttributeType, typename ValueType>
