summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2021-07-15 14:30:14 +0000
committerGeir Storli <geirst@verizonmedia.com>2021-07-15 14:30:14 +0000
commit63ff8a6794678fe9a50bfa6f5c3a3eebe52a9596 (patch)
tree6018dbf7b1d2e842fd44173f412ce4dce993335c /searchcore
parentf505d2be5cda0c843063ab3624d6edf422070939 (diff)
Generalize how address space usage is reported from attribute vectors.
This prepares for reporting address space usage for more attribute vector components, not only enum store and multi-value mapping.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_usage_filter/attribute_usage_filter_test.cpp19
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.cpp9
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp4
3 files changed, 18 insertions, 14 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_usage_filter/attribute_usage_filter_test.cpp b/searchcore/src/tests/proton/attribute/attribute_usage_filter/attribute_usage_filter_test.cpp
index bcfdca9da19..a1c7b0a152d 100644
--- a/searchcore/src/tests/proton/attribute/attribute_usage_filter/attribute_usage_filter_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_usage_filter/attribute_usage_filter_test.cpp
@@ -1,10 +1,13 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
-LOG_SETUP("attribute_usage_filter_test");
-#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/vespalib/util/size_literals.h>
+
#include <vespa/searchcore/proton/attribute/attribute_usage_filter.h>
#include <vespa/searchcore/proton/attribute/i_attribute_usage_listener.h>
+#include <vespa/searchlib/attribute/address_space_components.h>
+#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/util/size_literals.h>
+
+#include <vespa/log/log.h>
+LOG_SETUP("attribute_usage_filter_test");
using proton::AttributeUsageFilter;
using proton::AttributeUsageStats;
@@ -24,15 +27,15 @@ class MyAttributeStats : public AttributeUsageStats
{
public:
void triggerEnumStoreLimit() {
- merge({ enumStoreOverLoad,
- search::AddressSpaceUsage::defaultMultiValueUsage() },
+ merge({ enumStoreOverLoad,
+ search::AddressSpaceComponents::default_multi_value_usage() },
"enumeratedName",
"ready");
}
void triggerMultiValueLimit() {
- merge({ search::AddressSpaceUsage::defaultEnumStoreUsage(),
- multiValueOverLoad },
+ merge({ search::AddressSpaceComponents::default_enum_store_usage(),
+ multiValueOverLoad },
"multiValueName",
"ready");
}
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.cpp
index f3da5486d3e..e7d6713441d 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.cpp
@@ -1,13 +1,14 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "attribute_usage_stats.h"
+#include <vespa/searchlib/attribute/address_space_components.h>
#include <iostream>
namespace proton {
AttributeUsageStats::AttributeUsageStats()
- : _enumStoreUsage(search::AddressSpaceUsage::defaultEnumStoreUsage()),
- _multiValueUsage(search::AddressSpaceUsage::defaultMultiValueUsage())
+ : _enumStoreUsage(search::AddressSpaceComponents::default_enum_store_usage()),
+ _multiValueUsage(search::AddressSpaceComponents::default_multi_value_usage())
{
}
@@ -16,8 +17,8 @@ AttributeUsageStats::merge(const search::AddressSpaceUsage &usage,
const vespalib::string &attributeName,
const vespalib::string &subDbName)
{
- _enumStoreUsage.merge(usage.enumStoreUsage(), attributeName, subDbName);
- _multiValueUsage.merge(usage.multiValueUsage(), attributeName, subDbName);
+ _enumStoreUsage.merge(usage.enum_store_usage(), attributeName, subDbName);
+ _multiValueUsage.merge(usage.multi_value_usage(), attributeName, subDbName);
}
std::ostream&
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp
index 2ffe3f2c901..ddf240ad90c 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp
@@ -63,8 +63,8 @@ convertAddressSpaceToSlime(const AddressSpace &addressSpace, Cursor &object)
void
convertAddressSpaceUsageToSlime(const AddressSpaceUsage &usage, Cursor &object)
{
- convertAddressSpaceToSlime(usage.enumStoreUsage(), object.setObject("enumStore"));
- convertAddressSpaceToSlime(usage.multiValueUsage(), object.setObject("multiValue"));
+ convertAddressSpaceToSlime(usage.enum_store_usage(), object.setObject("enumStore"));
+ convertAddressSpaceToSlime(usage.multi_value_usage(), object.setObject("multiValue"));
}
void