diff options
author | Tor Egge <Tor.Egge@oath.com> | 2018-09-10 13:42:42 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2018-09-10 13:42:42 +0000 |
commit | 90f16b7689e19faef111f127908a513bb6990bb1 (patch) | |
tree | 7b589628fa7fbea1c2b2509ad71bb28b0fd3c494 /searchlib | |
parent | 278b2cb304fc1c98691e0b36de42a31c9128172d (diff) |
Rename AttributeKeyedNode to AttributeMapLookupNode.
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/tests/expression/attributenode/attribute_node_test.cpp | 6 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/aggregation/modifiers.cpp | 4 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/expression/CMakeLists.txt | 2 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/expression/attribute_map_lookup_node.cpp (renamed from searchlib/src/vespa/searchlib/expression/attribute_keyed_node.cpp) | 50 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/expression/attribute_map_lookup_node.h (renamed from searchlib/src/vespa/searchlib/expression/attribute_keyed_node.h) | 16 |
5 files changed, 39 insertions, 39 deletions
diff --git a/searchlib/src/tests/expression/attributenode/attribute_node_test.cpp b/searchlib/src/tests/expression/attributenode/attribute_node_test.cpp index c92b5fc4808..b2e4bd41680 100644 --- a/searchlib/src/tests/expression/attributenode/attribute_node_test.cpp +++ b/searchlib/src/tests/expression/attributenode/attribute_node_test.cpp @@ -10,7 +10,7 @@ #include <vespa/searchlib/attribute/integerbase.h> #include <vespa/searchlib/attribute/stringbase.h> #include <vespa/searchlib/expression/attributenode.h> -#include <vespa/searchlib/expression/attribute_keyed_node.h> +#include <vespa/searchlib/expression/attribute_map_lookup_node.h> #include <vespa/searchlib/expression/resultvector.h> #include <vespa/vespalib/test/insertion_operators.h> #include <vespa/vespalib/testkit/testapp.h> @@ -31,7 +31,7 @@ using search::attribute::Config; using search::attribute::IAttributeVector; using search::attribute::getUndefined; using search::expression::AttributeNode; -using search::expression::AttributeKeyedNode; +using search::expression::AttributeMapLookupNode; using search::expression::EnumResultNode; using search::expression::EnumResultNodeVector; using search::expression::FloatResultNode; @@ -220,7 +220,7 @@ Fixture::makeNode(const vespalib::string &attributeName, bool useEnumOptimizatio if (attributeName.find('{') == vespalib::string::npos) { node = std::make_unique<AttributeNode>(attributeName); } else { - node = std::make_unique<AttributeKeyedNode>(attributeName); + node = std::make_unique<AttributeMapLookupNode>(attributeName); } if (useEnumOptimization) { node->useEnumOptimization(); diff --git a/searchlib/src/vespa/searchlib/aggregation/modifiers.cpp b/searchlib/src/vespa/searchlib/aggregation/modifiers.cpp index fe71484c4e6..0b91d37862d 100644 --- a/searchlib/src/vespa/searchlib/aggregation/modifiers.cpp +++ b/searchlib/src/vespa/searchlib/aggregation/modifiers.cpp @@ -4,7 +4,7 @@ #include "grouping.h" #include <vespa/searchlib/expression/multiargfunctionnode.h> #include <vespa/searchlib/expression/attributenode.h> -#include <vespa/searchlib/expression/attribute_keyed_node.h> +#include <vespa/searchlib/expression/attribute_map_lookup_node.h> #include <vespa/searchlib/expression/documentfieldnode.h> using namespace search::expression; @@ -72,7 +72,7 @@ Attribute2AttributeKeyed::getReplacementNode(const AttributeNode &attributeNode) if (attributeNode.isKeyed() || lBracePos == vespalib::string::npos) { return std::unique_ptr<ExpressionNode>(); } else { - return std::make_unique<AttributeKeyedNode>(attributeName); + return std::make_unique<AttributeMapLookupNode>(attributeName); } } diff --git a/searchlib/src/vespa/searchlib/expression/CMakeLists.txt b/searchlib/src/vespa/searchlib/expression/CMakeLists.txt index 944bc6f63df..652fa5a3b01 100644 --- a/searchlib/src/vespa/searchlib/expression/CMakeLists.txt +++ b/searchlib/src/vespa/searchlib/expression/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. vespa_add_library(searchlib_expression OBJECT SOURCES - attribute_keyed_node.cpp + attribute_map_lookup_node.cpp attributenode.cpp attributeresult.cpp enumattributeresult.cpp diff --git a/searchlib/src/vespa/searchlib/expression/attribute_keyed_node.cpp b/searchlib/src/vespa/searchlib/expression/attribute_map_lookup_node.cpp index da6ed363b17..f4593552a47 100644 --- a/searchlib/src/vespa/searchlib/expression/attribute_keyed_node.cpp +++ b/searchlib/src/vespa/searchlib/expression/attribute_map_lookup_node.cpp @@ -1,6 +1,6 @@ // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include "attribute_keyed_node.h" +#include "attribute_map_lookup_node.h" #include <vespa/vespalib/stllike/asciistream.h> #include <vespa/vespalib/util/exceptions.h> #include <vespa/searchcommon/attribute/attributecontent.h> @@ -15,7 +15,7 @@ using EnumHandle = IAttributeVector::EnumHandle; namespace search::expression { -class AttributeKeyedNode::KeyHandler +class AttributeMapLookupNode::KeyHandler { protected: const IAttributeVector &_attribute; @@ -34,7 +34,7 @@ namespace { vespalib::string indirectKeyMarker("attribute("); -class BadKeyHandler : public AttributeKeyedNode::KeyHandler +class BadKeyHandler : public AttributeMapLookupNode::KeyHandler { public: BadKeyHandler(const IAttributeVector &attribute) @@ -70,7 +70,7 @@ EnumHandle convertKey<EnumHandle>(const IAttributeVector &attribute, const vespa } template <typename T, typename KeyType = T> -class KeyHandlerT : public AttributeKeyedNode::KeyHandler +class KeyHandlerT : public AttributeMapLookupNode::KeyHandler { AttributeContent<T> _keys; KeyType _key; @@ -119,7 +119,7 @@ matchingKey<const char *>(const char *lhs, const char *rhs) } template <typename T> -class IndirectKeyHandlerT : public AttributeKeyedNode::KeyHandler +class IndirectKeyHandlerT : public AttributeMapLookupNode::KeyHandler { const IAttributeVector &_keySourceAttribute; AttributeContent<T> _keys; @@ -157,9 +157,9 @@ using IndirectStringKeyHandler = IndirectKeyHandlerT<const char *>; class ValueHandler : public AttributeNode::Handler { protected: - std::unique_ptr<AttributeKeyedNode::KeyHandler> _keyHandler; + std::unique_ptr<AttributeMapLookupNode::KeyHandler> _keyHandler; const IAttributeVector &_attribute; - ValueHandler(std::unique_ptr<AttributeKeyedNode::KeyHandler> keyHandler, const IAttributeVector &attribute) + ValueHandler(std::unique_ptr<AttributeMapLookupNode::KeyHandler> keyHandler, const IAttributeVector &attribute) : _keyHandler(std::move(keyHandler)), _attribute(attribute) { @@ -173,7 +173,7 @@ class ValueHandlerT : public ValueHandler ResultNodeType &_result; T _undefinedValue; public: - ValueHandlerT(std::unique_ptr<AttributeKeyedNode::KeyHandler> keyHandler, const IAttributeVector &attribute, ResultNodeType &result, T undefinedValue) + ValueHandlerT(std::unique_ptr<AttributeMapLookupNode::KeyHandler> keyHandler, const IAttributeVector &attribute, ResultNodeType &result, T undefinedValue) : ValueHandler(std::move(keyHandler), attribute), _values(), _result(result), @@ -183,7 +183,7 @@ public: void handle(const AttributeResult & r) override { uint32_t docId = r.getDocId(); uint32_t keyIdx = _keyHandler->handle(docId); - if (keyIdx != AttributeKeyedNode::KeyHandler::noKeyIdx()) { + if (keyIdx != AttributeMapLookupNode::KeyHandler::noKeyIdx()) { _values.fill(_attribute, docId); if (keyIdx < _values.size()) { _result = _values[keyIdx]; @@ -228,7 +228,7 @@ IAttributeVector::largeint_t getUndefinedValue(BasicType::Type basicType) } -AttributeKeyedNode::AttributeKeyedNode() +AttributeMapLookupNode::AttributeMapLookupNode() : AttributeNode(), _keyAttributeName(), _valueAttributeName(), @@ -239,9 +239,9 @@ AttributeKeyedNode::AttributeKeyedNode() { } -AttributeKeyedNode::AttributeKeyedNode(const AttributeKeyedNode &) = default; +AttributeMapLookupNode::AttributeMapLookupNode(const AttributeMapLookupNode &) = default; -AttributeKeyedNode::AttributeKeyedNode(vespalib::stringref name) +AttributeMapLookupNode::AttributeMapLookupNode(vespalib::stringref name) : AttributeNode(name), _keyAttributeName(), _valueAttributeName(), @@ -253,13 +253,13 @@ AttributeKeyedNode::AttributeKeyedNode(vespalib::stringref name) setupAttributeNames(); } -AttributeKeyedNode::~AttributeKeyedNode() = default; +AttributeMapLookupNode::~AttributeMapLookupNode() = default; -AttributeKeyedNode & -AttributeKeyedNode::operator=(const AttributeKeyedNode &rhs) = default; +AttributeMapLookupNode & +AttributeMapLookupNode::operator=(const AttributeMapLookupNode &rhs) = default; void -AttributeKeyedNode::setupAttributeNames() +AttributeMapLookupNode::setupAttributeNames() { vespalib::asciistream keyName; vespalib::asciistream valueName; @@ -282,15 +282,15 @@ AttributeKeyedNode::setupAttributeNames() template <typename ResultNodeType> void -AttributeKeyedNode::prepareIntValues(std::unique_ptr<KeyHandler> keyHandler, const IAttributeVector &attribute, IAttributeVector::largeint_t undefinedValue) +AttributeMapLookupNode::prepareIntValues(std::unique_ptr<KeyHandler> keyHandler, const IAttributeVector &attribute, IAttributeVector::largeint_t undefinedValue) { auto resultNode = std::make_unique<ResultNodeType>(); _handler = std::make_unique<IntegerValueHandler<ResultNodeType>>(std::move(keyHandler), attribute, *resultNode, undefinedValue); setResultType(std::move(resultNode)); } -std::unique_ptr<AttributeKeyedNode::KeyHandler> -AttributeKeyedNode::makeKeyHandlerHelper() +std::unique_ptr<AttributeMapLookupNode::KeyHandler> +AttributeMapLookupNode::makeKeyHandlerHelper() { const IAttributeVector &attribute = *_keyAttribute; if (_keySourceAttribute != nullptr) { @@ -318,8 +318,8 @@ AttributeKeyedNode::makeKeyHandlerHelper() } } -std::unique_ptr<AttributeKeyedNode::KeyHandler> -AttributeKeyedNode::makeKeyHandler() +std::unique_ptr<AttributeMapLookupNode::KeyHandler> +AttributeMapLookupNode::makeKeyHandler() { try { return makeKeyHandlerHelper(); @@ -329,7 +329,7 @@ AttributeKeyedNode::makeKeyHandler() } void -AttributeKeyedNode::onPrepare(bool preserveAccurateTypes) +AttributeMapLookupNode::onPrepare(bool preserveAccurateTypes) { auto keyHandler = makeKeyHandler(); const IAttributeVector * attribute = _scratchResult->getAttribute(); @@ -380,7 +380,7 @@ AttributeKeyedNode::onPrepare(bool preserveAccurateTypes) } void -AttributeKeyedNode::cleanup() +AttributeMapLookupNode::cleanup() { _keyAttribute = nullptr; _keySourceAttribute = nullptr; @@ -388,7 +388,7 @@ AttributeKeyedNode::cleanup() } void -AttributeKeyedNode::wireAttributes(const search::attribute::IAttributeContext &attrCtx) +AttributeMapLookupNode::wireAttributes(const search::attribute::IAttributeContext &attrCtx) { auto valueAttribute = findAttribute(attrCtx, _useEnumOptimization, _valueAttributeName); _hasMultiValue = false; @@ -400,7 +400,7 @@ AttributeKeyedNode::wireAttributes(const search::attribute::IAttributeContext &a } void -AttributeKeyedNode::visitMembers(vespalib::ObjectVisitor &visitor) const +AttributeMapLookupNode::visitMembers(vespalib::ObjectVisitor &visitor) const { AttributeNode::visitMembers(visitor); visit(visitor, "keyAttributeName", _keyAttributeName); diff --git a/searchlib/src/vespa/searchlib/expression/attribute_keyed_node.h b/searchlib/src/vespa/searchlib/expression/attribute_map_lookup_node.h index e2cf8943aae..36b1a718f84 100644 --- a/searchlib/src/vespa/searchlib/expression/attribute_keyed_node.h +++ b/searchlib/src/vespa/searchlib/expression/attribute_map_lookup_node.h @@ -9,7 +9,7 @@ namespace search::expression { * Extract map value from attribute for the map key specified in the * grouping expression. */ -class AttributeKeyedNode : public AttributeNode +class AttributeMapLookupNode : public AttributeNode { public: using IAttributeVector = search::attribute::IAttributeVector; @@ -31,13 +31,13 @@ private: void wireAttributes(const search::attribute::IAttributeContext & attrCtx) override; void onPrepare(bool preserveAccurateTypes) override; public: - AttributeKeyedNode(); - AttributeKeyedNode(vespalib::stringref name); - AttributeKeyedNode(const AttributeKeyedNode &); - AttributeKeyedNode(AttributeKeyedNode &&) = delete; - ~AttributeKeyedNode() override; - AttributeKeyedNode &operator=(const AttributeKeyedNode &rhs); - AttributeKeyedNode &operator=(AttributeKeyedNode &&rhs) = delete; + AttributeMapLookupNode(); + AttributeMapLookupNode(vespalib::stringref name); + AttributeMapLookupNode(const AttributeMapLookupNode &); + AttributeMapLookupNode(AttributeMapLookupNode &&) = delete; + ~AttributeMapLookupNode() override; + AttributeMapLookupNode &operator=(const AttributeMapLookupNode &rhs); + AttributeMapLookupNode &operator=(AttributeMapLookupNode &&rhs) = delete; void visitMembers(vespalib::ObjectVisitor &visitor) const override; bool isKeyed() const override { return true; } }; |