diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-01-31 14:35:59 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-01-31 14:35:59 +0100 |
commit | ce1759d257ec4aa6a0a5802034a471ecc2d30477 (patch) | |
tree | b9deb4d174278b4f2de2db577dbb93f348f4a67b | |
parent | b2aafe67dfae75164b8c422ab52cb93c77ef18ee (diff) |
Optimize includes.
45 files changed, 235 insertions, 232 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp index 2bcd8dfd6d0..15641e7d36d 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp @@ -13,8 +13,9 @@ #include <vespa/searchlib/engine/searchreply.h> #include <vespa/searchlib/features/setup.h> #include <vespa/searchlib/fef/test/plugin/setup.h> -#include <vespa/log/log.h> +#include <cmath> +#include <vespa/log/log.h> LOG_SETUP(".proton.matching.matcher"); using search::fef::Properties; diff --git a/searchcore/src/vespa/searchcore/proton/matching/sessionmanager.cpp b/searchcore/src/vespa/searchcore/proton/matching/sessionmanager.cpp index a676b89c65d..db4d12de677 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/sessionmanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/sessionmanager.cpp @@ -1,7 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + #include "sessionmanager.h" #include <vespa/vespalib/stllike/lrucache_map.hpp> #include <vespa/vespalib/stllike/hash_map.hpp> +#include <vespa/vespalib/util/sync.h> #include <vespa/log/log.h> LOG_SETUP(".sessionmanager"); diff --git a/searchlib/src/tests/aggregator/attr_test.cpp b/searchlib/src/tests/aggregator/attr_test.cpp index 5184f61b573..49ec52274f9 100644 --- a/searchlib/src/tests/aggregator/attr_test.cpp +++ b/searchlib/src/tests/aggregator/attr_test.cpp @@ -5,6 +5,8 @@ #include <vespa/searchlib/aggregation/aggregation.h> #include <vespa/searchlib/attribute/extendableattributes.h> #include <vespa/vespalib/objects/objectdumper.h> +#include <vespa/searchlib/expression/arrayatlookupfunctionnode.h> +#include <vespa/searchlib/expression/interpolatedlookupfunctionnode.h> using namespace search; using namespace search::expression; diff --git a/searchlib/src/tests/aggregator/perdocexpr.cpp b/searchlib/src/tests/aggregator/perdocexpr.cpp index 3679c4abe5f..c4c08e4de8f 100644 --- a/searchlib/src/tests/aggregator/perdocexpr.cpp +++ b/searchlib/src/tests/aggregator/perdocexpr.cpp @@ -1,5 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include <vespa/searchlib/aggregation/aggregation.h> #include <vespa/searchlib/aggregation/expressioncountaggregationresult.h> #include <vespa/searchlib/aggregation/perdocexpression.h> @@ -11,6 +10,7 @@ #include <vespa/vespalib/util/md5.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/searchlib/expression/getdocidnamespacespecificfunctionnode.h> +#include <vespa/searchlib/expression/documentfieldnode.h> #include <cmath> #include <iostream> diff --git a/searchlib/src/tests/grouping/grouping_serialization_test.cpp b/searchlib/src/tests/grouping/grouping_serialization_test.cpp index 1db13dca83d..a7a197d44d5 100644 --- a/searchlib/src/tests/grouping/grouping_serialization_test.cpp +++ b/searchlib/src/tests/grouping/grouping_serialization_test.cpp @@ -1,26 +1,13 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. // Unit tests for grouping_serialization. -#include <vespa/fastos/fastos.h> - #include <vespa/searchlib/aggregation/aggregation.h> #include <vespa/searchlib/aggregation/expressioncountaggregationresult.h> -#include <vespa/searchlib/aggregation/fs4hit.h> -#include <vespa/searchlib/aggregation/groupinglevel.h> -#include <vespa/searchlib/aggregation/hitsaggregationresult.h> #include <vespa/searchlib/aggregation/perdocexpression.h> -#include <vespa/searchlib/aggregation/vdshit.h> -#include <vespa/searchlib/common/hitrank.h> -#include <vespa/searchlib/common/identifiable.h> -#include <vespa/searchlib/expression/fixedwidthbucketfunctionnode.h> -#include <vespa/searchlib/expression/floatbucketresultnode.h> #include <vespa/searchlib/expression/getdocidnamespacespecificfunctionnode.h> #include <vespa/searchlib/expression/getymumchecksumfunctionnode.h> -#include <vespa/searchlib/expression/integerbucketresultnode.h> -#include <vespa/vespalib/objects/nboserializer.h> -#include <vespa/vespalib/objects/nbostream.h> +#include <vespa/searchlib/expression/documentfieldnode.h> #include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/vespalib/util/stringfmt.h> #include <fstream> #include <vespa/log/log.h> LOG_SETUP("grouping_serialization_test"); diff --git a/searchlib/src/vespa/searchlib/aggregation/aggregation.cpp b/searchlib/src/vespa/searchlib/aggregation/aggregation.cpp index 01a9f9920cc..5db2611f0d7 100644 --- a/searchlib/src/vespa/searchlib/aggregation/aggregation.cpp +++ b/searchlib/src/vespa/searchlib/aggregation/aggregation.cpp @@ -1,8 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> +#include "aggregation.h" #include "expressioncountaggregationresult.h" -#include <vespa/searchlib/aggregation/aggregation.h> -#include <stdexcept> +#include <vespa/searchlib/expression/resultvector.h> +#include <vespa/document/fieldvalue/document.h> #include <vespa/vespalib/objects/visit.hpp> #include <vespa/vespalib/xxhash/xxhash.h> @@ -35,8 +35,33 @@ IMPLEMENT_AGGREGATIONRESULT(MaxAggregationResult, AggregationResult); IMPLEMENT_AGGREGATIONRESULT(MinAggregationResult, AggregationResult); IMPLEMENT_AGGREGATIONRESULT(AverageAggregationResult, AggregationResult); IMPLEMENT_AGGREGATIONRESULT(XorAggregationResult, AggregationResult); -IMPLEMENT_AGGREGATIONRESULT(ExpressionCountAggregationResult, - AggregationResult); +IMPLEMENT_AGGREGATIONRESULT(ExpressionCountAggregationResult, AggregationResult); + +AggregationResult::AggregationResult() : + _expressionTree(new ExpressionTree()), + _tag(-1) +{ } + +AggregationResult::~AggregationResult() { } + +void +AggregationResult::aggregate(const document::Document & doc, HitRank rank) { + bool ok(_expressionTree->execute(doc, rank)); + if (ok) { + onAggregate(_expressionTree->getResult(), doc, rank); + } else { + throw std::runtime_error(vespalib::make_string("aggregate(%s, %f) failed ", doc.getId().toString().c_str(), rank)); + } +} +void +AggregationResult::aggregate(DocId docId, HitRank rank) { + bool ok(_expressionTree->execute(docId, rank)); + if (ok) { + onAggregate(_expressionTree->getResult(), docId, rank); + } else { + throw std::runtime_error(vespalib::make_string("aggregate(%u, %f) failed ", docId, rank)); + } +} bool AggregationResult::Configure::check(const vespalib::Identifiable &obj) const { diff --git a/searchlib/src/vespa/searchlib/aggregation/aggregationresult.h b/searchlib/src/vespa/searchlib/aggregation/aggregationresult.h index 69e0fbd2145..f78d5cfbea1 100644 --- a/searchlib/src/vespa/searchlib/aggregation/aggregationresult.h +++ b/searchlib/src/vespa/searchlib/aggregation/aggregationresult.h @@ -2,22 +2,12 @@ #pragma once #include <vespa/searchlib/expression/expressiontree.h> -#include <vespa/searchlib/expression/numericresultnode.h> -#include <vespa/searchlib/expression/integerresultnode.h> -#include <stdexcept> +#include <vespa/searchlib/expression/resultnode.h> namespace search { namespace aggregation { -using search::expression::ExpressionTree; -using search::expression::ExpressionNode; -using search::expression::ResultNode; using search::expression::DocId; -using search::expression::NumericResultNode; -using search::expression::SingleResultNode; -using search::expression::IntegerResultNode; -using search::expression::Int64ResultNode; -using search::expression::ConfigureStaticParams; #define DECLARE_ABSTRACT_AGGREGATIONRESULT(cclass) \ DECLARE_IDENTIFIABLE_ABSTRACT_NS2(search, aggregation, cclass); \ @@ -40,8 +30,10 @@ using search::expression::ConfigureStaticParams; class AggregationResult : public expression::ExpressionNode { public: + using ResultNode = expression::ResultNode; DECLARE_NBO_SERIALIZE; DECLARE_ABSTRACT_AGGREGATIONRESULT(AggregationResult); + ~AggregationResult(); class Configure : public vespalib::ObjectOperation, public vespalib::ObjectPredicate { private: @@ -55,22 +47,8 @@ public: void reset() { onReset(); } void merge(const AggregationResult & b) { onMerge(b); } virtual void postMerge() {} - void aggregate(const document::Document & doc, HitRank rank) { - bool ok(_expressionTree->execute(doc, rank)); - if (ok) { - onAggregate(_expressionTree->getResult(), doc, rank); - } else { - throw std::runtime_error(vespalib::make_string("aggregate(%s, %f) failed ", doc.getId().toString().c_str(), rank)); - } - } - void aggregate(DocId docId, HitRank rank) { - bool ok(_expressionTree->execute(docId, rank)); - if (ok) { - onAggregate(_expressionTree->getResult(), docId, rank); - } else { - throw std::runtime_error(vespalib::make_string("aggregate(%u, %f) failed ", docId, rank)); - } - } + void aggregate(const document::Document & doc, HitRank rank); + void aggregate(DocId docId, HitRank rank); AggregationResult &setExpression(const ExpressionNode::CP &expr); AggregationResult &setResult(const ResultNode::CP &result) { prepare(result.get(), true); @@ -84,7 +62,7 @@ public: const ExpressionNode * getExpression() const { return _expressionTree->getRoot().get(); } ExpressionNode * getExpression() { return _expressionTree->getRoot().get(); } protected: - AggregationResult() : _expressionTree(new ExpressionTree()), _tag(-1) { } + AggregationResult(); private: /// from expressionnode virtual void onPrepare(bool preserveAccurateTypes) { (void) preserveAccurateTypes; } @@ -108,7 +86,7 @@ private: (void) rank; onAggregate(result); } - search::expression::ExpressionTree::LP _expressionTree; + vespalib::LinkedPtr<expression::ExpressionTree> _expressionTree; uint32_t _tag; }; diff --git a/searchlib/src/vespa/searchlib/aggregation/averageaggregationresult.h b/searchlib/src/vespa/searchlib/aggregation/averageaggregationresult.h index 928594acf0a..be81512961e 100644 --- a/searchlib/src/vespa/searchlib/aggregation/averageaggregationresult.h +++ b/searchlib/src/vespa/searchlib/aggregation/averageaggregationresult.h @@ -1,7 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/searchlib/aggregation/aggregationresult.h> +#include "aggregationresult.h" +#include <vespa/searchlib/expression/numericresultnode.h> + namespace search { namespace aggregation { @@ -9,6 +11,7 @@ namespace aggregation { class AverageAggregationResult : public AggregationResult { public: + using NumericResultNode = expression::NumericResultNode; DECLARE_AGGREGATIONRESULT(AverageAggregationResult); AverageAggregationResult() : _sum(), _count(0) {} virtual void visitMembers(vespalib::ObjectVisitor &visitor) const; diff --git a/searchlib/src/vespa/searchlib/aggregation/countaggregationresult.h b/searchlib/src/vespa/searchlib/aggregation/countaggregationresult.h index a00e14f1e78..06321c99b84 100644 --- a/searchlib/src/vespa/searchlib/aggregation/countaggregationresult.h +++ b/searchlib/src/vespa/searchlib/aggregation/countaggregationresult.h @@ -1,7 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/searchlib/aggregation/aggregationresult.h> +#include "aggregationresult.h" +#include <vespa/searchlib/expression/integerresultnode.h> + namespace search { namespace aggregation { @@ -20,7 +22,7 @@ public: private: virtual const ResultNode & onGetRank() const { return _count; } virtual void onPrepare(const ResultNode & result, bool useForInit); - Int64ResultNode _count; + expression::Int64ResultNode _count; }; } diff --git a/searchlib/src/vespa/searchlib/aggregation/expressioncountaggregationresult.h b/searchlib/src/vespa/searchlib/aggregation/expressioncountaggregationresult.h index 182a28f2ec6..fb4ee2b2a6a 100644 --- a/searchlib/src/vespa/searchlib/aggregation/expressioncountaggregationresult.h +++ b/searchlib/src/vespa/searchlib/aggregation/expressioncountaggregationresult.h @@ -4,6 +4,7 @@ #include "aggregationresult.h" #include <vespa/searchlib/grouping/hyperloglog.h> +#include <vespa/searchlib/expression/integerresultnode.h> namespace search { namespace aggregation { @@ -18,10 +19,10 @@ class ExpressionCountAggregationResult : public AggregationResult { static const int PRECISION = 10; HyperLogLog<PRECISION> _hll; - Int64ResultNode _rank; + expression::Int64ResultNode _rank; virtual const ResultNode & onGetRank() const { return _rank; } - virtual void onPrepare(const ResultNode &, bool) {} + virtual void onPrepare(const ResultNode &, bool) { } public: DECLARE_AGGREGATIONRESULT(ExpressionCountAggregationResult); ExpressionCountAggregationResult() : AggregationResult(), _hll() { } diff --git a/searchlib/src/vespa/searchlib/aggregation/group.cpp b/searchlib/src/vespa/searchlib/aggregation/group.cpp index 936236e61c3..a90b2e84762 100644 --- a/searchlib/src/vespa/searchlib/aggregation/group.cpp +++ b/searchlib/src/vespa/searchlib/aggregation/group.cpp @@ -1,18 +1,21 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + #include "group.h" #include "maxaggregationresult.h" #include "groupinglevel.h" #include "grouping.h" + #include <vespa/vespalib/objects/objectdumper.h> -#include <vespa/vespalib/util/vstringfmt.h> +#include <vespa/vespalib/objects/visit.hpp> #include <vespa/vespalib/stllike/hash_set.hpp> +#include <cmath> namespace search { namespace aggregation { -using search::expression::FloatResultNode; using search::expression::AggregationRefNode; +using search::expression::ExpressionTree; using vespalib::FieldBase; using vespalib::Serializer; using vespalib::Deserializer; @@ -31,8 +34,7 @@ struct SortByGroupRank { } }; -} // namespace search::aggregation::<unnamed> - +} IMPLEMENT_IDENTIFIABLE_NS2(search, aggregation, Group, vespalib::Identifiable); @@ -526,28 +528,28 @@ Group::visitMembers(vespalib::ObjectVisitor &visitor) const visitor.openStruct("orderBy", "[]"); visit(visitor, "size", getOrderBySize()); for (size_t i(0), m(getOrderBySize()); i < m; i++) { - visit(visitor, vespalib::make_vespa_string("[%lu]", i), getOrderBy(i)); + visit(visitor, vespalib::make_string("[%lu]", i), getOrderBy(i)); } visitor.closeStruct(); // visit(visitor, "aggregationResults", _aggregationResults); visitor.openStruct("aggregationresults", "[]"); visit(visitor, "size", getAggrSize()); for (size_t i(0), m(getAggrSize()); i < m; i++) { - visit(visitor, vespalib::make_vespa_string("[%lu]", i), getAggrCP(i)); + visit(visitor, vespalib::make_string("[%lu]", i), getAggrCP(i)); } visitor.closeStruct(); // visit(visitor, "expressionResults", _expressionResults); visitor.openStruct("expressionResults", "[]"); visit(visitor, "size", getExprSize()); for (size_t i(0), m(getExprSize()); i < m; i++) { - visit(visitor, vespalib::make_vespa_string("[%lu]", i), getExprCP(i)); + visit(visitor, vespalib::make_string("[%lu]", i), getExprCP(i)); } visitor.closeStruct(); //visit(visitor, "children", _children); visitor.openStruct("children", "[]"); visit(visitor, "size", getChildrenSize()); for (size_t i(0), m(getChildrenSize()); i < m; i++) { - visit(visitor, vespalib::make_vespa_string("[%lu]", i), getChild(i)); + visit(visitor, vespalib::make_string("[%lu]", i), getChild(i)); } visitor.closeStruct(); visit(visitor, "tag", _tag); diff --git a/searchlib/src/vespa/searchlib/aggregation/group.h b/searchlib/src/vespa/searchlib/aggregation/group.h index 1559f53cd9b..c7fe98fb487 100644 --- a/searchlib/src/vespa/searchlib/aggregation/group.h +++ b/searchlib/src/vespa/searchlib/aggregation/group.h @@ -1,10 +1,12 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/searchlib/aggregation/aggregationresult.h> +#include "rawrank.h" +#include "aggregationresult.h" +#include <vespa/searchlib/common/hitrank.h> #include <vespa/vespalib/stllike/hash_set.h> +#include <vespa/fastos/dynamiclibrary.h> #include <vector> -#include "rawrank.h" namespace search { namespace aggregation { @@ -33,8 +35,10 @@ class Grouping; class Group : public vespalib::Identifiable { public: + using ResultNode = expression::ResultNode; + using ExpressionNode = expression::ExpressionNode; + using UP = std::unique_ptr<Group>; typedef Group * ChildP; - typedef std::unique_ptr<Group> UP; typedef ChildP * GroupList; struct GroupEqual : public std::binary_function<ChildP, ChildP, bool> { GroupEqual(const GroupList * v) : _v(v) { } diff --git a/searchlib/src/vespa/searchlib/aggregation/grouping.cpp b/searchlib/src/vespa/searchlib/aggregation/grouping.cpp index 70fae8fea5d..4c59cad9215 100644 --- a/searchlib/src/vespa/searchlib/aggregation/grouping.cpp +++ b/searchlib/src/vespa/searchlib/aggregation/grouping.cpp @@ -1,14 +1,18 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/searchlib/aggregation/grouping.h> -#include <vespa/searchlib/aggregation/hitsaggregationresult.h> -#include <stdexcept> -#include <vespa/vespalib/objects/visit.h> -#include <vespa/vespalib/objects/objectpredicate.h> -#include <vespa/vespalib/objects/objectoperation.h> + +#include "grouping.h" +#include "hitsaggregationresult.h" +#include <vespa/searchlib/expression/stringresultnode.h> +#include <vespa/searchlib/expression/enumresultnode.h> +#include <vespa/searchlib/expression/resultvector.h> +#include <vespa/searchlib/expression/attributenode.h> +#include <vespa/searchlib/expression/documentaccessornode.h> #include <vespa/searchlib/attribute/stringbase.h> #include <vespa/vespalib/objects/serializer.hpp> #include <vespa/vespalib/objects/deserializer.hpp> +#include <vespa/searchlib/common/idocumentmetastore.h> +#include <vespa/searchlib/common/bitvector.h> + #include <vespa/log/log.h> LOG_SETUP(".searchlib.aggregation.grouping"); diff --git a/searchlib/src/vespa/searchlib/aggregation/grouping.h b/searchlib/src/vespa/searchlib/aggregation/grouping.h index b9024c384bf..279d475a7d2 100644 --- a/searchlib/src/vespa/searchlib/aggregation/grouping.h +++ b/searchlib/src/vespa/searchlib/aggregation/grouping.h @@ -2,12 +2,14 @@ #pragma once #include "groupinglevel.h" -#include <vespa/searchlib/common/bitvector.h> -#include <vespa/searchlib/common/idocumentmetastore.h> #include <vespa/searchlib/common/rankedhit.h> #include <vespa/vespalib/util/clock.h> namespace search { + +class BitVector; +class IDocumentMetaStore; + namespace aggregation { /** @@ -81,11 +83,11 @@ public: void aggregate(const RankedHit * rankedHit, unsigned int len, const BitVector * bVec); void aggregate(DocId docId, HitRank rank = 0); void aggregate(const document::Document & doc, HitRank rank = 0); - void convertToGlobalId(const search::IDocumentMetaStore &metaStore); + void convertToGlobalId(const IDocumentMetaStore &metaStore); void postAggregate(); void sortById(); void cleanTemporary(); - void configureStaticStuff(const ConfigureStaticParams & params); + void configureStaticStuff(const expression::ConfigureStaticParams & params); void cleanupAttributeReferences(); }; diff --git a/searchlib/src/vespa/searchlib/aggregation/groupinglevel.cpp b/searchlib/src/vespa/searchlib/aggregation/groupinglevel.cpp index bb801633b26..1811261ec9b 100644 --- a/searchlib/src/vespa/searchlib/aggregation/groupinglevel.cpp +++ b/searchlib/src/vespa/searchlib/aggregation/groupinglevel.cpp @@ -1,8 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/searchlib/aggregation/groupinglevel.h> -#include <vespa/searchlib/aggregation/grouping.h> -#include <vespa/vespalib/objects/visit.h> + +#include "groupinglevel.h" +#include "grouping.h" +#include <vespa/searchlib/expression/resultvector.h> namespace search { namespace aggregation { diff --git a/searchlib/src/vespa/searchlib/aggregation/groupinglevel.h b/searchlib/src/vespa/searchlib/aggregation/groupinglevel.h index c4ce462b0ce..e14be23b889 100644 --- a/searchlib/src/vespa/searchlib/aggregation/groupinglevel.h +++ b/searchlib/src/vespa/searchlib/aggregation/groupinglevel.h @@ -18,6 +18,9 @@ class Grouping; class GroupingLevel : public vespalib::Identifiable { private: + using ResultNode = expression::ResultNode; + using ExpressionNode = expression::ExpressionNode; + using ExpressionTree = expression::ExpressionTree; class Grouper { public: virtual ~Grouper() { } @@ -65,12 +68,12 @@ private: } virtual MultiValueGrouper * clone() const { return new MultiValueGrouper(*this); } }; - int64_t _maxGroups; - int64_t _precision; - bool _isOrdered; - bool _frozen; - search::expression::ExpressionTree _classify; - Group _collect; + int64_t _maxGroups; + int64_t _precision; + bool _isOrdered; + bool _frozen; + ExpressionTree _classify; + Group _collect; vespalib::CloneablePtr<Grouper> _grouper; public: diff --git a/searchlib/src/vespa/searchlib/aggregation/hitlist.cpp b/searchlib/src/vespa/searchlib/aggregation/hitlist.cpp index addc3e3a315..190c28f8a76 100644 --- a/searchlib/src/vespa/searchlib/aggregation/hitlist.cpp +++ b/searchlib/src/vespa/searchlib/aggregation/hitlist.cpp @@ -1,15 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include "hitsaggregationresult.h" -#include <vespa/vespalib/objects/visit.h> -#include "fs4hit.h" -#include "vdshit.h" -#include <algorithm> -#include <vespa/vespalib/objects/objectpredicate.h> -#include <vespa/vespalib/objects/objectoperation.h> -#include <vespa/vespalib/objects/identifiable.hpp> - +#include "hitlist.h" +#include <vespa/vespalib/objects/visit.hpp> namespace search { namespace aggregation { diff --git a/searchlib/src/vespa/searchlib/aggregation/hitlist.h b/searchlib/src/vespa/searchlib/aggregation/hitlist.h index a63e923d05e..34c5bcaba46 100644 --- a/searchlib/src/vespa/searchlib/aggregation/hitlist.h +++ b/searchlib/src/vespa/searchlib/aggregation/hitlist.h @@ -9,10 +9,11 @@ namespace search { namespace aggregation { -class HitList : public ResultNode +class HitList : public expression::ResultNode { public: private: + using ResultNode = expression::ResultNode; typedef std::vector<FS4Hit> Fs4V; typedef std::vector<VdsHit> VdsV; std::vector<FS4Hit> _fs4hits; diff --git a/searchlib/src/vespa/searchlib/aggregation/hitsaggregationresult.cpp b/searchlib/src/vespa/searchlib/aggregation/hitsaggregationresult.cpp index bdc705a9a7c..e0ea82560f7 100644 --- a/searchlib/src/vespa/searchlib/aggregation/hitsaggregationresult.cpp +++ b/searchlib/src/vespa/searchlib/aggregation/hitsaggregationresult.cpp @@ -1,12 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> + #include "hitsaggregationresult.h" -#include <vespa/vespalib/objects/visit.h> -#include "fs4hit.h" -#include "vdshit.h" -#include <vespa/vespalib/objects/objectpredicate.h> -#include <vespa/vespalib/objects/objectoperation.h> +#include <vespa/document/fieldvalue/document.h> + +#include <vespa/log/log.h> LOG_SETUP(".searchlib.aggregation.hitsaggregationresult"); namespace search { @@ -104,7 +101,8 @@ HitsAggregationResult::selectMembers(const vespalib::ObjectPredicate & predicate _hits.selectMembers(predicate, operation); } -const ResultNode & HitsAggregationResult::onGetRank() const +const expression::ResultNode & +HitsAggregationResult::onGetRank() const { if ( ! _hits.empty() ) { _bestHitRank = _hits.front().getRank(); diff --git a/searchlib/src/vespa/searchlib/aggregation/hitsaggregationresult.h b/searchlib/src/vespa/searchlib/aggregation/hitsaggregationresult.h index 5b533360d01..06ea5dc0389 100644 --- a/searchlib/src/vespa/searchlib/aggregation/hitsaggregationresult.h +++ b/searchlib/src/vespa/searchlib/aggregation/hitsaggregationresult.h @@ -3,16 +3,16 @@ #include "aggregationresult.h" #include "hitlist.h" +#include <vespa/searchlib/expression/floatresultnode.h> namespace search { namespace aggregation { -using search::expression::FloatResultNode; - class HitsAggregationResult : public AggregationResult { public: - typedef vespalib::string SummaryClassType; + using FloatResultNode = expression::FloatResultNode; + using SummaryClassType = vespalib::string; class SummaryGenerator { diff --git a/searchlib/src/vespa/searchlib/aggregation/maxaggregationresult.h b/searchlib/src/vespa/searchlib/aggregation/maxaggregationresult.h index 4f63b9decec..bc18293ab1a 100644 --- a/searchlib/src/vespa/searchlib/aggregation/maxaggregationresult.h +++ b/searchlib/src/vespa/searchlib/aggregation/maxaggregationresult.h @@ -1,7 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/searchlib/aggregation/aggregationresult.h> +#include "aggregationresult.h" +#include <vespa/searchlib/expression/singleresultnode.h> namespace search { namespace aggregation { @@ -9,6 +10,7 @@ namespace aggregation { class MaxAggregationResult : public AggregationResult { public: + using SingleResultNode = expression::SingleResultNode; DECLARE_AGGREGATIONRESULT(MaxAggregationResult); MaxAggregationResult() : AggregationResult(), _max() { } MaxAggregationResult(const SingleResultNode & max) : AggregationResult(), _max(max) { } diff --git a/searchlib/src/vespa/searchlib/aggregation/minaggregationresult.h b/searchlib/src/vespa/searchlib/aggregation/minaggregationresult.h index db909cce3f7..c3c2a688cc4 100644 --- a/searchlib/src/vespa/searchlib/aggregation/minaggregationresult.h +++ b/searchlib/src/vespa/searchlib/aggregation/minaggregationresult.h @@ -1,7 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/searchlib/aggregation/aggregationresult.h> +#include "aggregationresult.h" +#include <vespa/searchlib/expression/singleresultnode.h> namespace search { namespace aggregation { @@ -9,6 +10,7 @@ namespace aggregation { class MinAggregationResult : public AggregationResult { public: + using SingleResultNode = expression::SingleResultNode; DECLARE_AGGREGATIONRESULT(MinAggregationResult); virtual void visitMembers(vespalib::ObjectVisitor &visitor) const; const SingleResultNode & getMin() const { return *_min; } diff --git a/searchlib/src/vespa/searchlib/aggregation/modifiers.cpp b/searchlib/src/vespa/searchlib/aggregation/modifiers.cpp index 9ce8da41ef3..7e80dff295d 100644 --- a/searchlib/src/vespa/searchlib/aggregation/modifiers.cpp +++ b/searchlib/src/vespa/searchlib/aggregation/modifiers.cpp @@ -1,8 +1,10 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/searchlib/aggregation/modifiers.h> -#include <vespa/searchlib/aggregation/grouping.h> + +#include "modifiers.h" +#include "grouping.h" #include <vespa/searchlib/expression/multiargfunctionnode.h> +#include <vespa/searchlib/expression/attributenode.h> +#include <vespa/searchlib/expression/documentfieldnode.h> using namespace search::expression; diff --git a/searchlib/src/vespa/searchlib/aggregation/sumaggregationresult.h b/searchlib/src/vespa/searchlib/aggregation/sumaggregationresult.h index 51a6091b794..a976cc1e355 100644 --- a/searchlib/src/vespa/searchlib/aggregation/sumaggregationresult.h +++ b/searchlib/src/vespa/searchlib/aggregation/sumaggregationresult.h @@ -1,7 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/searchlib/aggregation/aggregationresult.h> +#include "aggregationresult.h" +#include <vespa/searchlib/expression/singleresultnode.h> + namespace search { namespace aggregation { @@ -9,6 +11,7 @@ namespace aggregation { class SumAggregationResult : public AggregationResult { public: + using SingleResultNode = expression::SingleResultNode; DECLARE_AGGREGATIONRESULT(SumAggregationResult); SumAggregationResult() : AggregationResult(), _sum() { } SumAggregationResult(const SingleResultNode & sum) : AggregationResult(), _sum(sum) { } diff --git a/searchlib/src/vespa/searchlib/aggregation/vdshit.cpp b/searchlib/src/vespa/searchlib/aggregation/vdshit.cpp index 916e933f731..4f981de7edd 100644 --- a/searchlib/src/vespa/searchlib/aggregation/vdshit.cpp +++ b/searchlib/src/vespa/searchlib/aggregation/vdshit.cpp @@ -1,7 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> + #include "vdshit.h" -#include <vespa/vespalib/objects/visit.h> +#include <vespa/vespalib/objects/visit.hpp> #include <vespa/vespalib/objects/serializer.hpp> #include <vespa/vespalib/objects/deserializer.hpp> @@ -15,7 +15,6 @@ using vespalib::Deserializer; static FieldBase _G_docIdField("docId"); static FieldBase _G_summaryField("summary"); - IMPLEMENT_IDENTIFIABLE_NS2(search, aggregation, VdsHit, Hit); Serializer & diff --git a/searchlib/src/vespa/searchlib/aggregation/xoraggregationresult.h b/searchlib/src/vespa/searchlib/aggregation/xoraggregationresult.h index 9afc196ac33..9c8b0e9c2c7 100644 --- a/searchlib/src/vespa/searchlib/aggregation/xoraggregationresult.h +++ b/searchlib/src/vespa/searchlib/aggregation/xoraggregationresult.h @@ -1,7 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/searchlib/aggregation/aggregationresult.h> +#include "aggregationresult.h" +#include <vespa/searchlib/expression/integerresultnode.h> + namespace search { namespace aggregation { @@ -9,6 +11,7 @@ namespace aggregation { class XorAggregationResult : public AggregationResult { public: + using Int64ResultNode = expression::Int64ResultNode; DECLARE_AGGREGATIONRESULT(XorAggregationResult); virtual void visitMembers(vespalib::ObjectVisitor &visitor) const; const Int64ResultNode & getXor() const { return _xor; } diff --git a/searchlib/src/vespa/searchlib/attribute/attributeiterators.h b/searchlib/src/vespa/searchlib/attribute/attributeiterators.h index 4f8907473b2..33fd955c7e1 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributeiterators.h +++ b/searchlib/src/vespa/searchlib/attribute/attributeiterators.h @@ -2,15 +2,14 @@ #pragma once -#include <vespa/searchlib/common/bitvector.h> +#include "dociditerator.h" +#include "attributevector.h" #include <vespa/searchlib/fef/termfieldmatchdata.h> #include <vespa/searchlib/fef/termfieldmatchdataposition.h> #include <vespa/searchlib/queryeval/searchiterator.h> -#include "attributevector.h" #include <vespa/searchlib/btree/btreenode.h> #include <vespa/searchlib/btree/btreeiterator.h> #include <vespa/vespalib/objects/visit.h> -#include "dociditerator.h" namespace search { @@ -476,51 +475,5 @@ public: { } }; -template <typename SC> -void -FlagAttributeIteratorStrict<SC>::doSeek(uint32_t docId) -{ - const SC & sc(_sc); - const typename SC::Attribute &attr = - static_cast<const typename SC::Attribute &>(sc.attribute()); - for (int i = sc._low; (i <= sc._high); ++i) { - const BitVector * bv = attr.getBitVector(i); - if ((bv != NULL) && docId < _docIdLimit && bv->testBit(docId)) { - setDocId(docId); - return; - } - } - - uint32_t minNextBit(search::endDocId); - for (int i = sc._low; (i <= sc._high); ++i) { - const BitVector * bv = attr.getBitVector(i); - if (bv != NULL && docId < _docIdLimit) { - uint32_t nextBit = bv->getNextTrueBit(docId); - minNextBit = std::min(nextBit, minNextBit); - } - } - if (minNextBit < _docIdLimit) { - setDocId(minNextBit); - } else { - setAtEnd(); - } -} - -template <typename SC> -void -FlagAttributeIteratorT<SC>::doSeek(uint32_t docId) -{ - const SC & sc(_sc); - const typename SC::Attribute &attr = - static_cast<const typename SC::Attribute &>(sc.attribute()); - for (int i = sc._low; (i <= sc._high); ++i) { - const BitVector * bv = attr.getBitVector(i); - if ((bv != NULL) && docId < _docIdLimit && bv->testBit(docId)) { - setDocId(docId); - return; - } - } -} - } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/attributeiterators.hpp b/searchlib/src/vespa/searchlib/attribute/attributeiterators.hpp index deebdd22bb9..9faee8ba504 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributeiterators.hpp +++ b/searchlib/src/vespa/searchlib/attribute/attributeiterators.hpp @@ -2,14 +2,14 @@ #pragma once +#include "attributeiterators.h" #include <vespa/searchlib/btree/btreenode.hpp> #include <vespa/searchlib/btree/btreeiterator.hpp> -#include "attributeiterators.h" #include <vespa/searchlib/query/queryterm.h> +#include <vespa/searchlib/common/bitvector.h> namespace search { - template <typename PL> void AttributePostingListIteratorT<PL>::doSeek(uint32_t docId) @@ -22,7 +22,6 @@ AttributePostingListIteratorT<PL>::doSeek(uint32_t docId) } } - template <typename PL> void FilterAttributePostingListIteratorT<PL>::doSeek(uint32_t docId) @@ -35,7 +34,6 @@ FilterAttributePostingListIteratorT<PL>::doSeek(uint32_t docId) } } - template <typename PL> void AttributePostingListIteratorT<PL>::doUnpack(uint32_t docId) @@ -51,7 +49,6 @@ AttributePostingListIteratorT<PL>::doUnpack(uint32_t docId) } } - template <typename PL> void FilterAttributePostingListIteratorT<PL>::doUnpack(uint32_t docId) @@ -90,4 +87,52 @@ FilterAttributeIteratorT<SC>::FilterAttributeIteratorT(const SC &searchContext, _searchContext(searchContext) { } + +template <typename SC> +void +FlagAttributeIteratorStrict<SC>::doSeek(uint32_t docId) +{ + const SC & sc(_sc); + const typename SC::Attribute &attr = + static_cast<const typename SC::Attribute &>(sc.attribute()); + for (int i = sc._low; (i <= sc._high); ++i) { + const BitVector * bv = attr.getBitVector(i); + if ((bv != NULL) && docId < _docIdLimit && bv->testBit(docId)) { + setDocId(docId); + return; + } + } + + uint32_t minNextBit(search::endDocId); + for (int i = sc._low; (i <= sc._high); ++i) { + const BitVector * bv = attr.getBitVector(i); + if (bv != NULL && docId < _docIdLimit) { + uint32_t nextBit = bv->getNextTrueBit(docId); + minNextBit = std::min(nextBit, minNextBit); + } + } + if (minNextBit < _docIdLimit) { + setDocId(minNextBit); + } else { + setAtEnd(); + } +} + +template <typename SC> +void +FlagAttributeIteratorT<SC>::doSeek(uint32_t docId) +{ + const SC & sc(_sc); + const typename SC::Attribute &attr = + static_cast<const typename SC::Attribute &>(sc.attribute()); + for (int i = sc._low; (i <= sc._high); ++i) { + const BitVector * bv = attr.getBitVector(i); + if ((bv != NULL) && docId < _docIdLimit && bv->testBit(docId)) { + setDocId(docId); + return; + } + } +} + + } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.h b/searchlib/src/vespa/searchlib/attribute/attributevector.h index ef984975df0..e942fc39539 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributevector.h +++ b/searchlib/src/vespa/searchlib/attribute/attributevector.h @@ -12,7 +12,6 @@ #include <vespa/searchcommon/attribute/status.h> #include <vespa/searchcommon/common/undefinedvalues.h> #include <vespa/searchlib/common/address_space.h> -#include <vespa/searchlib/common/bitvector.h> #include <vespa/searchlib/common/i_compactable_lid_space.h> #include <vespa/searchlib/common/identifiable.h> #include <vespa/searchlib/common/range.h> @@ -27,6 +26,7 @@ #include <shared_mutex> class Fast_BufferedFile; +class FastOS_FileInterface; namespace document { class ArithmeticValueUpdate; diff --git a/searchlib/src/vespa/searchlib/attribute/dociditerator.h b/searchlib/src/vespa/searchlib/attribute/dociditerator.h index c1d33d5769e..cd16845e1a1 100644 --- a/searchlib/src/vespa/searchlib/attribute/dociditerator.h +++ b/searchlib/src/vespa/searchlib/attribute/dociditerator.h @@ -4,8 +4,7 @@ #include "postinglisttraits.h" -namespace search -{ +namespace search { /** * Inner attribute iterator used for temporary posting lists (range diff --git a/searchlib/src/vespa/searchlib/attribute/enumstorebase.h b/searchlib/src/vespa/searchlib/attribute/enumstorebase.h index d083efe5637..c57bbb5dc98 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumstorebase.h +++ b/searchlib/src/vespa/searchlib/attribute/enumstorebase.h @@ -9,24 +9,16 @@ #include <vespa/vespalib/util/array.h> #include <set> #include <vespa/searchlib/btree/btree.h> -#include <vespa/searchlib/common/bitvector.h> #include <atomic> -namespace vespalib { - class asciistream; -} +namespace vespalib { class asciistream; } namespace search { class BufferWriter; -namespace attribute { - -class Status; - -} +namespace attribute { class Status; } class EnumStoreBase; - class EnumStoreComparator; class EnumStoreComparatorWrapper; diff --git a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.cpp b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.cpp index 2a64a4d2bdc..6108060ed70 100644 --- a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.cpp +++ b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.cpp @@ -1,6 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include "postinglistsearchcontext.h" #include "postinglistsearchcontext.hpp" #include <vespa/searchlib/btree/btreeiterator.hpp> @@ -8,11 +7,9 @@ #include "attributeiterators.hpp" -namespace search -{ +namespace search { -namespace attribute -{ +namespace attribute { using btree::BTreeNode; diff --git a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h index 1d1924dcd66..caf98dc9cad 100644 --- a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h +++ b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h @@ -6,7 +6,6 @@ #include "postinglisttraits.h" #include "postingstore.h" #include "ipostinglistsearchcontext.h" -#include <vespa/searchlib/common/bitvector.h> #include "attributevector.h" #include <vespa/vespalib/util/regexp.h> #include <cstdlib> @@ -110,7 +109,7 @@ protected: * Synthetic posting lists for range search, in array or bitvector form */ PostingVector _array; - BitVector::UP _bitVector; + std::unique_ptr<BitVector> _bitVector; bool _fetchPostingsDone; bool _arrayValid; diff --git a/searchlib/src/vespa/searchlib/attribute/postingstore.h b/searchlib/src/vespa/searchlib/attribute/postingstore.h index 07409d87fca..96ab0488ea4 100644 --- a/searchlib/src/vespa/searchlib/attribute/postingstore.h +++ b/searchlib/src/vespa/searchlib/attribute/postingstore.h @@ -3,16 +3,14 @@ #pragma once #include "postinglisttraits.h" +#include "enumstorebase.h" #include <set> #include <vespa/searchlib/common/bitvector.h> #include <vespa/searchlib/common/growablebitvector.h> -#include "enumstorebase.h" -namespace search -{ +namespace search { -namespace attribute -{ +namespace attribute { class Status; class Config; @@ -27,8 +25,7 @@ public: BitVectorEntry() : _tree(), _bv() - { - } + { } }; diff --git a/searchlib/src/vespa/searchlib/common/hitrank.h b/searchlib/src/vespa/searchlib/common/hitrank.h index 38ef0dc8858..ddc6c21c3c5 100644 --- a/searchlib/src/vespa/searchlib/common/hitrank.h +++ b/searchlib/src/vespa/searchlib/common/hitrank.h @@ -2,8 +2,7 @@ #pragma once -namespace search -{ +namespace search { typedef double HitRank; typedef double SignedHitRank; diff --git a/searchlib/src/vespa/searchlib/common/partialbitvector.cpp b/searchlib/src/vespa/searchlib/common/partialbitvector.cpp index ca836f83df7..2b983b0498d 100644 --- a/searchlib/src/vespa/searchlib/common/partialbitvector.cpp +++ b/searchlib/src/vespa/searchlib/common/partialbitvector.cpp @@ -15,8 +15,8 @@ PartialBitVector::PartialBitVector(Index start, Index end) : } PartialBitVector::PartialBitVector(const BitVector & org, Index start, Index end) : - BitVector(), - _alloc(allocatePaddedAndAligned(start, end)) + BitVector(), + _alloc(allocatePaddedAndAligned(start, end)) { init(_alloc.get(), start, end); memcpy(_alloc.get(), org.getWordIndex(start), numActiveBytes(start, end)); diff --git a/searchlib/src/vespa/searchlib/expression/aggregationrefnode.cpp b/searchlib/src/vespa/searchlib/expression/aggregationrefnode.cpp index 64c071af0f9..32ddec3379d 100644 --- a/searchlib/src/vespa/searchlib/expression/aggregationrefnode.cpp +++ b/searchlib/src/vespa/searchlib/expression/aggregationrefnode.cpp @@ -1,7 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/searchlib/expression/aggregationrefnode.h> -#include <stdexcept> +#include "aggregationrefnode.h" +#include <vespa/vespalib/util/stringfmt.h> namespace search { namespace expression { diff --git a/searchlib/src/vespa/searchlib/expression/aggregationrefnode.h b/searchlib/src/vespa/searchlib/expression/aggregationrefnode.h index 42dc0a940c2..5ee42b7d789 100644 --- a/searchlib/src/vespa/searchlib/expression/aggregationrefnode.h +++ b/searchlib/src/vespa/searchlib/expression/aggregationrefnode.h @@ -1,10 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/searchlib/aggregation/aggregationresult.h> -#include <vespa/searchlib/expression/expressionnode.h> -#include <vespa/searchlib/expression/resultvector.h> -#include <vespa/searchlib/expression/serializer.h> +#include "expressionnode.h" +#include "serializer.h" #include <vespa/vespalib/objects/objectoperation.h> #include <vespa/vespalib/objects/objectpredicate.h> diff --git a/searchlib/src/vespa/searchlib/expression/expressiontree.cpp b/searchlib/src/vespa/searchlib/expression/expressiontree.cpp index 1a01c49ac8c..ad006005b7f 100644 --- a/searchlib/src/vespa/searchlib/expression/expressiontree.cpp +++ b/searchlib/src/vespa/searchlib/expression/expressiontree.cpp @@ -1,6 +1,11 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/searchlib/expression/expressiontree.h> + +#include "expressiontree.h" +#include "documentaccessornode.h" +#include "relevancenode.h" +#include "interpolatedlookupfunctionnode.h" +#include "arrayatlookupfunctionnode.h" +#include "attributenode.h" namespace search { namespace expression { diff --git a/searchlib/src/vespa/searchlib/expression/expressiontree.h b/searchlib/src/vespa/searchlib/expression/expressiontree.h index 06209c3844e..f768ae64eff 100644 --- a/searchlib/src/vespa/searchlib/expression/expressiontree.h +++ b/searchlib/src/vespa/searchlib/expression/expressiontree.h @@ -5,22 +5,28 @@ #include <vespa/vespalib/objects/objectpredicate.h> #include <vespa/searchlib/common/hitrank.h> #include <vespa/searchlib/expression/expressionnode.h> -#include <vespa/searchlib/expression/attributenode.h> -#include <vespa/searchlib/expression/interpolatedlookupfunctionnode.h> -#include <vespa/searchlib/expression/arrayatlookupfunctionnode.h> -#include <vespa/searchlib/expression/relevancenode.h> -#include <vespa/searchlib/expression/documentfieldnode.h> -#include <vespa/searchcommon/attribute/iattributecontext.h> -#include <vespa/document/fieldvalue/document.h> +namespace document { + class DocumentType; + class Document; +} namespace search { + +namespace attribute { class IAttributeContext; } + namespace expression { +class AttributeNode; +class DocumentAccessorNode; +class RelevanceNode; +class InterpolatedLookup; +class ArrayAtLookup; + struct ConfigureStaticParams { - ConfigureStaticParams (const search::attribute::IAttributeContext * attrCtx, + ConfigureStaticParams (const attribute::IAttributeContext * attrCtx, const document::DocumentType * docType) : _attrCtx(attrCtx), _docType(docType) { } - const search::attribute::IAttributeContext * _attrCtx; + const attribute::IAttributeContext * _attrCtx; const document::DocumentType * _docType; }; diff --git a/searchlib/src/vespa/searchlib/expression/interpolatedlookupfunctionnode.h b/searchlib/src/vespa/searchlib/expression/interpolatedlookupfunctionnode.h index 73d84b27dca..c5e62937490 100644 --- a/searchlib/src/vespa/searchlib/expression/interpolatedlookupfunctionnode.h +++ b/searchlib/src/vespa/searchlib/expression/interpolatedlookupfunctionnode.h @@ -1,7 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/searchlib/expression/unaryfunctionnode.h> +#include "unaryfunctionnode.h" namespace search { namespace attribute { class IAttributeVector; } diff --git a/searchlib/src/vespa/searchlib/expression/perdocexpression.cpp b/searchlib/src/vespa/searchlib/expression/perdocexpression.cpp index 202ce85f556..ae37ad101f1 100644 --- a/searchlib/src/vespa/searchlib/expression/perdocexpression.cpp +++ b/searchlib/src/vespa/searchlib/expression/perdocexpression.cpp @@ -1,10 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/searchlib/expression/floatresultnode.h> -#include <vespa/searchlib/expression/relevancenode.h> - -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.documentexpressions"); +#include "relevancenode.h" namespace search { namespace expression { diff --git a/searchlib/src/vespa/searchlib/expression/relevancenode.h b/searchlib/src/vespa/searchlib/expression/relevancenode.h index 6f867329961..8165f87957b 100644 --- a/searchlib/src/vespa/searchlib/expression/relevancenode.h +++ b/searchlib/src/vespa/searchlib/expression/relevancenode.h @@ -1,8 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/searchlib/expression/expressionnode.h> -#include <vespa/searchlib/expression/resultnode.h> +#include "floatresultnode.h" namespace search { namespace expression { diff --git a/searchlib/src/vespa/searchlib/grouping/groupengine.h b/searchlib/src/vespa/searchlib/grouping/groupengine.h index 2f9a83d45e1..e6936b95408 100644 --- a/searchlib/src/vespa/searchlib/grouping/groupengine.h +++ b/searchlib/src/vespa/searchlib/grouping/groupengine.h @@ -3,6 +3,7 @@ #include <vespa/searchlib/aggregation/groupinglevel.h> #include <vespa/searchlib/grouping/collect.h> +#include <vespa/vespalib/util/sort.h> namespace search { namespace grouping { @@ -119,7 +120,7 @@ private: } size_t getIdBase(GroupRef g) const { return _idByteSize*g; } - typedef expression::ResultNodeVector::UP IdList; + using IdList = std::unique_ptr<expression::ResultNodeVector>; typedef vespalib::Array<Children *> GroupBacking; typedef std::vector<double> RankV; typedef vespalib::Array<uint8_t> IdBacking; diff --git a/searchlib/src/vespa/searchlib/grouping/sketch.h b/searchlib/src/vespa/searchlib/grouping/sketch.h index b97da00f4cf..50209b19bbd 100644 --- a/searchlib/src/vespa/searchlib/grouping/sketch.h +++ b/searchlib/src/vespa/searchlib/grouping/sketch.h @@ -12,6 +12,7 @@ #include <vespa/vespalib/objects/serializer.h> #include <algorithm> #include <unordered_set> +#include <ostream> namespace search { |