summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@verizonmedia.com>2020-09-07 11:24:39 +0200
committerGitHub <noreply@github.com>2020-09-07 11:24:39 +0200
commitd4dd7c4e8947818d1a462724659fd8bdfc4ba06e (patch)
tree8103ae06c9dc5149e677f960ff5c4ea0761700f7 /vespalib
parentc5c4891e072c4e9223f6e8851716f8cd863e9d97 (diff)
parent55742ef2731b333a057baa2f0d3c4d0a13e0dffe (diff)
Merge pull request #14295 from vespa-engine/vekterli/add-content-bucket-db-metrics-and-reduce-memory-footprint
Add content bucket DB metrics and reduce memory footprint
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/datastore/datastore.h3
-rw-r--r--vespalib/src/vespa/vespalib/datastore/datastore.hpp6
2 files changed, 8 insertions, 1 deletions
diff --git a/vespalib/src/vespa/vespalib/datastore/datastore.h b/vespalib/src/vespa/vespalib/datastore/datastore.h
index e67d9049f0b..686b07766ac 100644
--- a/vespalib/src/vespa/vespalib/datastore/datastore.h
+++ b/vespalib/src/vespa/vespalib/datastore/datastore.h
@@ -108,7 +108,8 @@ public:
DataStore(const DataStore &rhs) = delete;
DataStore &operator=(const DataStore &rhs) = delete;
DataStore();
- DataStore(BufferTypeUP type);
+ explicit DataStore(uint32_t min_arrays);
+ explicit DataStore(BufferTypeUP type);
~DataStore();
EntryRef addEntry(const EntryType &e);
diff --git a/vespalib/src/vespa/vespalib/datastore/datastore.hpp b/vespalib/src/vespa/vespalib/datastore/datastore.hpp
index b66a3b78603..f4e37804317 100644
--- a/vespalib/src/vespa/vespalib/datastore/datastore.hpp
+++ b/vespalib/src/vespa/vespalib/datastore/datastore.hpp
@@ -138,6 +138,12 @@ DataStore<EntryType, RefT>::DataStore()
}
template <typename EntryType, typename RefT>
+DataStore<EntryType, RefT>::DataStore(uint32_t min_arrays)
+ : DataStore(std::make_unique<BufferType<EntryType>>(1, min_arrays, RefType::offsetSize()))
+{
+}
+
+template <typename EntryType, typename RefT>
DataStore<EntryType, RefT>::DataStore(BufferTypeUP type)
: ParentType(),
_type(std::move(type))