summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/tests/attribute/multi_value_mapping/multi_value_mapping_test.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multi_value_mapping.h1
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multi_value_mapping.hpp5
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multivalueattribute.hpp5
-rw-r--r--searchlib/src/vespa/searchlib/attribute/raw_buffer_store.cpp7
5 files changed, 14 insertions, 8 deletions
diff --git a/searchlib/src/tests/attribute/multi_value_mapping/multi_value_mapping_test.cpp b/searchlib/src/tests/attribute/multi_value_mapping/multi_value_mapping_test.cpp
index 4b01808e855..e3e4f391cc4 100644
--- a/searchlib/src/tests/attribute/multi_value_mapping/multi_value_mapping_test.cpp
+++ b/searchlib/src/tests/attribute/multi_value_mapping/multi_value_mapping_test.cpp
@@ -95,7 +95,7 @@ public:
ArrayStoreConfig config(max_array_store_type_id,
ArrayStoreConfig::AllocSpec(0, RefType::offsetSize(), 8_Ki, ALLOC_GROW_FACTOR));
config.enable_free_lists(enable_free_lists);
- _mvMapping = std::make_unique<MvMapping>(config, vespalib::GrowStrategy(), std::make_unique<MemoryAllocatorObserver>(_stats));
+ _mvMapping = std::make_unique<MvMapping>(config, ArrayStoreConfig::default_max_buffer_size, vespalib::GrowStrategy(), std::make_unique<MemoryAllocatorObserver>(_stats));
_attr = std::make_unique<AttributeType>(*_mvMapping);
_maxSmallArraySize = _mvMapping->get_mapper().get_array_size(max_array_store_type_id);
}
@@ -103,7 +103,7 @@ public:
ArrayStoreConfig config(max_array_store_type_id,
ArrayStoreConfig::AllocSpec(min_entries, max_entries, num_entries_for_new_buffer, ALLOC_GROW_FACTOR));
config.enable_free_lists(enable_free_lists);
- _mvMapping = std::make_unique<MvMapping>(config, vespalib::GrowStrategy(), std::make_unique<MemoryAllocatorObserver>(_stats));
+ _mvMapping = std::make_unique<MvMapping>(config, ArrayStoreConfig::default_max_buffer_size, vespalib::GrowStrategy(), std::make_unique<MemoryAllocatorObserver>(_stats));
_attr = std::make_unique<AttributeType>(*_mvMapping);
_maxSmallArraySize = _mvMapping->get_mapper().get_array_size(max_array_store_type_id);
}
diff --git a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.h b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.h
index 25ca7729a32..ced076dc632 100644
--- a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.h
+++ b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.h
@@ -36,6 +36,7 @@ public:
MultiValueMapping(const MultiValueMapping &) = delete;
MultiValueMapping & operator = (const MultiValueMapping &) = delete;
MultiValueMapping(const vespalib::datastore::ArrayStoreConfig &storeCfg,
+ size_t max_buffer_size,
const vespalib::GrowStrategy &gs,
std::shared_ptr<vespalib::alloc::MemoryAllocator> memory_allocator);
~MultiValueMapping() override;
diff --git a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.hpp b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.hpp
index 3c9a52f2e5c..64c4777ffda 100644
--- a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.hpp
+++ b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.hpp
@@ -9,10 +9,11 @@ namespace search::attribute {
template <typename ElemT, typename RefT>
MultiValueMapping<ElemT,RefT>::MultiValueMapping(const vespalib::datastore::ArrayStoreConfig &storeCfg,
+ size_t max_buffer_size,
const vespalib::GrowStrategy &gs,
std::shared_ptr<vespalib::alloc::MemoryAllocator> memory_allocator)
: MultiValueMappingBase(gs, ArrayStore::getGenerationHolderLocation(_store), memory_allocator),
- _store(storeCfg, std::move(memory_allocator), ArrayStoreTypeMapper(storeCfg.max_type_id(), array_store_grow_factor))
+ _store(storeCfg, std::move(memory_allocator), ArrayStoreTypeMapper(storeCfg.max_type_id(), array_store_grow_factor, max_buffer_size))
{
}
@@ -73,7 +74,7 @@ MultiValueMapping<ElemT, RefT>::optimizedConfigForHugePage(size_t max_type_id,
float allocGrowFactor,
bool enable_free_lists)
{
- ArrayStoreTypeMapper mapper(max_type_id, array_store_grow_factor);
+ ArrayStoreTypeMapper mapper(max_type_id, array_store_grow_factor, max_buffer_size);
auto result = ArrayStore::optimizedConfigForHugePage(max_type_id, mapper, hugePageSize, smallPageSize, max_buffer_size, min_num_entries_for_new_buffer, allocGrowFactor);
result.enable_free_lists(enable_free_lists);
return result;
diff --git a/searchlib/src/vespa/searchlib/attribute/multivalueattribute.hpp b/searchlib/src/vespa/searchlib/attribute/multivalueattribute.hpp
index 3cf75b450af..56c6d010582 100644
--- a/searchlib/src/vespa/searchlib/attribute/multivalueattribute.hpp
+++ b/searchlib/src/vespa/searchlib/attribute/multivalueattribute.hpp
@@ -12,6 +12,8 @@
#include <vespa/vespalib/util/memory_allocator.h>
#include <vespa/vespalib/util/stash.h>
+using vespalib::datastore::ArrayStoreConfig;
+
namespace search {
namespace multivalueattribute {
@@ -28,10 +30,11 @@ MultiValueAttribute(const vespalib::string &baseFileName,
_mvMapping(MultiValueMapping::optimizedConfigForHugePage(MultiValueMapping::array_store_max_type_id,
vespalib::alloc::MemoryAllocator::HUGEPAGE_SIZE,
vespalib::alloc::MemoryAllocator::PAGE_SIZE,
- vespalib::datastore::ArrayStoreConfig::default_max_buffer_size,
+ ArrayStoreConfig::default_max_buffer_size,
8 * 1024,
cfg.getGrowStrategy().getMultiValueAllocGrowFactor(),
multivalueattribute::enable_free_lists),
+ ArrayStoreConfig::default_max_buffer_size,
cfg.getGrowStrategy(), this->get_memory_allocator())
{
}
diff --git a/searchlib/src/vespa/searchlib/attribute/raw_buffer_store.cpp b/searchlib/src/vespa/searchlib/attribute/raw_buffer_store.cpp
index 00c195b9eb7..0c6dd9c75a8 100644
--- a/searchlib/src/vespa/searchlib/attribute/raw_buffer_store.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/raw_buffer_store.cpp
@@ -5,6 +5,7 @@
#include <cassert>
using vespalib::alloc::MemoryAllocator;
+using vespalib::datastore::ArrayStoreConfig;
using vespalib::datastore::EntryRef;
namespace {
@@ -17,12 +18,12 @@ namespace search::attribute {
RawBufferStore::RawBufferStore(std::shared_ptr<vespalib::alloc::MemoryAllocator> allocator, uint32_t max_small_buffer_type_id, double grow_factor)
: _array_store(ArrayStoreType::optimizedConfigForHugePage(max_small_buffer_type_id,
- TypeMapper(max_small_buffer_type_id, grow_factor),
+ TypeMapper(max_small_buffer_type_id, grow_factor, ArrayStoreConfig::default_max_buffer_size),
MemoryAllocator::HUGEPAGE_SIZE,
MemoryAllocator::PAGE_SIZE,
- vespalib::datastore::ArrayStoreConfig::default_max_buffer_size,
+ ArrayStoreConfig::default_max_buffer_size,
8_Ki, ALLOC_GROW_FACTOR),
- std::move(allocator), TypeMapper(max_small_buffer_type_id, grow_factor))
+ std::move(allocator), TypeMapper(max_small_buffer_type_id, grow_factor, ArrayStoreConfig::default_max_buffer_size))
{
}