summaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/attribute/attribute_test.cpp
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2019-11-14 08:49:45 +0000
committerGeir Storli <geirst@verizonmedia.com>2019-11-14 08:49:45 +0000
commit3e8c96fcba038b3b68f75073fbe516912d169311 (patch)
treec54a28883ff7f7b29ba111234498758478d36477 /searchlib/src/tests/attribute/attribute_test.cpp
parent03d90c743ae83cfea09be55cb7f1787aa8c8453b (diff)
Enable free lists for multi-value mapping used in all multi-value attributes.
This should reduce the need for compaction which is CPU intensive for some applications.
Diffstat (limited to 'searchlib/src/tests/attribute/attribute_test.cpp')
-rw-r--r--searchlib/src/tests/attribute/attribute_test.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/searchlib/src/tests/attribute/attribute_test.cpp b/searchlib/src/tests/attribute/attribute_test.cpp
index ce1344f5c26..f402f536ae2 100644
--- a/searchlib/src/tests/attribute/attribute_test.cpp
+++ b/searchlib/src/tests/attribute/attribute_test.cpp
@@ -2241,7 +2241,22 @@ void testNamePrefix() {
EXPECT_EQUAL("sfsint32_pc", vS2->getNamePrefix());
EXPECT_EQUAL("sfsint32_pc.xyz.abc", vSS1->getName());
EXPECT_EQUAL("sfsint32_pc", vSS1->getNamePrefix());
+}
+
+class MyMultiValueAttribute : public ArrayStringAttribute {
+public:
+ MyMultiValueAttribute(const vespalib::string& name)
+ : ArrayStringAttribute(name, Config(BasicType::STRING, CollectionType::ARRAY))
+ {
+ }
+ bool has_free_lists_enabled() const { return this->_mvMapping.has_free_lists_enabled(); }
+};
+void
+test_multi_value_mapping_has_free_lists_enabled()
+{
+ MyMultiValueAttribute attr("mvtest");
+ EXPECT_TRUE(attr.has_free_lists_enabled());
}
void
@@ -2292,6 +2307,7 @@ int AttributeTest::Main()
testReaderDuringLastUpdate();
TEST_DO(testPendingCompaction());
TEST_DO(testNamePrefix());
+ test_multi_value_mapping_has_free_lists_enabled();
deleteDataDirs();
TEST_DONE();