diff options
author | Geir Storli <geirst@verizonmedia.com> | 2019-09-04 12:47:51 +0000 |
---|---|---|
committer | Geir Storli <geirst@verizonmedia.com> | 2019-09-04 12:47:51 +0000 |
commit | 47026cc503f0efc574283ee0106512b759ddb5da (patch) | |
tree | 75a28d1fe128092cc59f08a05b9112eb0405b975 /searchlib/src | |
parent | ea1f51fd2fed6293048e05bb20145d817752ae9c (diff) |
Reduce exposure of the internal index type outside the enum store.
Diffstat (limited to 'searchlib/src')
7 files changed, 11 insertions, 17 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/address_space_usage.cpp b/searchlib/src/vespa/searchlib/attribute/address_space_usage.cpp index e03eec2764a..692adaf3817 100644 --- a/searchlib/src/vespa/searchlib/attribute/address_space_usage.cpp +++ b/searchlib/src/vespa/searchlib/attribute/address_space_usage.cpp @@ -21,7 +21,7 @@ AddressSpaceUsage::AddressSpaceUsage(const AddressSpace &enumStoreUsage_, AddressSpace AddressSpaceUsage::defaultEnumStoreUsage() { - return AddressSpace(0, 0, IEnumStore::Index::offsetSize()); + return AddressSpace(0, 0, IEnumStore::InternalIndex::offsetSize()); } AddressSpace diff --git a/searchlib/src/vespa/searchlib/attribute/enum_store_types.h b/searchlib/src/vespa/searchlib/attribute/enum_store_types.h index 9933639ee56..ffc5754da5d 100644 --- a/searchlib/src/vespa/searchlib/attribute/enum_store_types.h +++ b/searchlib/src/vespa/searchlib/attribute/enum_store_types.h @@ -8,7 +8,8 @@ namespace search::enumstore { -using Index = datastore::EntryRefT<22>; +using Index = datastore::EntryRef; +using InternalIndex = datastore::EntryRefT<22>; using IndexVector = vespalib::Array<Index>; using EnumHandle = attribute::IAttributeVector::EnumHandle; using EnumVector = vespalib::Array<uint32_t>; diff --git a/searchlib/src/vespa/searchlib/attribute/enumattributesaver.cpp b/searchlib/src/vespa/searchlib/attribute/enumattributesaver.cpp index db235f91798..449f89f0386 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumattributesaver.cpp +++ b/searchlib/src/vespa/searchlib/attribute/enumattributesaver.cpp @@ -35,6 +35,6 @@ EnumAttributeSaver::writeUdat(IAttributeSaveTarget &saveTarget) namespace search::datastore { -template class UniqueStoreEnumerator<IEnumStore::Index>; +template class UniqueStoreEnumerator<IEnumStore::InternalIndex>; } diff --git a/searchlib/src/vespa/searchlib/attribute/enumattributesaver.h b/searchlib/src/vespa/searchlib/attribute/enumattributesaver.h index c399a0a88b1..6c52a7a4e2d 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumattributesaver.h +++ b/searchlib/src/vespa/searchlib/attribute/enumattributesaver.h @@ -17,7 +17,7 @@ class IAttributeSaveTarget; class EnumAttributeSaver { public: - using Enumerator = datastore::UniqueStoreEnumerator<IEnumStore::Index>; + using Enumerator = datastore::UniqueStoreEnumerator<IEnumStore::InternalIndex>; private: const IEnumStore &_enumStore; diff --git a/searchlib/src/vespa/searchlib/attribute/enumstore.cpp b/searchlib/src/vespa/searchlib/attribute/enumstore.cpp index 1d5b4348af8..4b600b7ec92 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumstore.cpp +++ b/searchlib/src/vespa/searchlib/attribute/enumstore.cpp @@ -1,7 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "enumstore.hpp" -#include <vespa/vespalib/stllike/hash_map.hpp> #include <vespa/vespalib/util/rcuvector.hpp> #include <iomanip> @@ -60,11 +59,8 @@ make_enum_store_dictionary(IEnumStore &store, bool has_postings, std::unique_ptr } } -vespalib::asciistream & operator << (vespalib::asciistream & os, const IEnumStore::Index & idx) { - return os << "offset(" << idx.offset() << "), bufferId(" << idx.bufferId() << "), idx(" << idx.ref() << ")"; -} -template class datastore::DataStoreT<IEnumStore::Index>; +template class datastore::DataStoreT<IEnumStore::InternalIndex>; template class btree::BTreeBuilder<IEnumStore::Index, btree::BTreeNoLeafData, btree::NoAggregated, @@ -88,6 +84,3 @@ namespace vespalib { template class RcuVectorBase<search::IEnumStore::Index>; } -VESPALIB_HASH_MAP_INSTANTIATE_H_E_M(search::IEnumStore::Index, search::IEnumStore::Index, - vespalib::hash<search::IEnumStore::Index>, std::equal_to<search::IEnumStore::Index>, - vespalib::hashtable_base::and_modulator); diff --git a/searchlib/src/vespa/searchlib/attribute/enumstore.h b/searchlib/src/vespa/searchlib/attribute/enumstore.h index 87d2dd6dcc7..3a493b74421 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumstore.h +++ b/searchlib/src/vespa/searchlib/attribute/enumstore.h @@ -85,10 +85,10 @@ public: using DataType = typename EntryType::Type; using ComparatorType = EnumStoreComparatorT<EntryType>; using AllocatorType = std::conditional_t<std::is_same_v<DataType, const char *>, - datastore::UniqueStoreStringAllocator<Index>, - datastore::UniqueStoreAllocator<DataType, Index>>; + datastore::UniqueStoreStringAllocator<InternalIndex>, + datastore::UniqueStoreAllocator<DataType, InternalIndex>>; - using UniqueStoreType = datastore::UniqueStore<DataType, Index, ComparatorType, AllocatorType>; + using UniqueStoreType = datastore::UniqueStore<DataType, InternalIndex, ComparatorType, AllocatorType>; using FoldedComparatorType = EnumStoreFoldedComparatorT<EntryType>; using EnumStoreType = EnumStoreT<EntryType>; using EntryRef = datastore::EntryRef; @@ -255,7 +255,6 @@ public: std::unique_ptr<datastore::IUniqueStoreDictionary> make_enum_store_dictionary(IEnumStore &store, bool has_postings, std::unique_ptr<datastore::EntryComparator> folded_compare); -vespalib::asciistream & operator << (vespalib::asciistream & os, const IEnumStore::Index & idx); extern template class datastore::DataStoreT<IEnumStore::Index>; diff --git a/searchlib/src/vespa/searchlib/attribute/i_enum_store.h b/searchlib/src/vespa/searchlib/attribute/i_enum_store.h index dbe1104baa0..7e9128c94be 100644 --- a/searchlib/src/vespa/searchlib/attribute/i_enum_store.h +++ b/searchlib/src/vespa/searchlib/attribute/i_enum_store.h @@ -32,10 +32,11 @@ class IEnumStoreDictionary; class IEnumStore { public: using Index = enumstore::Index; + using InternalIndex = enumstore::InternalIndex; using IndexVector = enumstore::IndexVector; using EnumHandle = enumstore::EnumHandle; using EnumVector = enumstore::EnumVector; - using EnumIndexRemapper = datastore::UniqueStoreRemapper<Index>; + using EnumIndexRemapper = datastore::UniqueStoreRemapper<InternalIndex>; struct CompareEnumIndex { using Index = IEnumStore::Index; |