diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-06-01 16:54:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-01 16:54:15 +0200 |
commit | 1026c45714c0c3df53b0c3a660cda7c4a04a22cd (patch) | |
tree | 4253e5e7c230dd7bd8c668ebdab284ed9eab72e9 | |
parent | a7509e77c7fc62d73c96da7e09490523dab8a133 (diff) | |
parent | ced603ba9349f3591e0382dd2c6b88ac14cc3d2a (diff) |
Merge pull request #2600 from yahoo/balder/remove-fastos.h-from-searchlib
Balder/remove fastos.h from searchlib
324 files changed, 827 insertions, 1891 deletions
diff --git a/searchlib/src/apps/expgolomb/expgolomb.cpp b/searchlib/src/apps/expgolomb/expgolomb.cpp index 2883a0ca392..81aa566305c 100644 --- a/searchlib/src/apps/expgolomb/expgolomb.cpp +++ b/searchlib/src/apps/expgolomb/expgolomb.cpp @@ -1,6 +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/fastos/app.h> #include <vespa/searchlib/bitcompression/compression.h> #include <vector> diff --git a/searchlib/src/apps/uniform/uniform.cpp b/searchlib/src/apps/uniform/uniform.cpp index 782f072a7b0..8fb6b2af0ca 100644 --- a/searchlib/src/apps/uniform/uniform.cpp +++ b/searchlib/src/apps/uniform/uniform.cpp @@ -1,6 +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/fastos/app.h> #include <vespa/searchlib/bitcompression/compression.h> diff --git a/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp b/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp index f5d2be65d6b..d0f7c8e1623 100644 --- a/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp +++ b/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.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 <vespa/searchlib/index/dictionaryfile.h> #include <vespa/searchlib/index/postinglistfile.h> #include <vespa/searchlib/bitcompression/compression.h> @@ -15,7 +14,9 @@ #include <vespa/searchlib/queryeval/searchiterator.h> #include <vespa/searchlib/fef/termfieldmatchdata.h> #include <vespa/searchlib/fef/termfieldmatchdataarray.h> +#include <vespa/fastos/app.h> #include <iostream> + #include <vespa/log/log.h> LOG_SETUP("vespa-index-inspect"); @@ -41,8 +42,7 @@ using search::index::schema::DataType; using search::queryeval::SearchIterator; using namespace search::index; -namespace -{ +namespace { /** * Fine granularity, for small scale inversion within a single document. diff --git a/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp b/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp index e97887c107e..ccfbf4c0e14 100644 --- a/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp +++ b/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp @@ -1,23 +1,17 @@ // 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 <map> #include <vespa/searchlib/features/rankingexpression/feature_name_extractor.h> -#include <vector> #include <vespa/eval/eval/llvm/compiled_function.h> -#include <vespa/eval/eval/function.h> #include <vespa/eval/eval/interpreted_function.h> -#include <vespa/eval/eval/basic_nodes.h> #include <vespa/eval/eval/call_nodes.h> #include <vespa/eval/eval/operator_nodes.h> #include <vespa/vespalib/util/benchmark_timer.h> -#include <vespa/eval/eval/gbdt.h> #include <vespa/eval/eval/vm_forest.h> #include <vespa/eval/eval/llvm/deinline_forest.h> #include <vespa/eval/tensor/default_tensor_engine.h> #include <vespa/vespalib/io/mapped_file_input.h> #include <vespa/eval/eval/param_usage.h> -#include <cmath> +#include <vespa/fastos/app.h> //----------------------------------------------------------------------------- diff --git a/searchlib/src/vespa/searchlib/aggregation/fs4hit.cpp b/searchlib/src/vespa/searchlib/aggregation/fs4hit.cpp index f63f44d3a12..aac21a0ae66 100644 --- a/searchlib/src/vespa/searchlib/aggregation/fs4hit.cpp +++ b/searchlib/src/vespa/searchlib/aggregation/fs4hit.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 "fs4hit.h" #include <vespa/vespalib/objects/visit.h> diff --git a/searchlib/src/vespa/searchlib/aggregation/hit.cpp b/searchlib/src/vespa/searchlib/aggregation/hit.cpp index 9bb7cf95757..501249cf867 100644 --- a/searchlib/src/vespa/searchlib/aggregation/hit.cpp +++ b/searchlib/src/vespa/searchlib/aggregation/hit.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 "hit.h" #include <vespa/vespalib/objects/visit.h> diff --git a/searchlib/src/vespa/searchlib/aggregation/rawrank.cpp b/searchlib/src/vespa/searchlib/aggregation/rawrank.cpp index b570c7795c0..7674cde1de7 100644 --- a/searchlib/src/vespa/searchlib/aggregation/rawrank.cpp +++ b/searchlib/src/vespa/searchlib/aggregation/rawrank.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 "rawrank.h" #include <vespa/vespalib/util/sort.h> #include <algorithm> diff --git a/searchlib/src/vespa/searchlib/attribute/CMakeLists.txt b/searchlib/src/vespa/searchlib/attribute/CMakeLists.txt index e06514e3fc0..0e7dee7d668 100644 --- a/searchlib/src/vespa/searchlib/attribute/CMakeLists.txt +++ b/searchlib/src/vespa/searchlib/attribute/CMakeLists.txt @@ -67,6 +67,7 @@ vespa_add_library(searchlib_attribute OBJECT multistringpostattribute.cpp multivalueattribute.cpp multivalueattributesaver.cpp + multivalueattributesaverutils.cpp not_implemented_attribute.cpp numericbase.cpp postingchange.cpp diff --git a/searchlib/src/vespa/searchlib/attribute/attribute.cpp b/searchlib/src/vespa/searchlib/attribute/attribute.cpp index 649ac1c9786..e0a47db521f 100644 --- a/searchlib/src/vespa/searchlib/attribute/attribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attribute.cpp @@ -1,10 +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 "attribute.h" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.attribute"); namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/attributefactory.cpp b/searchlib/src/vespa/searchlib/attribute/attributefactory.cpp index f7d5adbe049..e80fd2ab8c0 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributefactory.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributefactory.cpp @@ -1,11 +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 "attributefactory.h" + #include <vespa/log/log.h> LOG_SETUP(".searchlib.attributefactory"); -#include "attributefactory.h" - namespace search { using attribute::CollectionType; diff --git a/searchlib/src/vespa/searchlib/attribute/attributefile.cpp b/searchlib/src/vespa/searchlib/attribute/attributefile.cpp index a2f12ad3a1d..8394fc36fb6 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributefile.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributefile.cpp @@ -1,12 +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 "attributefile.h" -#include <stdexcept> +#include <vespa/searchlib/util/filesizecalculator.h> #include <vespa/vespalib/util/error.h> #include <vespa/vespalib/util/exceptions.h> #include <vespa/vespalib/data/fileheader.h> -#include <vespa/searchlib/util/filesizecalculator.h> +#include <stdexcept> #include <vespa/log/log.h> LOG_SETUP(".attributefile"); @@ -15,13 +14,11 @@ using vespalib::IllegalStateException; using search::common::FileHeaderContext; using vespalib::getLastErrorString; -namespace search -{ +namespace search { using attribute::BasicType; -namespace -{ +namespace { void updateHeader(const vespalib::string &name) diff --git a/searchlib/src/vespa/searchlib/attribute/attributefilebufferwriter.cpp b/searchlib/src/vespa/searchlib/attribute/attributefilebufferwriter.cpp index 15eceae889d..561993c7bce 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributefilebufferwriter.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributefilebufferwriter.cpp @@ -1,10 +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 "attributefilebufferwriter.h" -namespace search -{ +namespace search { AttributeFileBufferWriter:: AttributeFileBufferWriter(IAttributeFileWriter &fileWriter) diff --git a/searchlib/src/vespa/searchlib/attribute/attributefilesavetarget.cpp b/searchlib/src/vespa/searchlib/attribute/attributefilesavetarget.cpp index ce77c3b8722..291f265c484 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributefilesavetarget.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributefilesavetarget.cpp @@ -1,20 +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/log/log.h> -LOG_SETUP(".searchlib.attribute.attributefilesavetarget"); - #include "attributefilesavetarget.h" #include "attributevector.h" +#include <vespa/searchlib/common/fileheadercontext.h> #include <vespa/vespalib/data/fileheader.h> #include <vespa/vespalib/data/databuffer.h> -#include <vespa/searchlib/common/fileheadercontext.h> #include <vespa/vespalib/util/error.h> +#include <vespa/log/log.h> +LOG_SETUP(".searchlib.attribute.attributefilesavetarget"); + using vespalib::getLastErrorString; -namespace search -{ +namespace search { using common::FileHeaderContext; diff --git a/searchlib/src/vespa/searchlib/attribute/attributememoryfilebufferwriter.cpp b/searchlib/src/vespa/searchlib/attribute/attributememoryfilebufferwriter.cpp index 534a7d6ff2f..833171328a6 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributememoryfilebufferwriter.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributememoryfilebufferwriter.cpp @@ -1,11 +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 "attributememoryfilebufferwriter.h" -namespace search -{ - +namespace search { AttributeMemoryFileBufferWriter:: AttributeMemoryFileBufferWriter(IAttributeFileWriter &memoryFileWriter) diff --git a/searchlib/src/vespa/searchlib/attribute/attributememoryfilewriter.cpp b/searchlib/src/vespa/searchlib/attribute/attributememoryfilewriter.cpp index a9b72350c7e..b536cdae0b9 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributememoryfilewriter.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributememoryfilewriter.cpp @@ -1,14 +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 "attributememoryfilewriter.h" #include "attributememoryfilebufferwriter.h" -namespace search -{ +namespace search { -namespace -{ +namespace { const uint32_t MIN_ALIGNMENT = 4096; diff --git a/searchlib/src/vespa/searchlib/attribute/attributememorysavetarget.cpp b/searchlib/src/vespa/searchlib/attribute/attributememorysavetarget.cpp index 41166c8b76b..e93e2ee34db 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributememorysavetarget.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributememorysavetarget.cpp @@ -1,15 +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/log/log.h> -LOG_SETUP(".searchlib.attribute.attributememorysavetarget"); - #include "attributememorysavetarget.h" #include "attributefilesavetarget.h" #include "attributevector.h" -namespace search -{ +namespace search { using search::common::FileHeaderContext; diff --git a/searchlib/src/vespa/searchlib/attribute/attributesaver.cpp b/searchlib/src/vespa/searchlib/attribute/attributesaver.cpp index f00a14127aa..f03fecce67c 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributesaver.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributesaver.cpp @@ -1,14 +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 "attributesaver.h" #include "iattributesavetarget.h" - using vespalib::GenerationHandler; -namespace search -{ +namespace search { AttributeSaver::AttributeSaver(GenerationHandler::Guard &&guard, const attribute::AttributeHeader &header) diff --git a/searchlib/src/vespa/searchlib/attribute/configconverter.cpp b/searchlib/src/vespa/searchlib/attribute/configconverter.cpp index 9e3c6156dbf..63c964c3bf9 100644 --- a/searchlib/src/vespa/searchlib/attribute/configconverter.cpp +++ b/searchlib/src/vespa/searchlib/attribute/configconverter.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".searchlib.attribute.configconverter"); #include "configconverter.h" using namespace vespa::config::search; diff --git a/searchlib/src/vespa/searchlib/attribute/defines.cpp b/searchlib/src/vespa/searchlib/attribute/defines.cpp index cbe69920ac3..9af6da89662 100644 --- a/searchlib/src/vespa/searchlib/attribute/defines.cpp +++ b/searchlib/src/vespa/searchlib/attribute/defines.cpp @@ -1,10 +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 "defines.h" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.defines"); namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/dociditerator.cpp b/searchlib/src/vespa/searchlib/attribute/dociditerator.cpp index f7429070f34..400676cece6 100644 --- a/searchlib/src/vespa/searchlib/attribute/dociditerator.cpp +++ b/searchlib/src/vespa/searchlib/attribute/dociditerator.cpp @@ -1,10 +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 "dociditerator.h" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.dociditerator"); namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/enumattribute.cpp b/searchlib/src/vespa/searchlib/attribute/enumattribute.cpp index 396c50eba65..34f2c63eb00 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/enumattribute.cpp @@ -1,11 +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 "enumattribute.h" #include "enumattribute.hpp" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.enumattribute"); namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/enumattributesaver.cpp b/searchlib/src/vespa/searchlib/attribute/enumattributesaver.cpp index 37c66213134..a276beee2d7 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumattributesaver.cpp +++ b/searchlib/src/vespa/searchlib/attribute/enumattributesaver.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 "enumattributesaver.h" #include "iattributesavetarget.h" #include <vespa/searchlib/util/bufferwriter.h> diff --git a/searchlib/src/vespa/searchlib/attribute/enumcomparator.cpp b/searchlib/src/vespa/searchlib/attribute/enumcomparator.cpp index fde5666371b..564e08d7ee0 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumcomparator.cpp +++ b/searchlib/src/vespa/searchlib/attribute/enumcomparator.cpp @@ -1,9 +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 "enumcomparator.h" -#include <vespa/searchlib/util/foldedstringcompare.h> #include "enumstore.hpp" +#include <vespa/searchlib/util/foldedstringcompare.h> namespace search { diff --git a/searchlib/src/vespa/searchlib/attribute/enumhintsearchcontext.cpp b/searchlib/src/vespa/searchlib/attribute/enumhintsearchcontext.cpp index 7cd6555618c..154e9640db3 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumhintsearchcontext.cpp +++ b/searchlib/src/vespa/searchlib/attribute/enumhintsearchcontext.cpp @@ -1,16 +1,13 @@ // 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 "enumhintsearchcontext.h" #include <vespa/searchlib/queryeval/emptysearch.h> -namespace search -{ +namespace search { using queryeval::SearchIterator; -namespace attribute -{ +namespace attribute { using btree::BTreeNode; using fef::TermFieldMatchData; diff --git a/searchlib/src/vespa/searchlib/attribute/enumstore.cpp b/searchlib/src/vespa/searchlib/attribute/enumstore.cpp index cc50dc7b97d..3b4a9761110 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumstore.cpp +++ b/searchlib/src/vespa/searchlib/attribute/enumstore.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 "enumstore.h" #include "enumstore.hpp" #include <iomanip> diff --git a/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.cpp b/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.cpp index ee3950aaef4..9adef1a7ccc 100644 --- a/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.cpp +++ b/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.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 "fixedsourceselector.h" #include "singlenumericattribute.hpp" diff --git a/searchlib/src/vespa/searchlib/attribute/flagattribute.cpp b/searchlib/src/vespa/searchlib/attribute/flagattribute.cpp index bc9ea4b7ebf..dca416fc384 100644 --- a/searchlib/src/vespa/searchlib/attribute/flagattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/flagattribute.cpp @@ -1,23 +1,21 @@ // 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 "flagattribute.h" -#include <vespa/searchlib/attribute/attributeiterators.h> - -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.flagattribute"); +#include "load_utils.hpp" +#include "attributeiterators.h" +#include "multinumericattribute.hpp" -#include <vespa/searchlib/attribute/multinumericattribute.hpp> #include <vespa/searchlib/queryeval/emptysearch.h> -#include "load_utils.hpp" #include <vespa/searchlib/common/bitvectoriterator.h> +#include <vespa/log/log.h> +LOG_SETUP(".searchlib.attribute.flagattribute"); + namespace search { using queryeval::SearchIterator; -namespace -{ +namespace { template <class FA, typename T> class SaveBits diff --git a/searchlib/src/vespa/searchlib/attribute/i_document_weight_attribute.cpp b/searchlib/src/vespa/searchlib/attribute/i_document_weight_attribute.cpp index 2b1d4a01838..04e2fc7e7a8 100644 --- a/searchlib/src/vespa/searchlib/attribute/i_document_weight_attribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/i_document_weight_attribute.cpp @@ -1,4 +1,3 @@ // 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 "i_document_weight_attribute.h" diff --git a/searchlib/src/vespa/searchlib/attribute/iattributemanager.cpp b/searchlib/src/vespa/searchlib/attribute/iattributemanager.cpp index 0141534b1ba..f7a04437f15 100644 --- a/searchlib/src/vespa/searchlib/attribute/iattributemanager.cpp +++ b/searchlib/src/vespa/searchlib/attribute/iattributemanager.cpp @@ -1,10 +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 "iattributemanager.h" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.iattributemanager"); namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/iattributesavetarget.cpp b/searchlib/src/vespa/searchlib/attribute/iattributesavetarget.cpp index e7221c0c401..e8d9bbc5423 100644 --- a/searchlib/src/vespa/searchlib/attribute/iattributesavetarget.cpp +++ b/searchlib/src/vespa/searchlib/attribute/iattributesavetarget.cpp @@ -1,10 +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 "iattributesavetarget.h" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.iattributesavetarget"); namespace search { IAttributeSaveTarget::~IAttributeSaveTarget() { diff --git a/searchlib/src/vespa/searchlib/attribute/ipostinglistsearchcontext.cpp b/searchlib/src/vespa/searchlib/attribute/ipostinglistsearchcontext.cpp index 89927def124..866869a1c33 100644 --- a/searchlib/src/vespa/searchlib/attribute/ipostinglistsearchcontext.cpp +++ b/searchlib/src/vespa/searchlib/attribute/ipostinglistsearchcontext.cpp @@ -1,10 +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 "ipostinglistsearchcontext.h" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.ipostinglistsearchcontext"); namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/ipostinglistsearchcontext.h b/searchlib/src/vespa/searchlib/attribute/ipostinglistsearchcontext.h index a88f2173260..94af4ac6ce5 100644 --- a/searchlib/src/vespa/searchlib/attribute/ipostinglistsearchcontext.h +++ b/searchlib/src/vespa/searchlib/attribute/ipostinglistsearchcontext.h @@ -2,25 +2,14 @@ #pragma once +#include <memory> -namespace search -{ - -namespace queryeval -{ +namespace search { -class SearchIterator; -} +namespace queryeval { class SearchIterator; } +namespace fef { class TermFieldMatchData; } -namespace fef -{ - -class TermFieldMatchData; -} - - -namespace attribute -{ +namespace attribute { /** @@ -43,8 +32,5 @@ public: virtual unsigned int approximateHits() const = 0; }; - } // namespace attribute - } // namespace search - diff --git a/searchlib/src/vespa/searchlib/attribute/loadedenumvalue.cpp b/searchlib/src/vespa/searchlib/attribute/loadedenumvalue.cpp index d86e41d332e..bc7b244c544 100644 --- a/searchlib/src/vespa/searchlib/attribute/loadedenumvalue.cpp +++ b/searchlib/src/vespa/searchlib/attribute/loadedenumvalue.cpp @@ -1,15 +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 "loadedenumvalue.h" #include <vespa/searchlib/common/sort.h> - -namespace search -{ - -namespace attribute -{ +namespace search { +namespace attribute { void sortLoadedByEnum(LoadedEnumAttributeVector &loaded) @@ -23,6 +18,5 @@ sortLoadedByEnum(LoadedEnumAttributeVector &loaded) } } // namespace attribute - } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/loadednumericvalue.cpp b/searchlib/src/vespa/searchlib/attribute/loadednumericvalue.cpp index 1fb2434167f..1034c4ecb1c 100644 --- a/searchlib/src/vespa/searchlib/attribute/loadednumericvalue.cpp +++ b/searchlib/src/vespa/searchlib/attribute/loadednumericvalue.cpp @@ -1,14 +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 "loadednumericvalue.h" -namespace search -{ - -namespace attribute -{ +namespace search { +namespace attribute { template <typename T> void @@ -89,8 +85,6 @@ void sortLoadedByDocId(SequentialReadModifyWriteVector<LoadedNumericValue<double>> & loaded); - } // namespace attribute - } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/loadedstringvalue.cpp b/searchlib/src/vespa/searchlib/attribute/loadedstringvalue.cpp index 954e4342466..26905bcfc2f 100644 --- a/searchlib/src/vespa/searchlib/attribute/loadedstringvalue.cpp +++ b/searchlib/src/vespa/searchlib/attribute/loadedstringvalue.cpp @@ -1,13 +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 "loadedstringvalue.h" using vespalib::Array; using vespalib::alloc::Alloc; namespace search { - namespace attribute { void @@ -43,6 +41,5 @@ sortLoadedByDocId(LoadedStringVectorReal &loaded) } // namespace attribute - } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/loadedvalue.cpp b/searchlib/src/vespa/searchlib/attribute/loadedvalue.cpp index cf2e611459b..7b11481128e 100644 --- a/searchlib/src/vespa/searchlib/attribute/loadedvalue.cpp +++ b/searchlib/src/vespa/searchlib/attribute/loadedvalue.cpp @@ -1,10 +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 "loadedvalue.h" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.loadedvalue"); namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.cpp b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.cpp index c4499fbe05f..ac2a925acad 100644 --- a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.cpp +++ b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.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 "multi_value_mapping.h" #include "multi_value_mapping.hpp" #include "multivalue.h" diff --git a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.cpp b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.cpp index b52d2ae2c73..51a54c89522 100644 --- a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.cpp +++ b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.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 "multi_value_mapping_base.h" #include <vespa/searchcommon/common/compaction_strategy.h> diff --git a/searchlib/src/vespa/searchlib/attribute/multienumattribute.cpp b/searchlib/src/vespa/searchlib/attribute/multienumattribute.cpp index 33588c94694..4d52150d34a 100644 --- a/searchlib/src/vespa/searchlib/attribute/multienumattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/multienumattribute.cpp @@ -1,11 +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 "multienumattribute.h" #include "multienumattribute.hpp" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.multienumattribute"); namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/multienumattributesaver.cpp b/searchlib/src/vespa/searchlib/attribute/multienumattributesaver.cpp index 76917ee883f..4cc0190a2dc 100644 --- a/searchlib/src/vespa/searchlib/attribute/multienumattributesaver.cpp +++ b/searchlib/src/vespa/searchlib/attribute/multienumattributesaver.cpp @@ -1,8 +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 "multienumattributesaver.h" -#include <vespa/searchlib/util/bufferwriter.h> #include "multivalueattributesaverutils.h" #include "multivalue.h" @@ -12,8 +10,7 @@ using search::multivalueattributesaver::WeightWriter; namespace search { -namespace -{ +namespace { /* * Class to write enum indexes mapped over to either enum values diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericattribute.cpp b/searchlib/src/vespa/searchlib/attribute/multinumericattribute.cpp index b6021881ee6..7f475943091 100644 --- a/searchlib/src/vespa/searchlib/attribute/multinumericattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/multinumericattribute.cpp @@ -1,11 +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 "multinumericattribute.h" #include "multinumericattribute.hpp" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.multinumericattribute"); namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericattributesaver.cpp b/searchlib/src/vespa/searchlib/attribute/multinumericattributesaver.cpp index d2ebd95d9f6..4610e2e6708 100644 --- a/searchlib/src/vespa/searchlib/attribute/multinumericattributesaver.cpp +++ b/searchlib/src/vespa/searchlib/attribute/multinumericattributesaver.cpp @@ -1,10 +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 "multinumericattributesaver.h" -#include <vespa/searchlib/util/bufferwriter.h> #include "multivalueattributesaverutils.h" #include "multivalue.h" +#include <vespa/searchlib/util/bufferwriter.h> using vespalib::GenerationHandler; using search::multivalueattributesaver::CountWriter; @@ -12,8 +11,7 @@ using search::multivalueattributesaver::WeightWriter; namespace search { -namespace -{ +namespace { class DatWriter { diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericenumattribute.cpp b/searchlib/src/vespa/searchlib/attribute/multinumericenumattribute.cpp index 1f62445a2b2..e711f679263 100644 --- a/searchlib/src/vespa/searchlib/attribute/multinumericenumattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/multinumericenumattribute.cpp @@ -1,11 +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 "multinumericenumattribute.h" #include "multinumericenumattribute.hpp" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.multinumericenumattribute"); namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.cpp b/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.cpp index 277fdafbf42..99aff626365 100644 --- a/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.cpp @@ -1,11 +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 "multinumericpostattribute.h" #include "multinumericpostattribute.hpp" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.multinumericpostattribute"); namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.cpp b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.cpp index a447ad1bd8d..fbdb2961e87 100644 --- a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.cpp @@ -1,11 +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 "multistringpostattribute.h" #include "multistringpostattribute.hpp" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.multistringpostattribute"); namespace search { EnumStoreBase::Index diff --git a/searchlib/src/vespa/searchlib/attribute/multivalueattribute.cpp b/searchlib/src/vespa/searchlib/attribute/multivalueattribute.cpp index 9db883f7ad2..982970f5fbf 100644 --- a/searchlib/src/vespa/searchlib/attribute/multivalueattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/multivalueattribute.cpp @@ -1,11 +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 "multivalueattribute.h" #include "multivalueattribute.hpp" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.multivalueattribute"); namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/multivalueattributesaver.cpp b/searchlib/src/vespa/searchlib/attribute/multivalueattributesaver.cpp index 0d5a7b465c4..141f7ee1b66 100644 --- a/searchlib/src/vespa/searchlib/attribute/multivalueattributesaver.cpp +++ b/searchlib/src/vespa/searchlib/attribute/multivalueattributesaver.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 "multivalueattributesaver.h" using vespalib::GenerationHandler; diff --git a/searchlib/src/vespa/searchlib/attribute/multivalueattributesaverutils.cpp b/searchlib/src/vespa/searchlib/attribute/multivalueattributesaverutils.cpp new file mode 100644 index 00000000000..b9308c7e9ab --- /dev/null +++ b/searchlib/src/vespa/searchlib/attribute/multivalueattributesaverutils.cpp @@ -0,0 +1,28 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include "multivalueattributesaverutils.h" +#include <vespa/searchlib/util/bufferwriter.h> + +namespace search::multivalueattributesaver { + +CountWriter::CountWriter(IAttributeSaveTarget &saveTarget) + : _countWriter(saveTarget.idxWriter().allocBufferWriter()), + _cnt(0) +{ + uint32_t initialCount = 0; + _countWriter->write(&initialCount, sizeof(uint32_t)); +} + +CountWriter::~CountWriter() +{ + _countWriter->flush(); +} + +void +CountWriter::writeCount(uint32_t count) { + _cnt += count; + uint32_t cnt32 = static_cast<uint32_t>(_cnt); + _countWriter->write(&cnt32, sizeof(uint32_t)); +} + +} diff --git a/searchlib/src/vespa/searchlib/attribute/multivalueattributesaverutils.h b/searchlib/src/vespa/searchlib/attribute/multivalueattributesaverutils.h index 8024d287a0d..fb41b4be053 100644 --- a/searchlib/src/vespa/searchlib/attribute/multivalueattributesaverutils.h +++ b/searchlib/src/vespa/searchlib/attribute/multivalueattributesaverutils.h @@ -3,10 +3,10 @@ #pragma once #include "iattributesavetarget.h" +#include <vespa/searchlib/util/bufferwriter.h> +#include <vespa/vespalib/util/arrayref.h> -namespace search { - -namespace multivalueattributesaver { +namespace search::multivalueattributesaver { /* * Class to write to count files for multivalue attributes (.idx suffix). @@ -17,25 +17,10 @@ class CountWriter uint64_t _cnt; public: - CountWriter(IAttributeSaveTarget &saveTarget) - : _countWriter(saveTarget.idxWriter().allocBufferWriter()), - _cnt(0) - { - uint32_t initialCount = 0; - _countWriter->write(&initialCount, sizeof(uint32_t)); - } - - ~CountWriter() - { - _countWriter->flush(); - } + CountWriter(IAttributeSaveTarget &saveTarget); + ~CountWriter(); - void - writeCount(uint32_t count) { - _cnt += count; - uint32_t cnt32 = static_cast<uint32_t>(_cnt); - _countWriter->write(&cnt32, sizeof(uint32_t)); - } + void writeCount(uint32_t count); }; /* @@ -55,11 +40,9 @@ class WeightWriter<true> public: WeightWriter(IAttributeSaveTarget &saveTarget) : _weightWriter(saveTarget.weightWriter().allocBufferWriter()) - { - } + {} - ~WeightWriter() - { + ~WeightWriter() { _weightWriter->flush(); } @@ -80,20 +63,12 @@ template <> class WeightWriter<false> { public: - WeightWriter(IAttributeSaveTarget &) - { - } + WeightWriter(IAttributeSaveTarget &) {} - ~WeightWriter() - { - } + ~WeightWriter() {} template <typename MultiValueT> - void - writeWeights(vespalib::ConstArrayRef<MultiValueT>) { - } + void writeWeights(vespalib::ConstArrayRef<MultiValueT>) {} }; -} // namespace search::multivalueattributesaver - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/attribute/postinglisttraits.cpp b/searchlib/src/vespa/searchlib/attribute/postinglisttraits.cpp index 38bf41d4c49..1e10a87a5a7 100644 --- a/searchlib/src/vespa/searchlib/attribute/postinglisttraits.cpp +++ b/searchlib/src/vespa/searchlib/attribute/postinglisttraits.cpp @@ -1,10 +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 "postinglisttraits.h" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.postinglisttraits"); namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/postingstore.cpp b/searchlib/src/vespa/searchlib/attribute/postingstore.cpp index 9e9268b0707..a21884bca4a 100644 --- a/searchlib/src/vespa/searchlib/attribute/postingstore.cpp +++ b/searchlib/src/vespa/searchlib/attribute/postingstore.cpp @@ -1,17 +1,14 @@ // 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 "postingstore.h" #include <vespa/searchlib/datastore/datastore.hpp> #include <vespa/searchlib/btree/btreeiterator.hpp> #include <vespa/searchcommon/attribute/config.h> #include <vespa/searchcommon/attribute/status.h> -namespace search -{ +namespace search { -namespace attribute -{ +namespace attribute { using btree::BTreeNoLeafData; diff --git a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp index 8909b854423..2e34638a420 100644 --- a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp @@ -1,16 +1,15 @@ // Copyright 2017 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include "reference_attribute.h" +#include "reference_attribute_saver.h" #include "attributesaver.h" -#include <vespa/vespalib/data/fileheader.h> #include "readerbase.h" #include <vespa/searchlib/datastore/unique_store_builder.h> #include <vespa/searchlib/datastore/datastore.hpp> #include <vespa/searchlib/datastore/unique_store.hpp> #include <vespa/searchlib/common/i_gid_to_lid_mapper_factory.h> #include <vespa/searchlib/common/i_gid_to_lid_mapper.h> -#include "reference_attribute_saver.h" +#include <vespa/vespalib/data/fileheader.h> namespace search { namespace attribute { diff --git a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.cpp index fe987a35d60..be90f617e10 100644 --- a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.cpp @@ -1,11 +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 "singleenumattribute.h" #include "singleenumattribute.hpp" -namespace search -{ +namespace search { using attribute::Config; diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.cpp index b08931f36fc..17692734bdc 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.cpp @@ -1,11 +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 "singlenumericattribute.h" #include "singlenumericattribute.hpp" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.singlenumericattribute"); namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericattributesaver.cpp b/searchlib/src/vespa/searchlib/attribute/singlenumericattributesaver.cpp index fe8cdf1ca42..01c2722d946 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlenumericattributesaver.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singlenumericattributesaver.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 "singlenumericattributesaver.h" #include "iattributesavetarget.h" @@ -8,8 +7,7 @@ using vespalib::GenerationHandler; namespace search { -namespace -{ +namespace { const uint32_t MIN_ALIGNMENT = 4096; diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.cpp index df86159833d..ae09d08b388 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.cpp @@ -1,11 +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 "singlenumericenumattribute.h" #include "singlenumericenumattribute.hpp" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.singlenumericenumattribute"); namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.cpp index 3eb6f61101d..3fb8b758f12 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.cpp @@ -1,11 +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 "singlenumericpostattribute.h" #include "singlenumericpostattribute.hpp" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.singlenumericpostattribute"); namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/singlestringattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singlestringattribute.cpp index 0c6c6d8ee06..e7fa5962ca7 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlestringattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singlestringattribute.cpp @@ -1,11 +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 "singlestringattribute.h" #include "singlestringattribute.hpp" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.singlestringattribute"); namespace search { template class SingleValueStringAttributeT<EnumAttribute<StringAttribute>>; diff --git a/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.cpp index e0ac10c10af..cef98c431bd 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.cpp @@ -1,11 +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 "singlestringpostattribute.h" #include "singlestringpostattribute.hpp" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.singlestringpostattribute"); namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/bitcompression/countcompression.cpp b/searchlib/src/vespa/searchlib/bitcompression/countcompression.cpp index ae6254e44e9..6acfa022a14 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/countcompression.cpp +++ b/searchlib/src/vespa/searchlib/bitcompression/countcompression.cpp @@ -2,17 +2,14 @@ // Copyright (C) 1998-2003 Fast Search & Transfer ASA // Copyright (C) 2003 Overture Services Norway AS -#include <vespa/fastos/fastos.h> #include "compression.h" #include "countcompression.h" #include <vespa/searchlib/index/postinglistcounts.h> #include <vespa/vespalib/objects/nbostream.h> -namespace search -{ +namespace search { -namespace bitcompression -{ +namespace bitcompression { using vespalib::nbostream; diff --git a/searchlib/src/vespa/searchlib/bitcompression/posocccompression.cpp b/searchlib/src/vespa/searchlib/bitcompression/posocccompression.cpp index 32ab2d05dc7..f50be0d5119 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/posocccompression.cpp +++ b/searchlib/src/vespa/searchlib/bitcompression/posocccompression.cpp @@ -2,7 +2,6 @@ // Copyright (C) 2002-2003 Fast Search & Transfer ASA // Copyright (C) 2003 Overture Services Norway AS -#include <vespa/fastos/fastos.h> #include "compression.h" #include "posocccompression.h" #include <vespa/searchlib/index/schemautil.h> @@ -10,6 +9,7 @@ #include <vespa/searchlib/fef/termfieldmatchdataarray.h> #include <vespa/vespalib/stllike/asciistream.h> #include <vespa/vespalib/data/fileheader.h> + #include <vespa/log/log.h> LOG_SETUP(".posocccompression"); diff --git a/searchlib/src/vespa/searchlib/btree/btreeaggregator.cpp b/searchlib/src/vespa/searchlib/btree/btreeaggregator.cpp index 75e07cd7514..a02e2744861 100644 --- a/searchlib/src/vespa/searchlib/btree/btreeaggregator.cpp +++ b/searchlib/src/vespa/searchlib/btree/btreeaggregator.cpp @@ -1,16 +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 "btreetraits.h" #include "btreeaggregator.hpp" #include "noaggrcalc.h" #include "minmaxaggrcalc.h" -namespace search -{ - -namespace btree -{ +namespace search::btree { template class BTreeAggregator<uint32_t, uint32_t>; template class BTreeAggregator<uint32_t, BTreeNoLeafData>; @@ -19,7 +14,4 @@ template class BTreeAggregator<uint32_t, int32_t, MinMaxAggregated, BTreeDefaultTraits::LEAF_SLOTS, MinMaxAggrCalc>; - -} // namespace btree - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/btree/btreebuilder.cpp b/searchlib/src/vespa/searchlib/btree/btreebuilder.cpp index 4a2096f8fc4..4123f3c1afa 100644 --- a/searchlib/src/vespa/searchlib/btree/btreebuilder.cpp +++ b/searchlib/src/vespa/searchlib/btree/btreebuilder.cpp @@ -1,15 +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 "btreebuilder.h" #include "btreenode.hpp" #include "btreebuilder.hpp" -namespace search -{ - -namespace btree -{ +namespace search::btree { template class BTreeBuilder<uint32_t, uint32_t, NoAggregated, @@ -25,6 +20,4 @@ template class BTreeBuilder<uint32_t, int32_t, BTreeDefaultTraits::LEAF_SLOTS, MinMaxAggrCalc>; -} // namespace btree - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/btree/btreeinserter.cpp b/searchlib/src/vespa/searchlib/btree/btreeinserter.cpp index 726d5208e46..ff169c0b6c8 100644 --- a/searchlib/src/vespa/searchlib/btree/btreeinserter.cpp +++ b/searchlib/src/vespa/searchlib/btree/btreeinserter.cpp @@ -1,17 +1,12 @@ // 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 "btreeinserter.h" #include "btreenodeallocator.h" #include "btreerootbase.hpp" #include "btreeinserter.hpp" #include "btreenode.hpp" -namespace search -{ - -namespace btree -{ +namespace search::btree { template class BTreeInserter<uint32_t, uint32_t, NoAggregated>; template class BTreeInserter<uint32_t, BTreeNoLeafData, NoAggregated>; @@ -20,6 +15,4 @@ template class BTreeInserter<uint32_t, int32_t, MinMaxAggregated, BTreeDefaultTraits, MinMaxAggrCalc>; -} // namespace btree - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/btree/btreeiterator.cpp b/searchlib/src/vespa/searchlib/btree/btreeiterator.cpp index 48accfd1ed9..1d417ee9fb6 100644 --- a/searchlib/src/vespa/searchlib/btree/btreeiterator.cpp +++ b/searchlib/src/vespa/searchlib/btree/btreeiterator.cpp @@ -1,16 +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 "btreeroot.h" #include "btreenodeallocator.h" #include "btreeiterator.hpp" #include "btreenode.hpp" -namespace search -{ - -namespace btree -{ +namespace search::btree { template class BTreeIteratorBase<uint32_t, uint32_t, NoAggregated>; template class BTreeIteratorBase<uint32_t, BTreeNoLeafData, NoAggregated>; @@ -22,6 +17,4 @@ template class BTreeIterator<uint32_t, uint32_t, NoAggregated>; template class BTreeIterator<uint32_t, BTreeNoLeafData, NoAggregated>; template class BTreeIterator<uint32_t, int32_t, MinMaxAggregated>; -} // namespace btree - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/btree/btreenode.cpp b/searchlib/src/vespa/searchlib/btree/btreenode.cpp index 58992c12def..85299091441 100644 --- a/searchlib/src/vespa/searchlib/btree/btreenode.cpp +++ b/searchlib/src/vespa/searchlib/btree/btreenode.cpp @@ -1,11 +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 "btreenode.h" #include "btreenode.hpp" -namespace search { -namespace btree { +namespace search::btree { BTreeNoLeafData BTreeNoLeafData::_instance; @@ -34,4 +32,3 @@ template class BTreeLeafNodeTemp<uint32_t, int32_t, MinMaxAggregated, template class BTreeLeafNodeTemp<uint32_t, BTreeNoLeafData, NoAggregated, 16>; } // namespace search::btree -} // namespace search diff --git a/searchlib/src/vespa/searchlib/btree/btreenodestore.cpp b/searchlib/src/vespa/searchlib/btree/btreenodestore.cpp index d7f15cf9ca5..26862370fa6 100644 --- a/searchlib/src/vespa/searchlib/btree/btreenodestore.cpp +++ b/searchlib/src/vespa/searchlib/btree/btreenodestore.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 "btreenodestore.hpp" #include "btreenode.h" #include "btreerootbase.h" @@ -8,8 +7,7 @@ #include "btreenodeallocator.h" #include <vespa/searchlib/datastore/datastore.h> -namespace search { -namespace btree { +namespace search::btree { template class BTreeNodeStore<uint32_t, uint32_t, NoAggregated, @@ -35,6 +33,4 @@ typedef BTreeNodeStore<uint32_t, int32_t, MinMaxAggregated, BTreeDefaultTraits::INTERNAL_SLOTS, BTreeDefaultTraits::LEAF_SLOTS> MyNodeStore3; -} // namespace btree - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/btree/btreeremover.cpp b/searchlib/src/vespa/searchlib/btree/btreeremover.cpp index 0c3bdd346b6..d7324ec4af9 100644 --- a/searchlib/src/vespa/searchlib/btree/btreeremover.cpp +++ b/searchlib/src/vespa/searchlib/btree/btreeremover.cpp @@ -1,17 +1,12 @@ // 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 "btreeremover.h" #include "btreenodeallocator.h" #include "btreerootbase.hpp" #include "btreeremover.hpp" #include "btreenode.hpp" -namespace search -{ - -namespace btree -{ +namespace search::btree { template class BTreeRemover<uint32_t, uint32_t, NoAggregated>; template class BTreeRemover<uint32_t, BTreeNoLeafData, NoAggregated>; @@ -20,6 +15,4 @@ template class BTreeRemover<uint32_t, int32_t, MinMaxAggregated, BTreeDefaultTraits, MinMaxAggrCalc>; -} // namespace btree - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/btree/btreeroot.cpp b/searchlib/src/vespa/searchlib/btree/btreeroot.cpp index 9fce40628d4..14db139486d 100644 --- a/searchlib/src/vespa/searchlib/btree/btreeroot.cpp +++ b/searchlib/src/vespa/searchlib/btree/btreeroot.cpp @@ -1,17 +1,12 @@ // 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 "btreeroot.h" #include "btreenodeallocator.h" #include "btreeiterator.hpp" #include "btreeroot.hpp" #include "btreenode.hpp" -namespace search -{ - -namespace btree -{ +namespace search::btree { template class BTreeRootT<uint32_t, uint32_t, NoAggregated>; template class BTreeRootT<uint32_t, BTreeNoLeafData, NoAggregated>; @@ -22,6 +17,4 @@ template class BTreeRoot<uint32_t, int32_t, MinMaxAggregated, std::less<uint32_t>, BTreeDefaultTraits, MinMaxAggrCalc>; -} // namespace btree - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/btree/btreestore.cpp b/searchlib/src/vespa/searchlib/btree/btreestore.cpp index a5c05d9bf2a..7de106c5dc7 100644 --- a/searchlib/src/vespa/searchlib/btree/btreestore.cpp +++ b/searchlib/src/vespa/searchlib/btree/btreestore.cpp @@ -1,15 +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 "btreestore.h" #include "btreestore.hpp" #include "btreeiterator.hpp" -namespace search -{ - -namespace btree -{ +namespace search::btree { template class BTreeStore<uint32_t, uint32_t, NoAggregated, @@ -27,6 +22,4 @@ template class BTreeStore<uint32_t, int32_t, BTreeDefaultTraits, MinMaxAggrCalc>; -} // namespace btree - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/common/documentsummary.cpp b/searchlib/src/vespa/searchlib/common/documentsummary.cpp index 03faf45c1a9..9dc270918cf 100644 --- a/searchlib/src/vespa/searchlib/common/documentsummary.cpp +++ b/searchlib/src/vespa/searchlib/common/documentsummary.cpp @@ -2,13 +2,12 @@ // Copyright (C) 1998-2003 Fast Search & Transfer ASA // Copyright (C) 2003 Overture Services Norway AS -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> +#include "documentsummary.h" #include <vespa/fastlib/io/bufferedfile.h> #include <vespa/searchlib/util/filekit.h> -#include <vespa/searchlib/common/documentsummary.h> #include <vespa/vespalib/util/error.h> +#include <vespa/log/log.h> LOG_SETUP(".searchlib.docsummary.documentsummary"); using vespalib::getLastErrorString; diff --git a/searchlib/src/vespa/searchlib/common/fileheadercontext.cpp b/searchlib/src/vespa/searchlib/common/fileheadercontext.cpp index 2600a7d2749..84c78fc0fd4 100644 --- a/searchlib/src/vespa/searchlib/common/fileheadercontext.cpp +++ b/searchlib/src/vespa/searchlib/common/fileheadercontext.cpp @@ -1,16 +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/log/log.h> -LOG_SETUP(".index.fileheadercontext"); #include "fileheadercontext.h" #include <vespa/vespalib/data/fileheader.h> +#include <vespa/fastos/timestamp.h> -namespace search -{ - -namespace common -{ +namespace search::common { using vespalib::GenericHeader; @@ -18,12 +12,10 @@ FileHeaderContext::FileHeaderContext() { } - FileHeaderContext::~FileHeaderContext() { } - void FileHeaderContext::addCreateAndFreezeTime(GenericHeader &header) { @@ -33,7 +25,6 @@ FileHeaderContext::addCreateAndFreezeTime(GenericHeader &header) header.putTag(Tag("freezeTime", 0)); } - void FileHeaderContext::setFreezeTime(GenericHeader &header) { @@ -45,7 +36,4 @@ FileHeaderContext::setFreezeTime(GenericHeader &header) } } - -} // namespace common - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/common/foregroundtaskexecutor.cpp b/searchlib/src/vespa/searchlib/common/foregroundtaskexecutor.cpp index 595c91f9637..4be46867f3a 100644 --- a/searchlib/src/vespa/searchlib/common/foregroundtaskexecutor.cpp +++ b/searchlib/src/vespa/searchlib/common/foregroundtaskexecutor.cpp @@ -1,16 +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/log/log.h> -LOG_SETUP(".common.foregroundtaskexecutor"); - #include "foregroundtaskexecutor.h" #include <vespa/vespalib/util/threadstackexecutor.h> using vespalib::ThreadStackExecutor; -namespace search -{ +namespace search { ForegroundTaskExecutor::ForegroundTaskExecutor() : ForegroundTaskExecutor(1) diff --git a/searchlib/src/vespa/searchlib/common/growablebitvector.cpp b/searchlib/src/vespa/searchlib/common/growablebitvector.cpp index 6e8948b38c1..a1be37aebee 100644 --- a/searchlib/src/vespa/searchlib/common/growablebitvector.cpp +++ b/searchlib/src/vespa/searchlib/common/growablebitvector.cpp @@ -2,12 +2,10 @@ // Copyright (C) 1998-2003 Fast Search & Transfer ASA // Copyright (C) 2003 Overture Services Norway AS -#include <vespa/fastos/fastos.h> #include "growablebitvector.h" ///////////////////////////////// -namespace search -{ +namespace search { using vespalib::GenerationHeldBase; using vespalib::GenerationHolder; diff --git a/searchlib/src/vespa/searchlib/common/location.cpp b/searchlib/src/vespa/searchlib/common/location.cpp index 07b56d5e485..24481c47528 100644 --- a/searchlib/src/vespa/searchlib/common/location.cpp +++ b/searchlib/src/vespa/searchlib/common/location.cpp @@ -1,11 +1,10 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. // Copyright (C) 1999-2003 Fast Search & Transfer ASA // Copyright (C) 2003 Overture Services Norway AS -#include <vespa/fastos/fastos.h> -#include <vespa/searchlib/common/location.h> -namespace search { -namespace common { +#include "location.h" + +namespace search::common { Location::Location() : _zBoundingBox(0,0,0,0), @@ -202,4 +201,3 @@ bool Location::parse(const vespalib::string &locStr) } } -} diff --git a/searchlib/src/vespa/searchlib/common/resultset.cpp b/searchlib/src/vespa/searchlib/common/resultset.cpp index ca099a11f31..a7d9758f397 100644 --- a/searchlib/src/vespa/searchlib/common/resultset.cpp +++ b/searchlib/src/vespa/searchlib/common/resultset.cpp @@ -2,9 +2,8 @@ // Copyright (C) 1998-2003 Fast Search & Transfer ASA // Copyright (C) 2003 Overture Services Norway AS -#include <vespa/fastos/fastos.h> -#include <vespa/searchlib/common/resultset.h> -#include <vespa/searchlib/common/bitvector.h> +#include "resultset.h" +#include "bitvector.h" using vespalib::alloc::Alloc; diff --git a/searchlib/src/vespa/searchlib/common/serialnumfileheadercontext.cpp b/searchlib/src/vespa/searchlib/common/serialnumfileheadercontext.cpp index d9b575678d9..932e405f08c 100644 --- a/searchlib/src/vespa/searchlib/common/serialnumfileheadercontext.cpp +++ b/searchlib/src/vespa/searchlib/common/serialnumfileheadercontext.cpp @@ -1,15 +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 "serialnumfileheadercontext.h" #include <vespa/vespalib/data/fileheader.h> -namespace search -{ - -namespace common -{ - +namespace search::common { SerialNumFileHeaderContext::SerialNumFileHeaderContext( const FileHeaderContext &parentFileHeaderContext, @@ -31,6 +26,4 @@ SerialNumFileHeaderContext::addTags(vespalib::GenericHeader &header, header.putTag(Tag("serialNum", _serialNum)); } -} // namespace common - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/common/sort.cpp b/searchlib/src/vespa/searchlib/common/sort.cpp index 9d43e98457d..3af18f1344a 100644 --- a/searchlib/src/vespa/searchlib/common/sort.cpp +++ b/searchlib/src/vespa/searchlib/common/sort.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 <vespa/searchlib/common/sort.h> +#include "sort.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/common/sort.h b/searchlib/src/vespa/searchlib/common/sort.h index 231865321c0..44d4bfda925 100644 --- a/searchlib/src/vespa/searchlib/common/sort.h +++ b/searchlib/src/vespa/searchlib/common/sort.h @@ -6,10 +6,9 @@ #include <functional> #include <limits> #include <algorithm> +#include <cstring> - -namespace search -{ +namespace search { bool radix_prepare(unsigned int n, unsigned int last[257], unsigned int ptr[256], unsigned int cnt[256]); diff --git a/searchlib/src/vespa/searchlib/common/tunefileinfo.cpp b/searchlib/src/vespa/searchlib/common/tunefileinfo.cpp index 231407fadca..89ae6f42327 100644 --- a/searchlib/src/vespa/searchlib/common/tunefileinfo.cpp +++ b/searchlib/src/vespa/searchlib/common/tunefileinfo.cpp @@ -1,11 +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 "tunefileinfo.h" - -namespace search -{ - +namespace search { } // namespace search diff --git a/searchlib/src/vespa/searchlib/datastore/array_store_config.cpp b/searchlib/src/vespa/searchlib/datastore/array_store_config.cpp index 1710e41069b..46a55a83776 100644 --- a/searchlib/src/vespa/searchlib/datastore/array_store_config.cpp +++ b/searchlib/src/vespa/searchlib/datastore/array_store_config.cpp @@ -1,10 +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 "array_store_config.h" +#include <cassert> -namespace search { -namespace datastore { +namespace search::datastore { ArrayStoreConfig::ArrayStoreConfig(size_t maxSmallArraySize, const AllocSpec &defaultSpec) : _allocSpecs() @@ -63,4 +62,3 @@ ArrayStoreConfig::optimizeForHugePage(size_t maxSmallArraySize, } } -} diff --git a/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.cpp b/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.cpp index 6b3df48083a..e7b868f127c 100644 --- a/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.cpp @@ -2,21 +2,14 @@ // Copyright (C) 1998-2003 Fast Search & Transfer ASA // Copyright (C) 2003 Overture Services Norway AS -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".diskindex.bitvectorfile"); -#include <vespa/searchlib/common/bitvector.h> #include "bitvectorfile.h" #include <vespa/searchlib/index/bitvectorkeys.h> +#include <vespa/searchlib/common/bitvector.h> +#include <vespa/searchlib/common/fileheadercontext.h> #include <vespa/vespalib/objects/nbostream.h> #include <vespa/vespalib/data/fileheader.h> -#include <vespa/searchlib/common/fileheadercontext.h> - -namespace search -{ -namespace diskindex -{ +namespace search::diskindex { using vespalib::nbostream; using search::index::BitVectorWordSingleKey; @@ -236,7 +229,4 @@ BitVectorCandidate::checkPointRead(nbostream &in) } } - -} // namespace diskindex - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.cpp b/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.cpp index 3b7cebb95ee..a779f3e7a6a 100644 --- a/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.cpp @@ -2,21 +2,14 @@ // Copyright (C) 1998-2003 Fast Search & Transfer ASA // Copyright (C) 2003 Overture Services Norway AS -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".diskindex.bitvectoridxfile"); -#include <vespa/searchlib/common/bitvector.h> #include "bitvectoridxfile.h" #include <vespa/searchlib/index/bitvectorkeys.h> +#include <vespa/searchlib/common/bitvector.h> +#include <vespa/searchlib/common/fileheadercontext.h> #include <vespa/vespalib/objects/nbostream.h> #include <vespa/vespalib/data/fileheader.h> -#include <vespa/searchlib/common/fileheadercontext.h> - -namespace search -{ -namespace diskindex -{ +namespace search::diskindex { using vespalib::nbostream; using search::index::BitVectorWordSingleKey; @@ -227,7 +220,4 @@ BitVectorIdxFileWrite::close() } } - -} // namespace diskindex - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/diskindex/bitvectorkeyscope.cpp b/searchlib/src/vespa/searchlib/diskindex/bitvectorkeyscope.cpp index 344adae485c..fa3411b7835 100644 --- a/searchlib/src/vespa/searchlib/diskindex/bitvectorkeyscope.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/bitvectorkeyscope.cpp @@ -1,17 +1,12 @@ // 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 "bitvectorkeyscope.h" #include <vespa/vespalib/objects/nbostream.h> - +#include <cassert> using search::diskindex::BitVectorKeyScope; -namespace search -{ - -namespace diskindex -{ +namespace search::diskindex { const char *getBitVectorKeyScopeSuffix(BitVectorKeyScope scope) { @@ -25,8 +20,6 @@ const char *getBitVectorKeyScopeSuffix(BitVectorKeyScope scope) } -} - namespace { @@ -48,8 +41,7 @@ const BitVectorKeyScope scopes[] = { BitVectorKeyScope::SHARED_WORDS, } -namespace vespalib -{ +namespace vespalib { nbostream & operator<<(nbostream &stream, const BitVectorKeyScope &scope) diff --git a/searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.cpp b/searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.cpp index e38ce766b24..e990b57a601 100644 --- a/searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.cpp @@ -1,18 +1,14 @@ // 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 "dictionarywordreader.h" #include <vespa/searchlib/index/schemautil.h> #include <vespa/searchlib/index/olddictionaryfile.h> #include <vespa/vespalib/util/error.h> + +#include <vespa/log/log.h> LOG_SETUP(".diskindex.dictionarywordreader"); -namespace search -{ - -namespace diskindex -{ +namespace search::diskindex { using vespalib::getLastErrorString; using index::SchemaUtil; @@ -65,7 +61,4 @@ DictionaryWordReader::close() _old2newwordfile->Close(); } - -} // namespace diskindex - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp index 10849b4b70a..14b843b33f0 100644 --- a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp @@ -1,9 +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/log/log.h> -LOG_SETUP(".diskindex.disktermblueprint"); - #include "disktermblueprint.h" #include <vespa/searchlib/common/bitvectoriterator.h> #include <vespa/searchlib/queryeval/booleanmatchiteratorwrapper.h> @@ -11,6 +7,9 @@ LOG_SETUP(".diskindex.disktermblueprint"); #include <vespa/searchlib/queryeval/equiv_blueprint.h> #include <vespa/vespalib/util/stringfmt.h> +#include <vespa/log/log.h> +LOG_SETUP(".diskindex.disktermblueprint"); + using search::BitVectorIterator; using search::fef::TermFieldMatchDataArray; using search::index::Schema; diff --git a/searchlib/src/vespa/searchlib/diskindex/docidmapper.cpp b/searchlib/src/vespa/searchlib/diskindex/docidmapper.cpp index 4f5328d8190..4d4d2e5ce03 100644 --- a/searchlib/src/vespa/searchlib/diskindex/docidmapper.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/docidmapper.cpp @@ -1,22 +1,14 @@ // 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> -LOG_SETUP(".diskindex.docidmapper"); +#include "docidmapper.h" #include <vespa/vespalib/objects/nbostream.h> #include <vespa/searchlib/common/documentsummary.h> #include <vespa/searchlib/common/bitvector.h> #include <vespa/fastlib/io/bufferedfile.h> -#include "docidmapper.h" #define NO_DOC static_cast<uint32_t>(-1) -namespace search -{ - -namespace diskindex -{ - +namespace search::diskindex { DocIdMapping::DocIdMapping() : _docIdLimit(0u), @@ -68,6 +60,4 @@ DocIdMapping::readDocIdLimit(const vespalib::string &mergedDir) -} // namespace diskindex - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/diskindex/extposocc.cpp b/searchlib/src/vespa/searchlib/diskindex/extposocc.cpp index 9eaac550192..219a8929382 100644 --- a/searchlib/src/vespa/searchlib/diskindex/extposocc.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/extposocc.cpp @@ -2,18 +2,17 @@ // Copyright (C) 2002-2003 Fast Search & Transfer ASA // Copyright (C) 2003 Overture Services Norway AS -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> #include "extposocc.h" -#include <vespa/vespalib/objects/nbostream.h> +#include "zcposocc.h" +#include "fileheader.h" #include <vespa/searchlib/index/postinglistcounts.h> #include <vespa/searchlib/index/docidandfeatures.h> #include <vespa/searchlib/index/postinglistcounts.h> #include <vespa/searchlib/index/postinglistcountfile.h> -#include "zcposocc.h" -#include "fileheader.h" +#include <vespa/vespalib/objects/nbostream.h> +#include <vespa/log/log.h> LOG_SETUP(".diskindex.extposocc"); using search::index::PostingListFileSeqRead; diff --git a/searchlib/src/vespa/searchlib/diskindex/fieldreader.cpp b/searchlib/src/vespa/searchlib/diskindex/fieldreader.cpp index 13a79e05334..39d95f66a7a 100644 --- a/searchlib/src/vespa/searchlib/diskindex/fieldreader.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/fieldreader.cpp @@ -1,19 +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/log/log.h> -#include <vespa/vespalib/objects/nbostream.h> #include "fieldreader.h" #include "zcposocc.h" #include "extposocc.h" -#include <vespa/vespalib/util/error.h> #include "pagedict4file.h" +#include <vespa/vespalib/util/error.h> +#include <vespa/vespalib/objects/nbostream.h> + +#include <vespa/log/log.h> LOG_SETUP(".diskindex.fieldreader"); #define NO_DOC static_cast<uint32_t>(-1) -namespace -{ +namespace { vespalib::string PosOccIdCooked = "PosOcc.3.Cooked"; @@ -25,12 +24,7 @@ using search::index::SchemaUtil; using search::bitcompression::PosOccFieldParams; using search::bitcompression::PosOccFieldsParams; -namespace search -{ - -namespace diskindex -{ - +namespace search::diskindex { FieldReader::FieldReader() : _wordNum(noWordNumHigh()), @@ -379,7 +373,4 @@ FieldReaderStripInfo::getFeatureParams(PostingListParams ¶ms) params.erase("encoding"); } - -} // namespace diskindex - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/diskindex/fieldwriter.cpp b/searchlib/src/vespa/searchlib/diskindex/fieldwriter.cpp index e21f932ec3d..306d4d0b9b6 100644 --- a/searchlib/src/vespa/searchlib/diskindex/fieldwriter.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/fieldwriter.cpp @@ -1,20 +1,16 @@ // 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 <vespa/vespalib/objects/nbostream.h> #include "fieldwriter.h" #include "zcposocc.h" #include "extposocc.h" -#include <vespa/vespalib/util/error.h> #include "pagedict4file.h" -LOG_SETUP(".diskindex.fieldwriter"); +#include <vespa/vespalib/util/error.h> +#include <vespa/vespalib/objects/nbostream.h> +#include <vespa/log/log.h> -namespace search -{ +LOG_SETUP(".diskindex.fieldwriter"); -namespace diskindex -{ +namespace search::diskindex { using vespalib::nbostream; using vespalib::getLastErrorString; @@ -253,7 +249,4 @@ FieldWriter::remove(const vespalib::string &prefix) } } - -} // namespace diskindex - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/diskindex/fileheader.cpp b/searchlib/src/vespa/searchlib/diskindex/fileheader.cpp index 628ff3e9176..6524710a35d 100644 --- a/searchlib/src/vespa/searchlib/diskindex/fileheader.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/fileheader.cpp @@ -1,19 +1,15 @@ // 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 "fileheader.h" #include <vespa/searchlib/bitcompression/compression.h> #include <vespa/vespalib/stllike/asciistream.h> #include <vespa/vespalib/data/fileheader.h> +#include <vespa/fastos/file.h> +#include <vespa/log/log.h> LOG_SETUP(".diskindex.fileheader"); -namespace search -{ - -namespace diskindex -{ +namespace search::diskindex { using bitcompression::FeatureDecodeContextBE; @@ -158,8 +154,4 @@ FileHeader::taste(const vespalib::string &name, return taste(name, tuneFileRead); } - -} // namespace diskindex - -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp b/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp index 8ee5eba3c8c..c3bb41e49e3 100644 --- a/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp @@ -1,17 +1,16 @@ // 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> -LOG_SETUP(".diskindex.pagedict4file"); #include "pagedict4file.h" +#include <vespa/searchlib/common/fileheadercontext.h> #include <vespa/vespalib/stllike/asciistream.h> #include <vespa/vespalib/data/fileheader.h> -#include <vespa/searchlib/common/fileheadercontext.h> #include <vespa/vespalib/objects/nbostream.h> #include <vespa/vespalib/io/fileutil.h> -namespace -{ +#include <vespa/log/log.h> +LOG_SETUP(".diskindex.pagedict4file"); + +namespace { vespalib::string myPId("PageDict4P.1"); vespalib::string mySPId("PageDict4SP.1"); @@ -35,14 +34,9 @@ using search::common::FileHeaderContext; using search::index::PostingListParams; using vespalib::getLastErrorString; -namespace search -{ +namespace search::diskindex { -namespace diskindex -{ - -namespace -{ +namespace { const uint32_t headerAlign = 4096; @@ -747,6 +741,4 @@ PageDict4FileSeqWrite::getParams(PostingListParams ¶ms) params.set("numWordIds", _sse._numWordIds); } -} // namespace diskindex - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/diskindex/pagedict4file.h b/searchlib/src/vespa/searchlib/diskindex/pagedict4file.h index efd5a787071..574269c51c5 100644 --- a/searchlib/src/vespa/searchlib/diskindex/pagedict4file.h +++ b/searchlib/src/vespa/searchlib/diskindex/pagedict4file.h @@ -5,19 +5,11 @@ #include <vespa/searchlib/bitcompression/compression.h> #include <vespa/searchlib/bitcompression/countcompression.h> #include <vespa/searchlib/bitcompression/pagedict4.h> +#include <vespa/fastos/file.h> -namespace vespalib -{ - -class GenericHeader; - -} +namespace vespalib { class GenericHeader; } -namespace search -{ - -namespace diskindex -{ +namespace search::diskindex { /** * Dictionary file containing words and counts for words. @@ -232,8 +224,4 @@ public: getParams(index::PostingListParams ¶ms) override; }; - -} // namespace diskindex - -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/diskindex/wordnummapper.cpp b/searchlib/src/vespa/searchlib/diskindex/wordnummapper.cpp index ba943e983f5..bd46caf88b5 100644 --- a/searchlib/src/vespa/searchlib/diskindex/wordnummapper.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/wordnummapper.cpp @@ -1,17 +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/log/log.h> -LOG_SETUP(".diskindex.wordnummapper"); +#include "wordnummapper.h" #include <vespa/vespalib/objects/nbostream.h> #include <vespa/fastlib/io/bufferedfile.h> -#include "wordnummapper.h" - -namespace search -{ -namespace diskindex -{ +namespace search::diskindex { WordNumMapping::WordNumMapping() : _old2newwords(), @@ -104,7 +97,4 @@ WordNumMapping::sanityCheck(bool allowHoles) mapper.sanityCheck(allowHoles); } - -} // namespace diskindex - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/diskindex/wordnummapper.h b/searchlib/src/vespa/searchlib/diskindex/wordnummapper.h index 1a7666f0049..a45f5dc64ed 100644 --- a/searchlib/src/vespa/searchlib/diskindex/wordnummapper.h +++ b/searchlib/src/vespa/searchlib/diskindex/wordnummapper.h @@ -1,14 +1,11 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/vespalib/util/array.h> #include <vespa/searchlib/common/tunefileinfo.h> +#include <vespa/vespalib/util/array.h> +#include <vespa/vespalib/stllike/string.h> -namespace search -{ - -namespace diskindex -{ +namespace search::diskindex { class WordNumMapper; @@ -16,17 +13,11 @@ class WordNumMapping { typedef vespalib::Array<uint64_t> Array; - static uint64_t - noWordNumHigh() - { + static uint64_t noWordNumHigh() { return std::numeric_limits<uint64_t>::max(); } - static uint64_t - noWordNum() - { - return 0u; - } + static uint64_t noWordNum() { return 0u; } Array _old2newwords; uint64_t _oldDictSize; @@ -34,54 +25,29 @@ public: WordNumMapping(); - const uint64_t * - getOld2NewWordNums() const - { + const uint64_t *getOld2NewWordNums() const { return (_old2newwords.empty()) ? NULL : &_old2newwords[0]; } - uint64_t - getOldDictSize() const - { - return _oldDictSize; - } - - void - readMappingFile(const vespalib::string &name, - const TuneFileSeqRead &tuneFileRead); - - void - noMappingFile(); - - void - clear(); - - void - setup(uint32_t numWordIds); - - uint64_t - getMaxMappedWordNum() const; - - void - sanityCheck(bool allowHoles); + uint64_t getOldDictSize() const { return _oldDictSize; } + void readMappingFile(const vespalib::string &name, const TuneFileSeqRead &tuneFileRead); + void noMappingFile(); + void clear(); + void setup(uint32_t numWordIds); + uint64_t getMaxMappedWordNum() const; + void sanityCheck(bool allowHoles); }; class WordNumMapper { - static uint64_t - noWordNumHigh() - { + static uint64_t noWordNumHigh() { return std::numeric_limits<uint64_t>::max(); } - static uint64_t - noWordNum() - { - return 0u; - } + static uint64_t noWordNum() { return 0u; } const uint64_t *_old2newwords; uint64_t _oldDictSize; @@ -90,8 +56,7 @@ public: WordNumMapper() : _old2newwords(NULL), _oldDictSize(0) - { - } + {} WordNumMapper(const WordNumMapping &mapping) : _old2newwords(NULL), @@ -100,38 +65,20 @@ public: setup(mapping); } - void - setup(const WordNumMapping &mapping) - { + void setup(const WordNumMapping &mapping) { _old2newwords = mapping.getOld2NewWordNums(); _oldDictSize = mapping.getOldDictSize(); } - uint64_t - map(uint32_t wordNum) const - { + uint64_t map(uint32_t wordNum) const { return (_old2newwords != NULL) ? _old2newwords[wordNum] : wordNum; } - uint64_t - getMaxWordNum() const - { - return _oldDictSize; - } - - uint64_t - getMaxMappedWordNum() const - { - return map(_oldDictSize); - } - - void - sanityCheck(bool allowHoles); + uint64_t getMaxWordNum() const { return _oldDictSize; } + uint64_t getMaxMappedWordNum() const { return map(_oldDictSize); } + void sanityCheck(bool allowHoles); }; -} // namespace diskindex - -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/diskindex/zcposocc.cpp b/searchlib/src/vespa/searchlib/diskindex/zcposocc.cpp index 24f6260c525..18e34b8ef74 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcposocc.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/zcposocc.cpp @@ -1,20 +1,13 @@ // 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 "zcposocc.h" #include <vespa/searchlib/index/postinglistcounts.h> #include <vespa/searchlib/index/postinglistcountfile.h> #include <vespa/searchlib/index/postinglistfile.h> #include <vespa/searchlib/index/docidandfeatures.h> -LOG_SETUP(".diskindex.zcposocc"); -namespace search -{ - -namespace diskindex -{ +namespace search::diskindex { using search::bitcompression::PosOccFieldsParams; using search::bitcompression::EG2PosOccDecodeContext; @@ -131,7 +124,4 @@ ZcPosOccSeqWrite::ZcPosOccSeqWrite(const Schema &schema, _fieldsParams.setSchemaParams(schema, indexId); } - -} // namespace diskindex - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/diskindex/zcposocciterators.cpp b/searchlib/src/vespa/searchlib/diskindex/zcposocciterators.cpp index fdb498e8e28..b1f73dc2088 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcposocciterators.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/zcposocciterators.cpp @@ -1,15 +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/log/log.h> -LOG_SETUP(".diskindex.zcposocciterators"); #include "zcposocciterators.h" -namespace search -{ - -namespace diskindex -{ +namespace search::diskindex { using search::fef::TermFieldMatchDataArray; using search::bitcompression::PosOccFieldsParams; @@ -26,7 +19,7 @@ Zc4RareWordPosOccIterator(Position start, uint64_t bitLength, uint32_t docIdLimi : Zc4RareWordPostingIterator<bigEndian>(matchData, start, docIdLimit), _decodeContextReal(start.getOccurences(), start.getBitOffset(), bitLength, fieldsParams) { - LOG_ASSERT(!matchData.valid() || (fieldsParams->getNumFields() == matchData.size())); + assert(!matchData.valid() || (fieldsParams->getNumFields() == matchData.size())); _decodeContext = &_decodeContextReal; } @@ -40,7 +33,7 @@ Zc4PosOccIterator(Position start, uint64_t bitLength, uint32_t docIdLimit, : ZcPostingIterator<bigEndian>(minChunkDocs, false, counts, matchData, start, docIdLimit), _decodeContextReal(start.getOccurences(), start.getBitOffset(), bitLength, fieldsParams) { - LOG_ASSERT(!matchData.valid() || (fieldsParams->getNumFields() == matchData.size())); + assert(!matchData.valid() || (fieldsParams->getNumFields() == matchData.size())); _decodeContext = &_decodeContextReal; } @@ -53,7 +46,7 @@ ZcRareWordPosOccIterator(Position start, uint64_t bitLength, uint32_t docIdLimit : ZcRareWordPostingIterator<bigEndian>(matchData, start, docIdLimit), _decodeContextReal(start.getOccurences(), start.getBitOffset(), bitLength, fieldsParams) { - LOG_ASSERT(!matchData.valid() || (fieldsParams->getNumFields() == matchData.size())); + assert(!matchData.valid() || (fieldsParams->getNumFields() == matchData.size())); _decodeContext = &_decodeContextReal; } @@ -67,7 +60,7 @@ ZcPosOccIterator(Position start, uint64_t bitLength, uint32_t docIdLimit, : ZcPostingIterator<bigEndian>(minChunkDocs, true, counts, matchData, start, docIdLimit), _decodeContextReal(start.getOccurences(), start.getBitOffset(), bitLength, fieldsParams) { - LOG_ASSERT(!matchData.valid() || (fieldsParams->getNumFields() == matchData.size())); + assert(!matchData.valid() || (fieldsParams->getNumFields() == matchData.size())); _decodeContext = &_decodeContextReal; } @@ -84,6 +77,4 @@ template class ZcRareWordPosOccIterator<false>; template class ZcPosOccIterator<true>; template class ZcPosOccIterator<false>; -} // namespace diskindex - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/diskindex/zcposting.cpp b/searchlib/src/vespa/searchlib/diskindex/zcposting.cpp index cc193b69ca7..a1b305f43dc 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcposting.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/zcposting.cpp @@ -1,20 +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/log/log.h> #include "zcposting.h" #include <vespa/searchlib/index/postinglistcounts.h> #include <vespa/searchlib/index/postinglistcountfile.h> #include <vespa/searchlib/index/postinglistfile.h> #include <vespa/searchlib/index/docidandfeatures.h> +#include <vespa/searchlib/common/fileheadercontext.h> #include <vespa/vespalib/objects/nbostream.h> #include <vespa/vespalib/data/fileheader.h> -#include <vespa/searchlib/common/fileheadercontext.h> +#include <vespa/log/log.h> LOG_SETUP(".diskindex.zcposting"); -namespace -{ +namespace { vespalib::string myId5("Zc.5"); vespalib::string myId4("Zc.4"); @@ -22,11 +20,7 @@ vespalib::string emptyId; } -namespace search -{ - -namespace diskindex -{ +namespace search::diskindex { using index::PostingListCountFileSeqRead; using index::PostingListCountFileSeqWrite; @@ -1427,10 +1421,7 @@ ZcPostingSeqWrite::flushWordNoSkip() resetWord(); } - -} // namespace diskindex - -} // namespace search +} // namespace search::diskindex #include <vespa/vespalib/objects/nbostream.hpp> namespace vespalib { diff --git a/searchlib/src/vespa/searchlib/diskindex/zcposting.h b/searchlib/src/vespa/searchlib/diskindex/zcposting.h index 1568302cd2e..4f6591388e0 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcposting.h +++ b/searchlib/src/vespa/searchlib/diskindex/zcposting.h @@ -2,9 +2,10 @@ #pragma once +#include "zcbuf.h" #include <vespa/searchlib/index/postinglistfile.h> #include <vespa/searchlib/bitcompression/compression.h> -#include "zcbuf.h" +#include <vespa/fastos/file.h> namespace search { diff --git a/searchlib/src/vespa/searchlib/docstore/bytecomplens.cpp b/searchlib/src/vespa/searchlib/docstore/bytecomplens.cpp index 1a2b8f090e1..fb65f1343b4 100644 --- a/searchlib/src/vespa/searchlib/docstore/bytecomplens.cpp +++ b/searchlib/src/vespa/searchlib/docstore/bytecomplens.cpp @@ -1,9 +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 "bytecomplens.h" + #include <vespa/log/log.h> LOG_SETUP(".search.docstore"); -#include "bytecomplens.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/docstore/chunkformat.cpp b/searchlib/src/vespa/searchlib/docstore/chunkformat.cpp index 1b243e1546e..cd44d34ea22 100644 --- a/searchlib/src/vespa/searchlib/docstore/chunkformat.cpp +++ b/searchlib/src/vespa/searchlib/docstore/chunkformat.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/docstore/chunkformats.h> +#include "chunkformats.h" #include <vespa/document/util/compressor.h> namespace search { diff --git a/searchlib/src/vespa/searchlib/docstore/chunkformats.cpp b/searchlib/src/vespa/searchlib/docstore/chunkformats.cpp index bdff46aacbc..c715f8a2129 100644 --- a/searchlib/src/vespa/searchlib/docstore/chunkformats.cpp +++ b/searchlib/src/vespa/searchlib/docstore/chunkformats.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/docstore/chunkformats.h> +#include "chunkformats.h" #include <vespa/vespalib/util/crc.h> #include <vespa/vespalib/xxhash/xxhash.h> diff --git a/searchlib/src/vespa/searchlib/docstore/data_store_file_chunk_id.cpp b/searchlib/src/vespa/searchlib/docstore/data_store_file_chunk_id.cpp index 50177e5af31..3a1c0d55d18 100644 --- a/searchlib/src/vespa/searchlib/docstore/data_store_file_chunk_id.cpp +++ b/searchlib/src/vespa/searchlib/docstore/data_store_file_chunk_id.cpp @@ -1,11 +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 "data_store_file_chunk_id.h" #include "filechunk.h" -namespace search -{ +namespace search { vespalib::string DataStoreFileChunkId::createName(const vespalib::string &baseName) const diff --git a/searchlib/src/vespa/searchlib/docstore/document_store_visitor_progress.cpp b/searchlib/src/vespa/searchlib/docstore/document_store_visitor_progress.cpp index cca794ccb69..adde03d8ff0 100644 --- a/searchlib/src/vespa/searchlib/docstore/document_store_visitor_progress.cpp +++ b/searchlib/src/vespa/searchlib/docstore/document_store_visitor_progress.cpp @@ -1,11 +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 "document_store_visitor_progress.h" -namespace search -{ - +namespace search { DocumentStoreVisitorProgress::DocumentStoreVisitorProgress() : search::IDocumentStoreVisitorProgress(), @@ -13,19 +10,16 @@ DocumentStoreVisitorProgress::DocumentStoreVisitorProgress() { } - void DocumentStoreVisitorProgress::updateProgress(double progress) { _progress = progress; } - double DocumentStoreVisitorProgress::getProgress() const { return _progress; } - -} // namespace proton +} diff --git a/searchlib/src/vespa/searchlib/docstore/idatastore.cpp b/searchlib/src/vespa/searchlib/docstore/idatastore.cpp index fc66870daaa..b6b97d95666 100644 --- a/searchlib/src/vespa/searchlib/docstore/idatastore.cpp +++ b/searchlib/src/vespa/searchlib/docstore/idatastore.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 "idatastore.h" namespace search { @@ -15,5 +14,4 @@ IDataStore::~IDataStore() { } - } // namespace search diff --git a/searchlib/src/vespa/searchlib/docstore/idocumentstore.cpp b/searchlib/src/vespa/searchlib/docstore/idocumentstore.cpp index c72da449734..91c3fce3161 100644 --- a/searchlib/src/vespa/searchlib/docstore/idocumentstore.cpp +++ b/searchlib/src/vespa/searchlib/docstore/idocumentstore.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 "idocumentstore.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/docstore/logdocumentstore.cpp b/searchlib/src/vespa/searchlib/docstore/logdocumentstore.cpp index 348d40b37f5..1be982c7310 100644 --- a/searchlib/src/vespa/searchlib/docstore/logdocumentstore.cpp +++ b/searchlib/src/vespa/searchlib/docstore/logdocumentstore.cpp @@ -1,10 +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 "logdocumentstore.h" -namespace search -{ +namespace search { using vespalib::nbostream; using common::FileHeaderContext; diff --git a/searchlib/src/vespa/searchlib/engine/create-class-cpp.sh b/searchlib/src/vespa/searchlib/engine/create-class-cpp.sh index 1f638bf0cb6..8c17349d2b0 100755 --- a/searchlib/src/vespa/searchlib/engine/create-class-cpp.sh +++ b/searchlib/src/vespa/searchlib/engine/create-class-cpp.sh @@ -8,13 +8,9 @@ name=`echo $class | tr 'A-Z' 'a-z'` cat <<EOF // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/log/log.h> -LOG_SETUP(".engine.$name"); -#include <vespa/fastos/fastos.h> #include "$name.h" -namespace search { -namespace engine { +namespace search::engine { $class::$class() { @@ -24,6 +20,5 @@ $class::~$class() { } -} // namespace engine -} // namespace search +} // namespace search::engine EOF diff --git a/searchlib/src/vespa/searchlib/expression/arrayoperationnode.cpp b/searchlib/src/vespa/searchlib/expression/arrayoperationnode.cpp index eccc1dfe02f..ce6259177b6 100644 --- a/searchlib/src/vespa/searchlib/expression/arrayoperationnode.cpp +++ b/searchlib/src/vespa/searchlib/expression/arrayoperationnode.cpp @@ -1,5 +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 "arrayoperationnode.h" #include <vespa/vespalib/util/stringfmt.h> diff --git a/searchlib/src/vespa/searchlib/expression/bucketresultnode.cpp b/searchlib/src/vespa/searchlib/expression/bucketresultnode.cpp index e82cef0563a..54961c4fa14 100644 --- a/searchlib/src/vespa/searchlib/expression/bucketresultnode.cpp +++ b/searchlib/src/vespa/searchlib/expression/bucketresultnode.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 "bucketresultnode.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/expression/catserializer.cpp b/searchlib/src/vespa/searchlib/expression/catserializer.cpp index 7761bd83f9c..7df3e9f8297 100644 --- a/searchlib/src/vespa/searchlib/expression/catserializer.cpp +++ b/searchlib/src/vespa/searchlib/expression/catserializer.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 "catserializer.h" #include "rawresultnode.h" #include "resultvector.h" diff --git a/searchlib/src/vespa/searchlib/expression/debugwaitfunctionnode.cpp b/searchlib/src/vespa/searchlib/expression/debugwaitfunctionnode.cpp index 506a8983994..d0dd57e9218 100644 --- a/searchlib/src/vespa/searchlib/expression/debugwaitfunctionnode.cpp +++ b/searchlib/src/vespa/searchlib/expression/debugwaitfunctionnode.cpp @@ -1,6 +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 <vespa/searchlib/expression/debugwaitfunctionnode.h> +#include "debugwaitfunctionnode.h" +#include <vespa/fastos/time.h> +#include <thread> namespace search { namespace expression { @@ -40,7 +41,7 @@ DebugWaitFunctionNode::onExecute() const ; } else { int rem = (int)(millis - time.MilliSecsToNow()); - FastOS_Thread::Sleep(rem); + std::this_thread::sleep_for(std::chrono::milliseconds(rem)); } } getArg().execute(); diff --git a/searchlib/src/vespa/searchlib/expression/fixedwidthbucketfunctionnode.cpp b/searchlib/src/vespa/searchlib/expression/fixedwidthbucketfunctionnode.cpp index c4f2f725271..a08f9653da0 100644 --- a/searchlib/src/vespa/searchlib/expression/fixedwidthbucketfunctionnode.cpp +++ b/searchlib/src/vespa/searchlib/expression/fixedwidthbucketfunctionnode.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 "fixedwidthbucketfunctionnode.h" #include "integerresultnode.h" #include "floatresultnode.h" diff --git a/searchlib/src/vespa/searchlib/expression/floatbucketresultnode.cpp b/searchlib/src/vespa/searchlib/expression/floatbucketresultnode.cpp index 950c5f5a259..e3d0d2da2d4 100644 --- a/searchlib/src/vespa/searchlib/expression/floatbucketresultnode.cpp +++ b/searchlib/src/vespa/searchlib/expression/floatbucketresultnode.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 "floatbucketresultnode.h" #include <vespa/vespalib/objects/visit.h> #include <cmath> diff --git a/searchlib/src/vespa/searchlib/expression/integerbucketresultnode.cpp b/searchlib/src/vespa/searchlib/expression/integerbucketresultnode.cpp index f821026a679..d1e709b426f 100644 --- a/searchlib/src/vespa/searchlib/expression/integerbucketresultnode.cpp +++ b/searchlib/src/vespa/searchlib/expression/integerbucketresultnode.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 "integerbucketresultnode.h" #include <vespa/vespalib/objects/visit.h> diff --git a/searchlib/src/vespa/searchlib/expression/interpolatedlookupfunctionnode.cpp b/searchlib/src/vespa/searchlib/expression/interpolatedlookupfunctionnode.cpp index d135be103e6..84f146c9014 100644 --- a/searchlib/src/vespa/searchlib/expression/interpolatedlookupfunctionnode.cpp +++ b/searchlib/src/vespa/searchlib/expression/interpolatedlookupfunctionnode.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/interpolatedlookupfunctionnode.h> -#include <vespa/searchlib/expression/floatresultnode.h> +#include "interpolatedlookupfunctionnode.h" +#include "floatresultnode.h" #include <vespa/searchcommon/attribute/iattributecontext.h> #include <vespa/searchlib/common/converters.h> #include <vespa/vespalib/util/stringfmt.h> diff --git a/searchlib/src/vespa/searchlib/expression/mathfunctionnode.cpp b/searchlib/src/vespa/searchlib/expression/mathfunctionnode.cpp index 14cdb627f58..36649c461b4 100644 --- a/searchlib/src/vespa/searchlib/expression/mathfunctionnode.cpp +++ b/searchlib/src/vespa/searchlib/expression/mathfunctionnode.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/mathfunctionnode.h> -#include <vespa/searchlib/expression/floatresultnode.h> +#include "mathfunctionnode.h" +#include "floatresultnode.h" #include <cmath> namespace search { diff --git a/searchlib/src/vespa/searchlib/expression/rawbucketresultnode.cpp b/searchlib/src/vespa/searchlib/expression/rawbucketresultnode.cpp index 344903e5820..f65d1e6d9b6 100644 --- a/searchlib/src/vespa/searchlib/expression/rawbucketresultnode.cpp +++ b/searchlib/src/vespa/searchlib/expression/rawbucketresultnode.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 "rawbucketresultnode.h" #include <vespa/vespalib/objects/visit.hpp> diff --git a/searchlib/src/vespa/searchlib/expression/resultnode.cpp b/searchlib/src/vespa/searchlib/expression/resultnode.cpp index 387b05e7add..3306068efdf 100644 --- a/searchlib/src/vespa/searchlib/expression/resultnode.cpp +++ b/searchlib/src/vespa/searchlib/expression/resultnode.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 <vespa/searchlib/expression/resultnode.h> +#include "resultnode.h" #include <stdexcept> namespace search { diff --git a/searchlib/src/vespa/searchlib/expression/resultvector.cpp b/searchlib/src/vespa/searchlib/expression/resultvector.cpp index 169b4ea6159..991cff9997c 100644 --- a/searchlib/src/vespa/searchlib/expression/resultvector.cpp +++ b/searchlib/src/vespa/searchlib/expression/resultvector.cpp @@ -1,6 +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/resultvector.h> + +#include "resultvector.h" namespace search { namespace expression { diff --git a/searchlib/src/vespa/searchlib/expression/stringbucketresultnode.cpp b/searchlib/src/vespa/searchlib/expression/stringbucketresultnode.cpp index de7ef05f31c..f53d1bbce07 100644 --- a/searchlib/src/vespa/searchlib/expression/stringbucketresultnode.cpp +++ b/searchlib/src/vespa/searchlib/expression/stringbucketresultnode.cpp @@ -1,5 +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 "stringbucketresultnode.h" #include <vespa/vespalib/objects/visit.hpp> diff --git a/searchlib/src/vespa/searchlib/features/agefeature.cpp b/searchlib/src/vespa/searchlib/features/agefeature.cpp index 6621f9225cb..d46279bbd30 100644 --- a/searchlib/src/vespa/searchlib/features/agefeature.cpp +++ b/searchlib/src/vespa/searchlib/features/agefeature.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> -LOG_SETUP(".features.agefeature"); -#include <vespa/searchlib/fef/featurenamebuilder.h> -#include <vespa/searchlib/fef/matchdata.h> #include "agefeature.h" #include "valuefeature.h" +#include <vespa/searchlib/fef/featurenamebuilder.h> +#include <vespa/searchlib/fef/matchdata.h> using search::attribute::IAttributeVector; diff --git a/searchlib/src/vespa/searchlib/features/array_parser.cpp b/searchlib/src/vespa/searchlib/features/array_parser.cpp index 0faac986033..fba9d04e19b 100644 --- a/searchlib/src/vespa/searchlib/features/array_parser.cpp +++ b/searchlib/src/vespa/searchlib/features/array_parser.cpp @@ -1,11 +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 "array_parser.h" + #include <vespa/log/log.h> LOG_SETUP(".features.array_parser"); -#include "array_parser.h" - namespace search { namespace features { diff --git a/searchlib/src/vespa/searchlib/features/attributematchfeature.cpp b/searchlib/src/vespa/searchlib/features/attributematchfeature.cpp index 7622f0765ff..98cf4a35764 100644 --- a/searchlib/src/vespa/searchlib/features/attributematchfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/attributematchfeature.cpp @@ -1,16 +1,15 @@ // 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> -LOG_SETUP(".features.attributematchfeature"); - -#include <vespa/searchcommon/attribute/attributecontent.h> -#include <vespa/searchlib/fef/featurenamebuilder.h> -#include <vespa/searchlib/fef/fieldinfo.h> -#include <vespa/searchlib/fef/properties.h> #include "attributematchfeature.h" #include "utils.h" #include "valuefeature.h" +#include <vespa/searchlib/fef/featurenamebuilder.h> +#include <vespa/searchlib/fef/fieldinfo.h> +#include <vespa/searchlib/fef/properties.h> +#include <vespa/searchcommon/attribute/attributecontent.h> + +#include <vespa/log/log.h> +LOG_SETUP(".features.attributematchfeature"); using namespace search::attribute; using namespace search::fef; diff --git a/searchlib/src/vespa/searchlib/features/closenessfeature.cpp b/searchlib/src/vespa/searchlib/features/closenessfeature.cpp index eb1a5c646c0..03c4ad1c3f5 100644 --- a/searchlib/src/vespa/searchlib/features/closenessfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/closenessfeature.cpp @@ -1,11 +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/log/log.h> -LOG_SETUP(".features.closenessfeature"); -#include <vespa/searchlib/fef/properties.h> #include "closenessfeature.h" #include "utils.h" +#include <vespa/searchlib/fef/properties.h> + +#include <vespa/log/log.h> +LOG_SETUP(".features.closenessfeature"); using namespace search::fef; diff --git a/searchlib/src/vespa/searchlib/features/constant_feature.cpp b/searchlib/src/vespa/searchlib/features/constant_feature.cpp index 54fc40b0019..fda0215dff0 100644 --- a/searchlib/src/vespa/searchlib/features/constant_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/constant_feature.cpp @@ -1,14 +1,13 @@ // 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> -LOG_SETUP(".features.constant_feature"); #include "constant_feature.h" - -#include <vespa/searchlib/fef/featureexecutor.h> #include "valuefeature.h" +#include <vespa/searchlib/fef/featureexecutor.h> #include <vespa/eval/eval/value_cache/constant_value.h> +#include <vespa/log/log.h> +LOG_SETUP(".features.constant_feature"); + using namespace search::fef; namespace search { diff --git a/searchlib/src/vespa/searchlib/features/create-class-cpp.sh b/searchlib/src/vespa/searchlib/features/create-class-cpp.sh index 6ec335ffa3d..abc25ab99d4 100755 --- a/searchlib/src/vespa/searchlib/features/create-class-cpp.sh +++ b/searchlib/src/vespa/searchlib/features/create-class-cpp.sh @@ -6,15 +6,11 @@ guard=`echo $class | tr 'a-z' 'A-Z'` name=`echo $class | tr 'A-Z' 'a-z'` cat <<EOF -// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright 2017 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/log/log.h> -LOG_SETUP(".$name"); -#include <vespa/fastos/fastos.h> #include "$name.h" -namespace search { -namespace features { +namespace search::features { $class::$class() { @@ -24,6 +20,5 @@ $class::~$class() { } -} // namespace features -} // namespace search +} EOF diff --git a/searchlib/src/vespa/searchlib/features/debug_attribute_wait.cpp b/searchlib/src/vespa/searchlib/features/debug_attribute_wait.cpp index 615fd06c987..19814760fc6 100644 --- a/searchlib/src/vespa/searchlib/features/debug_attribute_wait.cpp +++ b/searchlib/src/vespa/searchlib/features/debug_attribute_wait.cpp @@ -1,9 +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 <vespa/log/log.h> -LOG_SETUP(".features.debug_wait"); #include "debug_attribute_wait.h" +#include <thread> using search::attribute::IAttributeVector; @@ -58,7 +56,7 @@ DebugAttributeWaitExecutor::execute(uint32_t docId) ; } else { int rem = (int)(millis - time.MilliSecsToNow()); - FastOS_Thread::Sleep(rem); + std::this_thread::sleep_for(std::chrono::milliseconds(rem)); } } outputs().set_number(0, 1.0e-6 * time.MicroSecsToNow()); diff --git a/searchlib/src/vespa/searchlib/features/debug_wait.cpp b/searchlib/src/vespa/searchlib/features/debug_wait.cpp index 395a4c11d61..b9896b22946 100644 --- a/searchlib/src/vespa/searchlib/features/debug_wait.cpp +++ b/searchlib/src/vespa/searchlib/features/debug_wait.cpp @@ -1,9 +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 <vespa/log/log.h> -LOG_SETUP(".features.debug_wait"); #include "debug_wait.h" +#include <thread> namespace search { @@ -42,7 +40,7 @@ DebugWaitExecutor::execute(uint32_t) ; } else { int rem = (int)(millis - time.MilliSecsToNow()); - FastOS_Thread::Sleep(rem); + std::this_thread::sleep_for(std::chrono::milliseconds(rem)); } } outputs().set_number(0, 1.0e-6 * time.MicroSecsToNow()); diff --git a/searchlib/src/vespa/searchlib/features/dense_tensor_attribute_executor.cpp b/searchlib/src/vespa/searchlib/features/dense_tensor_attribute_executor.cpp index e7515727b23..30ca8af45bc 100644 --- a/searchlib/src/vespa/searchlib/features/dense_tensor_attribute_executor.cpp +++ b/searchlib/src/vespa/searchlib/features/dense_tensor_attribute_executor.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 "dense_tensor_attribute_executor.h" #include <vespa/searchlib/tensor/dense_tensor_attribute.h> diff --git a/searchlib/src/vespa/searchlib/features/distancefeature.cpp b/searchlib/src/vespa/searchlib/features/distancefeature.cpp index d38e19e93d2..50ad687adc1 100644 --- a/searchlib/src/vespa/searchlib/features/distancefeature.cpp +++ b/searchlib/src/vespa/searchlib/features/distancefeature.cpp @@ -1,15 +1,15 @@ // 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> -LOG_SETUP(".features.distancefeature"); -#include <cmath> -#include <limits> -#include <vespa/document/datatype/positiondatatype.h> +#include "distancefeature.h" #include <vespa/searchlib/fef/location.h> #include <vespa/searchlib/fef/matchdata.h> +#include <vespa/document/datatype/positiondatatype.h> #include <vespa/vespalib/geo/zcurve.h> -#include "distancefeature.h" +#include <cmath> +#include <limits> + +#include <vespa/log/log.h> +LOG_SETUP(".features.distancefeature"); using namespace search::fef; diff --git a/searchlib/src/vespa/searchlib/features/distancetopathfeature.cpp b/searchlib/src/vespa/searchlib/features/distancetopathfeature.cpp index da9db13f17c..91878fc948e 100644 --- a/searchlib/src/vespa/searchlib/features/distancetopathfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/distancetopathfeature.cpp @@ -1,18 +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/log/log.h> -LOG_SETUP(".features.distancetopathfeature"); +#include "distancetopathfeature.h" +#include "utils.h" +#include <vespa/searchlib/fef/matchdata.h> +#include <vespa/searchlib/fef/properties.h> +#include <vespa/document/datatype/positiondatatype.h> +#include <vespa/vespalib/geo/zcurve.h> #include <boost/algorithm/string/split.hpp> #include <boost/algorithm/string/classification.hpp> #include <cmath> -#include <vespa/document/datatype/positiondatatype.h> -#include <vespa/searchlib/fef/matchdata.h> -#include <vespa/searchlib/fef/properties.h> #include <sstream> -#include <vespa/vespalib/geo/zcurve.h> -#include "distancetopathfeature.h" -#include "utils.h" + +#include <vespa/log/log.h> +LOG_SETUP(".features.distancetopathfeature"); namespace search { namespace features { diff --git a/searchlib/src/vespa/searchlib/features/element_completeness_feature.cpp b/searchlib/src/vespa/searchlib/features/element_completeness_feature.cpp index 0874afcb080..71bb8731c7c 100644 --- a/searchlib/src/vespa/searchlib/features/element_completeness_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/element_completeness_feature.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".features.elementcompleteness"); #include "element_completeness_feature.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/features/fieldinfofeature.cpp b/searchlib/src/vespa/searchlib/features/fieldinfofeature.cpp index 86bd40cb050..1f689ce8dd1 100644 --- a/searchlib/src/vespa/searchlib/features/fieldinfofeature.cpp +++ b/searchlib/src/vespa/searchlib/features/fieldinfofeature.cpp @@ -1,9 +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/log/log.h> -LOG_SETUP(".features.fieldinfo"); - +#include "fieldinfofeature.h" +#include "valuefeature.h" +#include "utils.h" #include <vespa/searchlib/fef/properties.h> #include <vespa/searchlib/fef/fieldinfo.h> #include <vespa/searchlib/fef/fieldtype.h> @@ -11,9 +10,6 @@ LOG_SETUP(".features.fieldinfo"); #include <vespa/searchlib/fef/itermdata.h> #include <vespa/searchlib/fef/handle.h> #include <sstream> -#include "fieldinfofeature.h" -#include "valuefeature.h" -#include "utils.h" namespace search { namespace features { diff --git a/searchlib/src/vespa/searchlib/features/fieldlengthfeature.cpp b/searchlib/src/vespa/searchlib/features/fieldlengthfeature.cpp index 413c538ba85..26e11bbb5d3 100644 --- a/searchlib/src/vespa/searchlib/features/fieldlengthfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/fieldlengthfeature.cpp @@ -1,16 +1,13 @@ // 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> -LOG_SETUP(".features.fieldlength"); +#include "fieldlengthfeature.h" +#include "valuefeature.h" +#include "utils.h" #include <vespa/searchlib/fef/itermdata.h> #include <vespa/searchlib/fef/featurenamebuilder.h> #include <vespa/searchlib/fef/fieldinfo.h> #include <vespa/searchlib/fef/fieldtype.h> #include <vespa/vespalib/util/stringfmt.h> -#include "fieldlengthfeature.h" -#include "valuefeature.h" -#include "utils.h" using namespace search::fef; diff --git a/searchlib/src/vespa/searchlib/features/fieldmatch/computer.cpp b/searchlib/src/vespa/searchlib/features/fieldmatch/computer.cpp index d613083233f..23847b11fd4 100644 --- a/searchlib/src/vespa/searchlib/features/fieldmatch/computer.cpp +++ b/searchlib/src/vespa/searchlib/features/fieldmatch/computer.cpp @@ -1,15 +1,15 @@ // 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> -LOG_SETUP(".features.fieldmatch.computer"); -#include <iostream> -#include <cstdlib> -#include <set> +#include "computer.h" #include <vespa/searchlib/features/utils.h> #include <vespa/searchlib/fef/properties.h> #include <vespa/vespalib/util/stringfmt.h> -#include "computer.h" +#include <iostream> +#include <cstdlib> +#include <set> + +#include <vespa/log/log.h> +LOG_SETUP(".features.fieldmatch.computer"); using namespace search::fef; diff --git a/searchlib/src/vespa/searchlib/features/fieldmatch/metrics.cpp b/searchlib/src/vespa/searchlib/features/fieldmatch/metrics.cpp index d89b447a794..1d7cfa59f17 100644 --- a/searchlib/src/vespa/searchlib/features/fieldmatch/metrics.cpp +++ b/searchlib/src/vespa/searchlib/features/fieldmatch/metrics.cpp @@ -1,15 +1,12 @@ // 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> -LOG_SETUP(".features.fieldmatch.metrics"); +#include "metrics.h" +#include "computer.h" +#include <vespa/vespalib/util/stringfmt.h> #include <algorithm> #include <cstdlib> #include <cmath> #include <cstdlib> -#include <vespa/vespalib/util/stringfmt.h> -#include "computer.h" -#include "metrics.h" namespace search { namespace features { diff --git a/searchlib/src/vespa/searchlib/features/fieldmatch/metrics.h b/searchlib/src/vespa/searchlib/features/fieldmatch/metrics.h index 6b826f09e57..ed39fe39f95 100644 --- a/searchlib/src/vespa/searchlib/features/fieldmatch/metrics.h +++ b/searchlib/src/vespa/searchlib/features/fieldmatch/metrics.h @@ -1,8 +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 <vector> #include <vespa/searchlib/common/feature.h> +#include <vespa/vespalib/stllike/string.h> +#include <vector> namespace search { namespace features { diff --git a/searchlib/src/vespa/searchlib/features/fieldmatch/params.cpp b/searchlib/src/vespa/searchlib/features/fieldmatch/params.cpp index 34a23bb3642..9543cf8d174 100644 --- a/searchlib/src/vespa/searchlib/features/fieldmatch/params.cpp +++ b/searchlib/src/vespa/searchlib/features/fieldmatch/params.cpp @@ -1,10 +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 "params.h" + #include <vespa/log/log.h> LOG_SETUP(".features.fieldmatch.params"); -#include "params.h" - namespace search { namespace features { namespace fieldmatch { diff --git a/searchlib/src/vespa/searchlib/features/fieldmatch/params.h b/searchlib/src/vespa/searchlib/features/fieldmatch/params.h index f3ff7558971..5496ce00ff7 100644 --- a/searchlib/src/vespa/searchlib/features/fieldmatch/params.h +++ b/searchlib/src/vespa/searchlib/features/fieldmatch/params.h @@ -1,8 +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 <vector> #include <vespa/searchlib/common/feature.h> +#include <vector> +#include <cstdint> namespace search { namespace features { diff --git a/searchlib/src/vespa/searchlib/features/fieldmatch/segmentstart.cpp b/searchlib/src/vespa/searchlib/features/fieldmatch/segmentstart.cpp index 93be549bc1f..ca6a92b9ed3 100644 --- a/searchlib/src/vespa/searchlib/features/fieldmatch/segmentstart.cpp +++ b/searchlib/src/vespa/searchlib/features/fieldmatch/segmentstart.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> -LOG_SETUP(".features.fieldmatch.segmentstart"); -#include <vespa/vespalib/util/stringfmt.h> +#include "segmentstart.h" #include "computer.h" #include "metrics.h" -#include "segmentstart.h" +#include <vespa/vespalib/util/stringfmt.h> namespace search { namespace features { diff --git a/searchlib/src/vespa/searchlib/features/fieldmatch/simplemetrics.cpp b/searchlib/src/vespa/searchlib/features/fieldmatch/simplemetrics.cpp index 6a6e1935ad3..705fb3de45d 100644 --- a/searchlib/src/vespa/searchlib/features/fieldmatch/simplemetrics.cpp +++ b/searchlib/src/vespa/searchlib/features/fieldmatch/simplemetrics.cpp @@ -1,7 +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/log/log.h> -LOG_SETUP(".features.fieldmatch.simplemetrics"); #include "simplemetrics.h" #include <vespa/vespalib/stllike/asciistream.h> diff --git a/searchlib/src/vespa/searchlib/features/fieldtermmatchfeature.cpp b/searchlib/src/vespa/searchlib/features/fieldtermmatchfeature.cpp index 6c0bf057c43..2342547c16b 100644 --- a/searchlib/src/vespa/searchlib/features/fieldtermmatchfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/fieldtermmatchfeature.cpp @@ -1,16 +1,13 @@ // 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> -LOG_SETUP(".features.fieldtermmatchfeature"); +#include "fieldtermmatchfeature.h" +#include "utils.h" #include <vespa/searchlib/fef/featurenamebuilder.h> #include <vespa/searchlib/fef/fieldinfo.h> #include <vespa/searchlib/fef/fieldtype.h> #include <vespa/searchlib/fef/properties.h> #include <vespa/searchlib/fef/itermdata.h> #include <vespa/vespalib/util/stringfmt.h> -#include "fieldtermmatchfeature.h" -#include "utils.h" namespace search { namespace features { diff --git a/searchlib/src/vespa/searchlib/features/firstphasefeature.cpp b/searchlib/src/vespa/searchlib/features/firstphasefeature.cpp index daa20d06e5b..a56b0dd65bc 100644 --- a/searchlib/src/vespa/searchlib/features/firstphasefeature.cpp +++ b/searchlib/src/vespa/searchlib/features/firstphasefeature.cpp @@ -1,10 +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/log/log.h> -LOG_SETUP(".features.firstphasefeature"); #include "firstphasefeature.h" - #include <vespa/searchlib/fef/featureexecutor.h> #include <vespa/searchlib/fef/indexproperties.h> #include <vespa/searchlib/fef/properties.h> diff --git a/searchlib/src/vespa/searchlib/features/freshnessfeature.cpp b/searchlib/src/vespa/searchlib/features/freshnessfeature.cpp index d6955118ccb..afacee26b26 100644 --- a/searchlib/src/vespa/searchlib/features/freshnessfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/freshnessfeature.cpp @@ -1,11 +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/log/log.h> -LOG_SETUP(".features.freshnessfeature"); -#include <vespa/searchlib/fef/properties.h> #include "freshnessfeature.h" #include "utils.h" +#include <vespa/searchlib/fef/properties.h> + +#include <vespa/log/log.h> +LOG_SETUP(".features.freshnessfeature"); using namespace search::fef; diff --git a/searchlib/src/vespa/searchlib/features/item_raw_score_feature.cpp b/searchlib/src/vespa/searchlib/features/item_raw_score_feature.cpp index 14b517a10ca..5088dfdffbd 100644 --- a/searchlib/src/vespa/searchlib/features/item_raw_score_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/item_raw_score_feature.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".features.item_raw_score_feature"); #include "item_raw_score_feature.h" #include "valuefeature.h" #include "utils.h" diff --git a/searchlib/src/vespa/searchlib/features/jarowinklerdistancefeature.cpp b/searchlib/src/vespa/searchlib/features/jarowinklerdistancefeature.cpp index 0c933261920..357a5e0b106 100644 --- a/searchlib/src/vespa/searchlib/features/jarowinklerdistancefeature.cpp +++ b/searchlib/src/vespa/searchlib/features/jarowinklerdistancefeature.cpp @@ -1,17 +1,14 @@ // 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> -LOG_SETUP(".features.jarowinklerdistance"); +#include "jarowinklerdistancefeature.h" +#include "utils.h" +#include <limits> #include <vespa/searchlib/fef/featurenamebuilder.h> #include <vespa/searchlib/fef/fieldinfo.h> #include <vespa/searchlib/fef/fieldtype.h> #include <vespa/searchlib/fef/properties.h> #include <vespa/searchlib/fef/itermdata.h> #include <vespa/vespalib/util/stringfmt.h> -#include "jarowinklerdistancefeature.h" -#include "utils.h" -#include <limits> namespace search { namespace features { @@ -131,12 +128,9 @@ feature_t JaroWinklerDistanceExecutor::jaroWinklerProximity(const std::vector<search::fef::FieldPositionsIterator> &termPos, uint32_t fieldLen) { feature_t ret = std::min(1.0, std::max(0.0, jaroMeasure(termPos, fieldLen))); - //LOG(debug, "Jaro measure is %f.", ret); if (ret > _config.boostThreshold) { ret += 0.1f * prefixMatch(termPos, fieldLen, _config.prefixSize) * (1 - ret); // less boost close to 1 - //LOG(debug, "Applying Winkler boost."); } - //LOG(debug, "JaroWinkler measure is %f.", ret); return ret; } diff --git a/searchlib/src/vespa/searchlib/features/matchesfeature.cpp b/searchlib/src/vespa/searchlib/features/matchesfeature.cpp index e62b1a91785..ee8ec3eeca9 100644 --- a/searchlib/src/vespa/searchlib/features/matchesfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/matchesfeature.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> -LOG_SETUP(".features.matchesfeature"); -#include <vespa/searchlib/fef/fieldinfo.h> #include "matchesfeature.h" #include "utils.h" #include "valuefeature.h" +#include <vespa/searchlib/fef/fieldinfo.h> using namespace search::fef; diff --git a/searchlib/src/vespa/searchlib/features/matchfeature.cpp b/searchlib/src/vespa/searchlib/features/matchfeature.cpp index 780c52e9508..5c8feedc9bb 100644 --- a/searchlib/src/vespa/searchlib/features/matchfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/matchfeature.cpp @@ -1,16 +1,12 @@ // 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> -LOG_SETUP(".features.matchfeature"); #include "matchfeature.h" - +#include "utils.h" #include <vespa/searchlib/fef/featurenamebuilder.h> #include <vespa/searchlib/fef/fieldinfo.h> #include <vespa/searchlib/fef/indexproperties.h> #include <vespa/searchlib/fef/properties.h> #include <vespa/vespalib/util/stringfmt.h> -#include "utils.h" using namespace search::fef; using CollectionType = FieldInfo::CollectionType; diff --git a/searchlib/src/vespa/searchlib/features/native_dot_product_feature.cpp b/searchlib/src/vespa/searchlib/features/native_dot_product_feature.cpp index 9e2384b08c8..3b717e43397 100644 --- a/searchlib/src/vespa/searchlib/features/native_dot_product_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/native_dot_product_feature.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".features.native_dot_product_feature"); #include "native_dot_product_feature.h" #include "utils.h" diff --git a/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.cpp b/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.cpp index 6d92e8694bf..b10e2e70ff0 100644 --- a/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.cpp @@ -1,15 +1,12 @@ // 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 "valuefeature.h" +#include "nativeattributematchfeature.h" +#include "utils.h" #include <vespa/searchlib/fef/fieldinfo.h> #include <vespa/searchlib/fef/indexproperties.h> #include <vespa/searchlib/fef/itablemanager.h> #include <vespa/searchlib/fef/properties.h> -#include "valuefeature.h" -#include "nativeattributematchfeature.h" -#include "utils.h" -LOG_SETUP(".features.nativeattributematchfeature"); using namespace search::fef; diff --git a/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.cpp b/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.cpp index 3a333211e1a..edfc5435fc2 100644 --- a/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.cpp @@ -1,15 +1,12 @@ // 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> -LOG_SETUP(".features.nativefieldmatchfeature"); +#include "nativefieldmatchfeature.h" +#include "valuefeature.h" +#include "utils.h" #include <vespa/searchlib/fef/fieldinfo.h> #include <vespa/searchlib/fef/indexproperties.h> #include <vespa/searchlib/fef/itablemanager.h> #include <vespa/searchlib/fef/properties.h> -#include "nativefieldmatchfeature.h" -#include "valuefeature.h" -#include "utils.h" using namespace search::fef; diff --git a/searchlib/src/vespa/searchlib/features/nativeproximityfeature.cpp b/searchlib/src/vespa/searchlib/features/nativeproximityfeature.cpp index ddd4dcec47e..aeb9f0c8f01 100644 --- a/searchlib/src/vespa/searchlib/features/nativeproximityfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/nativeproximityfeature.cpp @@ -1,15 +1,12 @@ // 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> -LOG_SETUP(".features.nativeproximityfeature"); +#include "nativeproximityfeature.h" +#include "valuefeature.h" +#include "utils.h" #include <vespa/searchlib/fef/fieldinfo.h> #include <vespa/searchlib/fef/indexproperties.h> #include <vespa/searchlib/fef/itablemanager.h> #include <vespa/searchlib/fef/properties.h> -#include "nativeproximityfeature.h" -#include "valuefeature.h" -#include "utils.h" #include <map> using namespace search::fef; @@ -47,10 +44,6 @@ NativeProximityExecutor::calculateScoreForPair(const TermPair & pair, uint32_t f (a.significance() * a.termData()->getWeight().percent() + b.significance() * b.termData()->getWeight().percent()); feature_t score = (forwardScore + reverseScore) * termPairWeight / param.maxTableSum; - //LOG(debug, "calculateScoreForPair: pair(%u,%u), fieldId(%u), forwardScore(%f), reverseScore(%f), " - //"termPairWeight(%f), maxTableSum(%f), score(%f)", - //fieldId, a.termData()->getUniqueId(), b.termData()->getUniqueId(), forwardScore, reverseScore, - //termPairWeight, _params.maxTableSums[fieldId], score); return score; } diff --git a/searchlib/src/vespa/searchlib/features/nativerankfeature.cpp b/searchlib/src/vespa/searchlib/features/nativerankfeature.cpp index ee812f2173e..92d00e9f907 100644 --- a/searchlib/src/vespa/searchlib/features/nativerankfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/nativerankfeature.cpp @@ -1,13 +1,13 @@ // 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> -LOG_SETUP(".features.nativerankfeature"); -#include <vespa/searchlib/fef/fieldinfo.h> -#include <vespa/searchlib/fef/properties.h> #include "nativerankfeature.h" #include "valuefeature.h" #include "utils.h" +#include <vespa/searchlib/fef/fieldinfo.h> +#include <vespa/searchlib/fef/properties.h> + +#include <vespa/log/log.h> +LOG_SETUP(".features.nativerankfeature"); using namespace search::fef; diff --git a/searchlib/src/vespa/searchlib/features/nowfeature.cpp b/searchlib/src/vespa/searchlib/features/nowfeature.cpp index cc6614d8c06..5fcddcebd1e 100644 --- a/searchlib/src/vespa/searchlib/features/nowfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/nowfeature.cpp @@ -1,13 +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/log/log.h> -LOG_SETUP(".features.nowfeature"); +#include "nowfeature.h" #include <vespa/searchlib/fef/featurenamebuilder.h> #include <vespa/searchlib/fef/queryproperties.h> #include <vespa/searchlib/fef/properties.h> -#include "nowfeature.h" -#include "valuefeature.h" +#include <vespa/fastos/time.h> namespace search { namespace features { @@ -16,7 +13,6 @@ NowExecutor::NowExecutor(int64_t timestamp) : search::fef::FeatureExecutor(), _timestamp(timestamp) { - // empty } void diff --git a/searchlib/src/vespa/searchlib/features/proximityfeature.cpp b/searchlib/src/vespa/searchlib/features/proximityfeature.cpp index b8a69c38b32..62f57efbc2d 100644 --- a/searchlib/src/vespa/searchlib/features/proximityfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/proximityfeature.cpp @@ -1,14 +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/log/log.h> -LOG_SETUP(".features.proximity"); +#include "proximityfeature.h" +#include "utils.h" #include <vespa/searchlib/fef/featurenamebuilder.h> #include <vespa/searchlib/fef/fieldinfo.h> #include <vespa/searchlib/fef/itermdata.h> #include <vespa/vespalib/util/stringfmt.h> -#include "proximityfeature.h" -#include "utils.h" namespace search { namespace features { diff --git a/searchlib/src/vespa/searchlib/features/querycompletenessfeature.cpp b/searchlib/src/vespa/searchlib/features/querycompletenessfeature.cpp index f6db8a34534..ab876509e0f 100644 --- a/searchlib/src/vespa/searchlib/features/querycompletenessfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/querycompletenessfeature.cpp @@ -1,15 +1,15 @@ // 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> -LOG_SETUP(".features.querycompleteness"); +#include "querycompletenessfeature.h" +#include "utils.h" #include <vespa/searchlib/fef/featurenamebuilder.h> #include <vespa/searchlib/fef/fieldinfo.h> #include <vespa/searchlib/fef/itermdata.h> -#include "querycompletenessfeature.h" -#include "utils.h" #include <limits> +#include <vespa/log/log.h> +LOG_SETUP(".features.querycompleteness"); + namespace search { namespace features { diff --git a/searchlib/src/vespa/searchlib/features/queryfeature.cpp b/searchlib/src/vespa/searchlib/features/queryfeature.cpp index 4cb1af346cf..d61e2928165 100644 --- a/searchlib/src/vespa/searchlib/features/queryfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/queryfeature.cpp @@ -1,23 +1,20 @@ // 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> -LOG_SETUP(".features.queryfeature"); #include "queryfeature.h" +#include "utils.h" +#include "valuefeature.h" #include <vespa/searchlib/features/constant_tensor_executor.h> #include <vespa/searchlib/fef/featureexecutor.h> #include <vespa/searchlib/fef/indexproperties.h> #include <vespa/searchlib/fef/properties.h> +#include <vespa/searchlib/fef/feature_type.h> #include <vespa/vespalib/objects/nbostream.h> #include <vespa/eval/tensor/default_tensor.h> #include <vespa/eval/tensor/tensor_mapper.h> #include <vespa/eval/tensor/serialization/typed_binary_format.h> -#include <memory> -#include "utils.h" -#include "valuefeature.h" #include <vespa/eval/eval/value_type.h> -#include <vespa/searchlib/fef/feature_type.h> +#include <memory> using namespace search::fef; using namespace search::fef::indexproperties; diff --git a/searchlib/src/vespa/searchlib/features/queryterm.cpp b/searchlib/src/vespa/searchlib/features/queryterm.cpp index f8c659be359..1ac25428a4c 100644 --- a/searchlib/src/vespa/searchlib/features/queryterm.cpp +++ b/searchlib/src/vespa/searchlib/features/queryterm.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".features.queryterm"); #include "queryterm.h" #include "utils.h" diff --git a/searchlib/src/vespa/searchlib/features/querytermcountfeature.cpp b/searchlib/src/vespa/searchlib/features/querytermcountfeature.cpp index 50cd4881817..2c5fa6e3032 100644 --- a/searchlib/src/vespa/searchlib/features/querytermcountfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/querytermcountfeature.cpp @@ -1,17 +1,13 @@ // 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> -LOG_SETUP(".features.querytermcountfeature"); - +#include "querytermcountfeature.h" +#include "valuefeature.h" #include <vespa/searchlib/fef/properties.h> #include <vespa/searchlib/fef/fieldinfo.h> #include <vespa/searchlib/fef/fieldtype.h> #include <vespa/searchlib/fef/featurenamebuilder.h> #include <vespa/searchlib/fef/itermdata.h> #include <vespa/searchlib/fef/handle.h> -#include "querytermcountfeature.h" -#include "valuefeature.h" using namespace search::fef; diff --git a/searchlib/src/vespa/searchlib/features/random_normal_feature.cpp b/searchlib/src/vespa/searchlib/features/random_normal_feature.cpp index b27bad7b98f..127dd0feecf 100644 --- a/searchlib/src/vespa/searchlib/features/random_normal_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/random_normal_feature.cpp @@ -1,12 +1,13 @@ // Copyright 2017 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 <cmath> -LOG_SETUP(".features.randomnormalfeature"); -#include <vespa/searchlib/fef/properties.h> #include "random_normal_feature.h" #include "utils.h" +#include <vespa/searchlib/fef/properties.h> +#include <vespa/fastos/time.h> +#include <cmath> + +#include <vespa/log/log.h> +LOG_SETUP(".features.randomnormalfeature"); namespace search { namespace features { @@ -20,8 +21,7 @@ RandomNormalExecutor::RandomNormalExecutor(uint64_t seed, double mean, double st _spare(0.0) { - LOG(debug, "RandomNormalExecutor: seed=%" PRIu64 ", mean=%f, stddev=%f", - seed, mean, stddev); + LOG(debug, "RandomNormalExecutor: seed=%" PRIu64 ", mean=%f, stddev=%f", seed, mean, stddev); _rnd.srand48(seed); } diff --git a/searchlib/src/vespa/searchlib/features/randomfeature.cpp b/searchlib/src/vespa/searchlib/features/randomfeature.cpp index 16fb4a99edb..19da7a19895 100644 --- a/searchlib/src/vespa/searchlib/features/randomfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/randomfeature.cpp @@ -1,11 +1,13 @@ // 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> -LOG_SETUP(".features.randomfeature"); #include "randomfeature.h" #include "utils.h" #include <vespa/searchlib/fef/properties.h> +#include <vespa/vespalib/util/stringfmt.h> +#include <vespa/fastos/time.h> + +#include <vespa/log/log.h> +LOG_SETUP(".features.randomfeature"); namespace search { namespace features { @@ -16,8 +18,7 @@ RandomExecutor::RandomExecutor(uint64_t seed, uint64_t matchSeed) : _matchRnd(), _matchSeed(matchSeed) { - LOG(debug, "RandomExecutor: seed=%" PRIu64 ", matchSeed=%" PRIu64, - seed, matchSeed); + LOG(debug, "RandomExecutor: seed=%" PRIu64 ", matchSeed=%" PRIu64, seed, matchSeed); _rnd.srand48(seed); } @@ -27,7 +28,6 @@ RandomExecutor::execute(uint32_t docId) feature_t rndScore = _rnd.lrand48() / (feature_t)0x80000000u; // 2^31 _matchRnd.srand48(_matchSeed + docId); feature_t matchRndScore = _matchRnd.lrand48() / (feature_t)0x80000000u; // 2^31 - //LOG(debug, "execute: %f", rndScore); outputs().set_number(0, rndScore); outputs().set_number(1, matchRndScore); } @@ -37,14 +37,12 @@ RandomBlueprint::RandomBlueprint() : search::fef::Blueprint("random"), _seed(0) { - // empty } void RandomBlueprint::visitDumpFeatures(const search::fef::IIndexEnvironment &, search::fef::IDumpFeatureVisitor &) const { - // empty } search::fef::Blueprint::UP diff --git a/searchlib/src/vespa/searchlib/features/rankingexpression/feature_name_extractor.cpp b/searchlib/src/vespa/searchlib/features/rankingexpression/feature_name_extractor.cpp index 4dc5124df67..3c453ee221c 100644 --- a/searchlib/src/vespa/searchlib/features/rankingexpression/feature_name_extractor.cpp +++ b/searchlib/src/vespa/searchlib/features/rankingexpression/feature_name_extractor.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 "feature_name_extractor.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/features/raw_score_feature.cpp b/searchlib/src/vespa/searchlib/features/raw_score_feature.cpp index efee81ffd6c..0bed17a52e5 100644 --- a/searchlib/src/vespa/searchlib/features/raw_score_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/raw_score_feature.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".features.raw_score_feature"); #include "raw_score_feature.h" #include "utils.h" diff --git a/searchlib/src/vespa/searchlib/features/reverseproximityfeature.cpp b/searchlib/src/vespa/searchlib/features/reverseproximityfeature.cpp index aba27c891ed..e185faff7ae 100644 --- a/searchlib/src/vespa/searchlib/features/reverseproximityfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/reverseproximityfeature.cpp @@ -1,15 +1,12 @@ // 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> -LOG_SETUP(".features.reverseproximity"); +#include "reverseproximityfeature.h" +#include "utils.h" #include <vespa/searchlib/fef/featurenamebuilder.h> #include <vespa/searchlib/fef/fieldinfo.h> #include <vespa/searchlib/fef/fieldtype.h> #include <vespa/searchlib/fef/itermdata.h> #include <vespa/vespalib/util/stringfmt.h> -#include "reverseproximityfeature.h" -#include "utils.h" namespace search { namespace features { @@ -59,11 +56,9 @@ ReverseProximityExecutor::execute(uint32_t docId) } } } - //LOG(debug, "Initial guess; posA is '%u' and posB is '%u'.", posA, posB); // _P_A_R_A_N_O_I_A_ if (!itA.valid() || !itB.valid()) { - //LOG(debug, "Initial guess is invalid."); outputs().set_number(0, util::FEATURE_MAX); // out outputs().set_number(1, util::FEATURE_MIN); // posA outputs().set_number(2, util::FEATURE_MAX); // posB diff --git a/searchlib/src/vespa/searchlib/features/setup.cpp b/searchlib/src/vespa/searchlib/features/setup.cpp index e3dbda6a941..7ddf712d6c7 100644 --- a/searchlib/src/vespa/searchlib/features/setup.cpp +++ b/searchlib/src/vespa/searchlib/features/setup.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 "setup.h" #include "agefeature.h" diff --git a/searchlib/src/vespa/searchlib/features/subqueries_feature.cpp b/searchlib/src/vespa/searchlib/features/subqueries_feature.cpp index 3fddc81268b..8f88b6a03da 100644 --- a/searchlib/src/vespa/searchlib/features/subqueries_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/subqueries_feature.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".features.subqueries_feature"); #include "subqueries_feature.h" #include "utils.h" diff --git a/searchlib/src/vespa/searchlib/features/tensor_attribute_executor.cpp b/searchlib/src/vespa/searchlib/features/tensor_attribute_executor.cpp index b1eee1bc7ad..4eae5b8f950 100644 --- a/searchlib/src/vespa/searchlib/features/tensor_attribute_executor.cpp +++ b/searchlib/src/vespa/searchlib/features/tensor_attribute_executor.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 "tensor_attribute_executor.h" #include <vespa/searchlib/tensor/tensor_attribute.h> diff --git a/searchlib/src/vespa/searchlib/features/tensor_from_labels_feature.cpp b/searchlib/src/vespa/searchlib/features/tensor_from_labels_feature.cpp index bd8b4122df6..330275cb9cd 100644 --- a/searchlib/src/vespa/searchlib/features/tensor_from_labels_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/tensor_from_labels_feature.cpp @@ -1,19 +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/log/log.h> -LOG_SETUP(".features.tensor_from_labels_feature"); - #include "tensor_from_labels_feature.h" #include "array_parser.hpp" #include "constant_tensor_executor.h" #include "tensor_from_attribute_executor.h" +#include <vespa/searchlib/fef/properties.h> +#include <vespa/searchlib/fef/feature_type.h> #include <vespa/searchcommon/attribute/attributecontent.h> #include <vespa/searchcommon/attribute/iattributevector.h> -#include <vespa/searchlib/fef/properties.h> #include <vespa/eval/tensor/default_tensor.h> #include <vespa/eval/eval/value_type.h> -#include <vespa/searchlib/fef/feature_type.h> + +#include <vespa/log/log.h> +LOG_SETUP(".features.tensor_from_labels_feature"); using namespace search::fef; using search::attribute::IAttributeVector; diff --git a/searchlib/src/vespa/searchlib/features/tensor_from_weighted_set_feature.cpp b/searchlib/src/vespa/searchlib/features/tensor_from_weighted_set_feature.cpp index 7430fe69cab..5dfb8ce8cdc 100644 --- a/searchlib/src/vespa/searchlib/features/tensor_from_weighted_set_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/tensor_from_weighted_set_feature.cpp @@ -1,9 +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/log/log.h> -LOG_SETUP(".features.tensor_from_weighted_set_feature"); - #include "tensor_from_weighted_set_feature.h" #include "constant_tensor_executor.h" @@ -11,15 +7,17 @@ LOG_SETUP(".features.tensor_from_weighted_set_feature"); #include "tensor_from_attribute_executor.h" #include "weighted_set_parser.hpp" +#include <vespa/searchlib/fef/properties.h> +#include <vespa/searchlib/fef/feature_type.h> #include <vespa/searchcommon/attribute/attributecontent.h> #include <vespa/searchcommon/attribute/iattributevector.h> -#include <vespa/searchlib/fef/properties.h> #include <vespa/eval/eval/function.h> #include <vespa/eval/tensor/tensor.h> #include <vespa/eval/tensor/default_tensor.h> -#include <memory> #include <vespa/eval/eval/value_type.h> -#include <vespa/searchlib/fef/feature_type.h> + +#include <vespa/log/log.h> +LOG_SETUP(".features.tensor_from_weighted_set_feature"); using namespace search::fef; using search::attribute::IAttributeVector; diff --git a/searchlib/src/vespa/searchlib/features/term_field_md_feature.cpp b/searchlib/src/vespa/searchlib/features/term_field_md_feature.cpp index a51c16ae797..70c1276abf0 100644 --- a/searchlib/src/vespa/searchlib/features/term_field_md_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/term_field_md_feature.cpp @@ -1,14 +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/log/log.h> +#include "term_field_md_feature.h" +#include "utils.h" #include <vespa/searchlib/fef/fieldinfo.h> #include <vespa/searchlib/fef/indexproperties.h> #include <vespa/searchlib/fef/itablemanager.h> #include <vespa/searchlib/fef/properties.h> -#include "term_field_md_feature.h" -#include "utils.h" -LOG_SETUP(".features.term_field_md_feature"); using namespace search::fef; @@ -23,10 +20,10 @@ TermFieldMdExecutor::TermFieldMdExecutor(const search::fef::IQueryEnvironment &e { for (uint32_t i = 0; i < env.getNumTerms(); ++i) { const search::fef::ITermData *td = env.getTerm(i); - LOG_ASSERT(td != 0); + assert(td != 0); const search::fef::ITermFieldData *tfd = td->lookupField(fieldId); if (tfd != 0) { - LOG_ASSERT(tfd->getHandle() != search::fef::IllegalHandle); + assert(tfd->getHandle() != search::fef::IllegalHandle); _terms.push_back(std::make_pair(tfd->getHandle(), td->getWeight())); } } @@ -96,7 +93,7 @@ TermFieldMdBlueprint::setup(const IIndexEnvironment & env, const ParameterList & params) { _field = params[0].asField(); - LOG_ASSERT(_field != 0); + assert(_field != 0); describeOutput("score", "The term field match score"); describeOutput("terms", "The number of ranked terms searching this field"); diff --git a/searchlib/src/vespa/searchlib/features/termdistancecalculator.cpp b/searchlib/src/vespa/searchlib/features/termdistancecalculator.cpp index ef8d1005a17..9689dd3efca 100644 --- a/searchlib/src/vespa/searchlib/features/termdistancecalculator.cpp +++ b/searchlib/src/vespa/searchlib/features/termdistancecalculator.cpp @@ -1,11 +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/log/log.h> -LOG_SETUP(".features.termdistancecalculator"); +#include "termdistancecalculator.h" #include <vespa/searchlib/fef/matchdata.h> #include <vespa/searchlib/fef/itermdata.h> -#include "termdistancecalculator.h" using namespace search::fef; diff --git a/searchlib/src/vespa/searchlib/features/termdistancecalculator.h b/searchlib/src/vespa/searchlib/features/termdistancecalculator.h index ae22d6fe38d..94675d591dc 100644 --- a/searchlib/src/vespa/searchlib/features/termdistancecalculator.h +++ b/searchlib/src/vespa/searchlib/features/termdistancecalculator.h @@ -5,6 +5,12 @@ #include "queryterm.h" namespace search { + +namespace fef { + class TermFieldMatchData; + class MatchData; +} + namespace features { /** @@ -60,8 +66,8 @@ public: }; private: - static void findBest(const search::fef::TermFieldMatchData *tmdX, - const search::fef::TermFieldMatchData *tmdY, + static void findBest(const fef::TermFieldMatchData *tmdX, + const fef::TermFieldMatchData *tmdY, uint32_t numTermsX, uint32_t & bestDist, uint32_t & bestPos); @@ -73,9 +79,8 @@ public: * NB: Both query terms must have attached term fields with valid term field handles. **/ static void run(const QueryTerm &termX, const QueryTerm &termY, - const search::fef::MatchData & match, uint32_t docId, Result & r); + const fef::MatchData & match, uint32_t docId, Result & r); }; } // namespace features } // namespace search - diff --git a/searchlib/src/vespa/searchlib/features/termdistancefeature.cpp b/searchlib/src/vespa/searchlib/features/termdistancefeature.cpp index fd7bef0f201..8a512c48bd9 100644 --- a/searchlib/src/vespa/searchlib/features/termdistancefeature.cpp +++ b/searchlib/src/vespa/searchlib/features/termdistancefeature.cpp @@ -1,13 +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/log/log.h> -LOG_SETUP(".features.nativeproximityfeature"); -#include <vespa/searchlib/fef/fieldinfo.h> -#include <vespa/searchlib/fef/properties.h> #include "termdistancefeature.h" #include "valuefeature.h" #include "utils.h" +#include <vespa/searchlib/fef/fieldinfo.h> +#include <vespa/searchlib/fef/properties.h> using namespace search::fef; diff --git a/searchlib/src/vespa/searchlib/features/termeditdistancefeature.cpp b/searchlib/src/vespa/searchlib/features/termeditdistancefeature.cpp index da730ccc996..a414c217d7b 100644 --- a/searchlib/src/vespa/searchlib/features/termeditdistancefeature.cpp +++ b/searchlib/src/vespa/searchlib/features/termeditdistancefeature.cpp @@ -1,16 +1,16 @@ // 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> -LOG_SETUP(".features.termeditdistance"); +#include "termeditdistancefeature.h" +#include "utils.h" #include <vespa/searchlib/fef/featurenamebuilder.h> #include <vespa/searchlib/fef/fieldinfo.h> #include <vespa/searchlib/fef/fieldtype.h> #include <vespa/searchlib/fef/properties.h> #include <vespa/searchlib/fef/itermdata.h> #include <vespa/vespalib/util/stringfmt.h> -#include "termeditdistancefeature.h" -#include "utils.h" + +#include <vespa/log/log.h> +LOG_SETUP(".features.termeditdistance"); namespace search { namespace features { diff --git a/searchlib/src/vespa/searchlib/features/termfeature.cpp b/searchlib/src/vespa/searchlib/features/termfeature.cpp index a7ffb9a7bee..a47f8e47553 100644 --- a/searchlib/src/vespa/searchlib/features/termfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/termfeature.cpp @@ -1,16 +1,13 @@ // 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> -LOG_SETUP(".features.termfeature"); +#include "termfeature.h" +#include "utils.h" #include <vespa/searchlib/fef/featurenamebuilder.h> #include <vespa/searchlib/fef/fieldinfo.h> #include <vespa/searchlib/fef/fieldtype.h> #include <vespa/searchlib/fef/properties.h> #include <vespa/searchlib/fef/itermdata.h> #include <vespa/vespalib/util/stringfmt.h> -#include "termfeature.h" -#include "utils.h" using namespace search::fef; diff --git a/searchlib/src/vespa/searchlib/features/terminfofeature.cpp b/searchlib/src/vespa/searchlib/features/terminfofeature.cpp index 07b2904bf2a..91cdc888285 100644 --- a/searchlib/src/vespa/searchlib/features/terminfofeature.cpp +++ b/searchlib/src/vespa/searchlib/features/terminfofeature.cpp @@ -1,18 +1,13 @@ // 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> -LOG_SETUP(".features.terminfo"); - +#include "terminfofeature.h" +#include "valuefeature.h" #include <vespa/searchlib/fef/properties.h> #include <vespa/searchlib/fef/fieldinfo.h> #include <vespa/searchlib/fef/fieldtype.h> #include <vespa/searchlib/fef/featurenamebuilder.h> #include <vespa/searchlib/fef/itermdata.h> #include <vespa/searchlib/fef/handle.h> -#include <sstream> -#include "terminfofeature.h" -#include "valuefeature.h" namespace search { namespace features { diff --git a/searchlib/src/vespa/searchlib/features/text_similarity_feature.cpp b/searchlib/src/vespa/searchlib/features/text_similarity_feature.cpp index 8340019cb02..c722cf1e74b 100644 --- a/searchlib/src/vespa/searchlib/features/text_similarity_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/text_similarity_feature.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".features.textsimilarity"); #include "text_similarity_feature.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/features/weighted_set_parser.cpp b/searchlib/src/vespa/searchlib/features/weighted_set_parser.cpp index 3d2f03d54eb..c426d2a85d5 100644 --- a/searchlib/src/vespa/searchlib/features/weighted_set_parser.cpp +++ b/searchlib/src/vespa/searchlib/features/weighted_set_parser.cpp @@ -1,11 +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 "weighted_set_parser.h" + #include <vespa/log/log.h> LOG_SETUP(".features.weighted_set_parser"); -#include "weighted_set_parser.h" - namespace search { namespace features { diff --git a/searchlib/src/vespa/searchlib/fef/blueprint.cpp b/searchlib/src/vespa/searchlib/fef/blueprint.cpp index c9a9b94eb44..ccea604b9b2 100644 --- a/searchlib/src/vespa/searchlib/fef/blueprint.cpp +++ b/searchlib/src/vespa/searchlib/fef/blueprint.cpp @@ -1,11 +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/log/log.h> -LOG_SETUP(".fef.blueprint"); #include "blueprint.h" #include "parametervalidator.h" +#include <vespa/log/log.h> +LOG_SETUP(".fef.blueprint"); + namespace search { namespace fef { diff --git a/searchlib/src/vespa/searchlib/fef/blueprintfactory.cpp b/searchlib/src/vespa/searchlib/fef/blueprintfactory.cpp index af03194abb7..1bda84c9d16 100644 --- a/searchlib/src/vespa/searchlib/fef/blueprintfactory.cpp +++ b/searchlib/src/vespa/searchlib/fef/blueprintfactory.cpp @@ -1,9 +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 "blueprintfactory.h" + #include <vespa/log/log.h> LOG_SETUP(".fef.blueprintfactory"); -#include "blueprintfactory.h" namespace search { namespace fef { diff --git a/searchlib/src/vespa/searchlib/fef/create-class-cpp.sh b/searchlib/src/vespa/searchlib/fef/create-class-cpp.sh index e47cc402dca..d9df58ae2b7 100755 --- a/searchlib/src/vespa/searchlib/fef/create-class-cpp.sh +++ b/searchlib/src/vespa/searchlib/fef/create-class-cpp.sh @@ -8,13 +8,9 @@ name=`echo $class | tr 'A-Z' 'a-z'` cat <<EOF // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/log/log.h> -LOG_SETUP(".fef.$name"); -#include <vespa/fastos/fastos.h> #include "$name.h" -namespace search { -namespace fef { +namespace search::fef { $class::$class() { @@ -24,6 +20,5 @@ $class::~$class() { } -} // namespace fef -} // namespace search +} EOF diff --git a/searchlib/src/vespa/searchlib/fef/feature_type.cpp b/searchlib/src/vespa/searchlib/fef/feature_type.cpp index 63434ec6bb7..b4fdbb927a1 100644 --- a/searchlib/src/vespa/searchlib/fef/feature_type.cpp +++ b/searchlib/src/vespa/searchlib/fef/feature_type.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 "feature_type.h" +#include <cassert> namespace search { namespace fef { @@ -22,5 +22,11 @@ FeatureType::object(const TYPE &type_in) return FeatureType(std::make_unique<TYPE>(type_in)); } +const FeatureType::TYPE & +FeatureType::type() const { + assert(_type); + return *_type; +} + } // namespace fef } // namespace search diff --git a/searchlib/src/vespa/searchlib/fef/feature_type.h b/searchlib/src/vespa/searchlib/fef/feature_type.h index 74bdc4149eb..775d89cc2e6 100644 --- a/searchlib/src/vespa/searchlib/fef/feature_type.h +++ b/searchlib/src/vespa/searchlib/fef/feature_type.h @@ -28,10 +28,7 @@ public: FeatureType(const FeatureType &rhs); bool is_object() const { return (_type.get() != nullptr); } operator bool() const { return is_object(); } - const TYPE &type() const { - assert(_type); - return *_type; - } + const TYPE &type() const; static const FeatureType &number() { return _number; } static FeatureType object(const TYPE &type_in); }; diff --git a/searchlib/src/vespa/searchlib/fef/featurenamebuilder.cpp b/searchlib/src/vespa/searchlib/fef/featurenamebuilder.cpp index 292f5ac5bcc..1416f8673c7 100644 --- a/searchlib/src/vespa/searchlib/fef/featurenamebuilder.cpp +++ b/searchlib/src/vespa/searchlib/fef/featurenamebuilder.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 "featurenamebuilder.h" #include "featurenameparser.h" diff --git a/searchlib/src/vespa/searchlib/fef/featurenameparser.cpp b/searchlib/src/vespa/searchlib/fef/featurenameparser.cpp index fca21041f87..698355b25a7 100644 --- a/searchlib/src/vespa/searchlib/fef/featurenameparser.cpp +++ b/searchlib/src/vespa/searchlib/fef/featurenameparser.cpp @@ -1,11 +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/log/log.h> -LOG_SETUP(".fef.featurenameparser"); -#include <vespa/vespalib/util/stringfmt.h> #include "featurenameparser.h" #include "featurenamebuilder.h" +#include <vespa/vespalib/util/stringfmt.h> + +#include <vespa/log/log.h> +LOG_SETUP(".fef.featurenameparser"); namespace { diff --git a/searchlib/src/vespa/searchlib/fef/featureoverrider.cpp b/searchlib/src/vespa/searchlib/fef/featureoverrider.cpp index 364abea4942..f2a0c2b9501 100644 --- a/searchlib/src/vespa/searchlib/fef/featureoverrider.cpp +++ b/searchlib/src/vespa/searchlib/fef/featureoverrider.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 "featureoverrider.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/fef/fef.cpp b/searchlib/src/vespa/searchlib/fef/fef.cpp index 6a29c098479..1a4446c2a82 100644 --- a/searchlib/src/vespa/searchlib/fef/fef.cpp +++ b/searchlib/src/vespa/searchlib/fef/fef.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 "fef.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/fef/fieldinfo.cpp b/searchlib/src/vespa/searchlib/fef/fieldinfo.cpp index 234352ddb31..13d746ba5fa 100644 --- a/searchlib/src/vespa/searchlib/fef/fieldinfo.cpp +++ b/searchlib/src/vespa/searchlib/fef/fieldinfo.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 "fieldinfo.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/fef/fieldpositionsiterator.cpp b/searchlib/src/vespa/searchlib/fef/fieldpositionsiterator.cpp index 8994c9492a7..c938a427006 100644 --- a/searchlib/src/vespa/searchlib/fef/fieldpositionsiterator.cpp +++ b/searchlib/src/vespa/searchlib/fef/fieldpositionsiterator.cpp @@ -1,14 +1,12 @@ // 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 "fieldpositionsiterator.h" #include <vespa/searchlib/common/fslimits.h> namespace search { namespace fef { -const uint32_t FieldPositionsIterator::UNKNOWN_LENGTH = -SEARCHLIB_FEF_UNKNOWN_FIELD_LENGTH; +const uint32_t FieldPositionsIterator::UNKNOWN_LENGTH = SEARCHLIB_FEF_UNKNOWN_FIELD_LENGTH; } // namespace fef } // namespace search diff --git a/searchlib/src/vespa/searchlib/fef/filetablefactory.cpp b/searchlib/src/vespa/searchlib/fef/filetablefactory.cpp index c113efe33d9..6d61e1f21c6 100644 --- a/searchlib/src/vespa/searchlib/fef/filetablefactory.cpp +++ b/searchlib/src/vespa/searchlib/fef/filetablefactory.cpp @@ -1,11 +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/log/log.h> -LOG_SETUP(".fef.filetablefactory"); #include "filetablefactory.h" #include <fstream> +#include <vespa/log/log.h> +LOG_SETUP(".fef.filetablefactory"); + namespace search { namespace fef { diff --git a/searchlib/src/vespa/searchlib/fef/functiontablefactory.cpp b/searchlib/src/vespa/searchlib/fef/functiontablefactory.cpp index 55467b81cb6..ab5f1dc6b74 100644 --- a/searchlib/src/vespa/searchlib/fef/functiontablefactory.cpp +++ b/searchlib/src/vespa/searchlib/fef/functiontablefactory.cpp @@ -1,12 +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/log/log.h> -LOG_SETUP(".fef.functiontablefactory"); +#include "functiontablefactory.h" #include <boost/algorithm/string/split.hpp> #include <boost/algorithm/string/classification.hpp> #include <cmath> -#include "functiontablefactory.h" +#include <vespa/log/log.h> +LOG_SETUP(".fef.functiontablefactory"); namespace { diff --git a/searchlib/src/vespa/searchlib/fef/itermdata.h b/searchlib/src/vespa/searchlib/fef/itermdata.h index dbcb3867923..efdf394ea6e 100644 --- a/searchlib/src/vespa/searchlib/fef/itermdata.h +++ b/searchlib/src/vespa/searchlib/fef/itermdata.h @@ -2,9 +2,9 @@ #pragma once -#include "handle.h" #include "itermfielddata.h" #include <vespa/searchlib/query/weight.h> +#include <cstddef> namespace search { namespace fef { diff --git a/searchlib/src/vespa/searchlib/fef/location.cpp b/searchlib/src/vespa/searchlib/fef/location.cpp index 9bed7305a1e..34f77f02b82 100644 --- a/searchlib/src/vespa/searchlib/fef/location.cpp +++ b/searchlib/src/vespa/searchlib/fef/location.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 "location.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/fef/parameter.cpp b/searchlib/src/vespa/searchlib/fef/parameter.cpp index 583061ad383..1952967c439 100644 --- a/searchlib/src/vespa/searchlib/fef/parameter.cpp +++ b/searchlib/src/vespa/searchlib/fef/parameter.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 "parameter.h" namespace search { @@ -11,7 +10,7 @@ Parameter::Parameter(ParameterType::Enum type, const vespalib::string & value) : _stringVal(value), _doubleVal(0), _intVal(0), - _fieldVal(NULL) + _fieldVal(nullptr) { } diff --git a/searchlib/src/vespa/searchlib/fef/parameterdescriptions.cpp b/searchlib/src/vespa/searchlib/fef/parameterdescriptions.cpp index 5262a41f734..3a6e4147e81 100644 --- a/searchlib/src/vespa/searchlib/fef/parameterdescriptions.cpp +++ b/searchlib/src/vespa/searchlib/fef/parameterdescriptions.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 "parameterdescriptions.h" +#include <cassert> namespace search { namespace fef { @@ -51,5 +51,20 @@ ParameterDescriptions::desc(size_t tag) { return *this; } +void +ParameterDescriptions::addParameter(const ParamDescItem ¶m) { + assert(!_descriptions.empty()); + assert(!getCurrent().hasRepeat()); + getCurrent().addParameter(param); +} + +ParameterDescriptions & +ParameterDescriptions::repeat(size_t n) { + assert(!_descriptions.empty()); + assert(getCurrent().getParams().size() >= n); + getCurrent().setRepeat(n); + return *this; +} + } // namespace fef } // namespace search diff --git a/searchlib/src/vespa/searchlib/fef/parameterdescriptions.h b/searchlib/src/vespa/searchlib/fef/parameterdescriptions.h index d91e96b0e59..dcd2a44d75f 100644 --- a/searchlib/src/vespa/searchlib/fef/parameterdescriptions.h +++ b/searchlib/src/vespa/searchlib/fef/parameterdescriptions.h @@ -3,6 +3,7 @@ #pragma once #include <vector> +#include <cstddef> namespace search { namespace fef { @@ -99,11 +100,7 @@ private: size_t _nextTag; Description & getCurrent() { return _descriptions.back(); } - void addParameter(const ParamDescItem ¶m) { - assert(!_descriptions.empty()); - assert(!getCurrent().hasRepeat()); - getCurrent().addParameter(param); - } + void addParameter(const ParamDescItem ¶m); void addParameter(ParameterType::Enum type, ParameterCollection::Enum collection) { addParameter(ParamDescItem(type, collection)); } @@ -175,16 +172,8 @@ public: /** * Sets the repeat number on the current description. */ - ParameterDescriptions & repeat(size_t n = 1) { - assert(!_descriptions.empty()); - assert(getCurrent().getParams().size() >= n); - getCurrent().setRepeat(n); - return *this; - } + ParameterDescriptions & repeat(size_t n = 1); }; - - } // namespace fef } // namespace search - diff --git a/searchlib/src/vespa/searchlib/fef/parametervalidator.cpp b/searchlib/src/vespa/searchlib/fef/parametervalidator.cpp index 696e8a18dfc..3fb8305fcea 100644 --- a/searchlib/src/vespa/searchlib/fef/parametervalidator.cpp +++ b/searchlib/src/vespa/searchlib/fef/parametervalidator.cpp @@ -1,11 +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 <boost/lexical_cast.hpp> -#include <vespa/vespalib/util/vstringfmt.h> -#include "fieldinfo.h" -#include "fieldtype.h" #include "parametervalidator.h" +#include "fieldtype.h" +#include "fieldinfo.h" +#include <vespa/vespalib/util/vstringfmt.h> +#include <boost/lexical_cast.hpp> using vespalib::make_vespa_string; diff --git a/searchlib/src/vespa/searchlib/fef/phrasesplitter.cpp b/searchlib/src/vespa/searchlib/fef/phrasesplitter.cpp index 23f79080cd3..1a8201c2bc6 100644 --- a/searchlib/src/vespa/searchlib/fef/phrasesplitter.cpp +++ b/searchlib/src/vespa/searchlib/fef/phrasesplitter.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".fef.phrasesplitter"); #include "phrasesplitter.h" namespace search { @@ -51,7 +48,7 @@ PhraseSplitter::PhraseSplitter(const IQueryEnvironment & queryEnv, for (uint32_t i = 0; i < queryEnv.getNumTerms(); ++i) { const ITermData *td = queryEnv.getTerm(i); - LOG_ASSERT(td != NULL); + assert(td != NULL); considerTerm(i, *td, phraseTerms, fieldId); numHandles += td->numFields(); } @@ -100,7 +97,7 @@ PhraseSplitter::update() for (uint32_t i = 0; i < _copyInfo.size(); ++i) { const TermFieldMatchData *src = _matchData->resolveTermField(_copyInfo[i].orig_handle); TermFieldMatchData *dst = resolveSplittedTermField(_copyInfo[i].split_handle); - LOG_ASSERT(src != NULL && dst != NULL); + assert(src != NULL && dst != NULL); copyTermFieldMatchData(*dst, *src, _copyInfo[i].offsetInPhrase); } diff --git a/searchlib/src/vespa/searchlib/fef/queryproperties.cpp b/searchlib/src/vespa/searchlib/fef/queryproperties.cpp index a5dd5dc9229..41e8fc7053d 100644 --- a/searchlib/src/vespa/searchlib/fef/queryproperties.cpp +++ b/searchlib/src/vespa/searchlib/fef/queryproperties.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 "queryproperties.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/fef/simpletermdata.cpp b/searchlib/src/vespa/searchlib/fef/simpletermdata.cpp index 97ec1f8cca3..34a9bd63780 100644 --- a/searchlib/src/vespa/searchlib/fef/simpletermdata.cpp +++ b/searchlib/src/vespa/searchlib/fef/simpletermdata.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".fef.simpletermdata"); #include "simpletermdata.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/fef/simpletermfielddata.cpp b/searchlib/src/vespa/searchlib/fef/simpletermfielddata.cpp index 582e5e330d6..6318fd547eb 100644 --- a/searchlib/src/vespa/searchlib/fef/simpletermfielddata.cpp +++ b/searchlib/src/vespa/searchlib/fef/simpletermfielddata.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".fef.simpletermfielddata"); #include "simpletermfielddata.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/fef/symmetrictable.cpp b/searchlib/src/vespa/searchlib/fef/symmetrictable.cpp index 29818a9f416..5f5bcf71263 100644 --- a/searchlib/src/vespa/searchlib/fef/symmetrictable.cpp +++ b/searchlib/src/vespa/searchlib/fef/symmetrictable.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 "symmetrictable.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/fef/table.cpp b/searchlib/src/vespa/searchlib/fef/table.cpp index c32cd233937..f1eb23ccb7a 100644 --- a/searchlib/src/vespa/searchlib/fef/table.cpp +++ b/searchlib/src/vespa/searchlib/fef/table.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 "table.h" #include <limits> diff --git a/searchlib/src/vespa/searchlib/fef/table.h b/searchlib/src/vespa/searchlib/fef/table.h index a2203b83041..03a0310d0bf 100644 --- a/searchlib/src/vespa/searchlib/fef/table.h +++ b/searchlib/src/vespa/searchlib/fef/table.h @@ -3,9 +3,9 @@ #pragma once #include <vector> +#include <memory> -namespace search { -namespace fef { +namespace search::fef { /** * This class represents a rank table with double values. @@ -60,6 +60,4 @@ public: } }; -} // namespace fef -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.cpp b/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.cpp index e4c7d92dce4..b6bec259450 100644 --- a/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.cpp +++ b/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".fef.termfieldmatchdata"); #include "termfieldmatchdata.h" #include "fieldinfo.h" #include <algorithm> diff --git a/searchlib/src/vespa/searchlib/fef/termfieldmatchdataposition.cpp b/searchlib/src/vespa/searchlib/fef/termfieldmatchdataposition.cpp index f76c785b616..fcfa73d9456 100644 --- a/searchlib/src/vespa/searchlib/fef/termfieldmatchdataposition.cpp +++ b/searchlib/src/vespa/searchlib/fef/termfieldmatchdataposition.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".fef.termfieldmatchdataposition"); #include "termfieldmatchdataposition.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/fef/test/dummy_dependency_handler.cpp b/searchlib/src/vespa/searchlib/fef/test/dummy_dependency_handler.cpp index 7515a6338e0..f8155495e2a 100644 --- a/searchlib/src/vespa/searchlib/fef/test/dummy_dependency_handler.cpp +++ b/searchlib/src/vespa/searchlib/fef/test/dummy_dependency_handler.cpp @@ -1,7 +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 "dummy_dependency_handler.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/fef/test/indexenvironmentbuilder.cpp b/searchlib/src/vespa/searchlib/fef/test/indexenvironmentbuilder.cpp index dbe3ea52078..c173cb474e7 100644 --- a/searchlib/src/vespa/searchlib/fef/test/indexenvironmentbuilder.cpp +++ b/searchlib/src/vespa/searchlib/fef/test/indexenvironmentbuilder.cpp @@ -1,5 +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 "indexenvironmentbuilder.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/fef/test/plugin/cfgvalue.cpp b/searchlib/src/vespa/searchlib/fef/test/plugin/cfgvalue.cpp index ce0878c7306..96075188fc6 100644 --- a/searchlib/src/vespa/searchlib/fef/test/plugin/cfgvalue.cpp +++ b/searchlib/src/vespa/searchlib/fef/test/plugin/cfgvalue.cpp @@ -1,12 +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/log/log.h> -LOG_SETUP(".fef.cfgvalue"); - +#include "cfgvalue.h" #include <vespa/searchlib/fef/properties.h> #include <sstream> -#include "cfgvalue.h" namespace search { namespace fef { diff --git a/searchlib/src/vespa/searchlib/fef/test/plugin/chain.cpp b/searchlib/src/vespa/searchlib/fef/test/plugin/chain.cpp index f79209270b8..7e6aabeebf1 100644 --- a/searchlib/src/vespa/searchlib/fef/test/plugin/chain.cpp +++ b/searchlib/src/vespa/searchlib/fef/test/plugin/chain.cpp @@ -1,10 +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/log/log.h> -LOG_SETUP(".fef.chain"); #include "chain.h" - #include <sstream> namespace search { diff --git a/searchlib/src/vespa/searchlib/fef/test/plugin/double.cpp b/searchlib/src/vespa/searchlib/fef/test/plugin/double.cpp index 5fe7539b834..82d4e4e8865 100644 --- a/searchlib/src/vespa/searchlib/fef/test/plugin/double.cpp +++ b/searchlib/src/vespa/searchlib/fef/test/plugin/double.cpp @@ -1,12 +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/log/log.h> -LOG_SETUP(".fef.double"); #include "double.h" - -#include <vespa/vespalib/stllike/asciistream.h> #include <vespa/searchlib/fef/featurenamebuilder.h> +#include <vespa/vespalib/stllike/asciistream.h> namespace search { namespace fef { diff --git a/searchlib/src/vespa/searchlib/fef/test/plugin/query.cpp b/searchlib/src/vespa/searchlib/fef/test/plugin/query.cpp index 60fafd8ae90..6a2fc8c64ac 100644 --- a/searchlib/src/vespa/searchlib/fef/test/plugin/query.cpp +++ b/searchlib/src/vespa/searchlib/fef/test/plugin/query.cpp @@ -1,13 +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> -LOG_SETUP(".fef.query"); - +#include "query.h" #include <vespa/searchlib/features/valuefeature.h> #include <vespa/searchlib/fef/properties.h> #include <sstream> -#include "query.h" namespace search { namespace fef { diff --git a/searchlib/src/vespa/searchlib/fef/test/plugin/setup.cpp b/searchlib/src/vespa/searchlib/fef/test/plugin/setup.cpp index 94a74947cea..8ca6692360d 100644 --- a/searchlib/src/vespa/searchlib/fef/test/plugin/setup.cpp +++ b/searchlib/src/vespa/searchlib/fef/test/plugin/setup.cpp @@ -1,12 +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/log/log.h> -LOG_SETUP(".fef.setup"); - -#include <vespa/searchlib/fef/blueprint.h> -#include <string> - #include "cfgvalue.h" #include "chain.h" #include "double.h" @@ -14,6 +7,7 @@ LOG_SETUP(".fef.setup"); #include "setup.h" #include "staticrank.h" #include "sum.h" +#include <vespa/searchlib/fef/blueprint.h> namespace search { namespace fef { diff --git a/searchlib/src/vespa/searchlib/fef/test/plugin/staticrank.cpp b/searchlib/src/vespa/searchlib/fef/test/plugin/staticrank.cpp index 238f0ca0dd4..003fc3c0a5a 100644 --- a/searchlib/src/vespa/searchlib/fef/test/plugin/staticrank.cpp +++ b/searchlib/src/vespa/searchlib/fef/test/plugin/staticrank.cpp @@ -1,10 +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 <vespa/log/log.h> -LOG_SETUP(".fef.staticrank"); -#include <vespa/searchcommon/attribute/attributecontent.h> #include "staticrank.h" +#include <vespa/searchcommon/attribute/attributecontent.h> namespace search { namespace fef { diff --git a/searchlib/src/vespa/searchlib/fef/test/plugin/sum.cpp b/searchlib/src/vespa/searchlib/fef/test/plugin/sum.cpp index 2e20ea12efe..775d2203915 100644 --- a/searchlib/src/vespa/searchlib/fef/test/plugin/sum.cpp +++ b/searchlib/src/vespa/searchlib/fef/test/plugin/sum.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".fef.sum"); #include "sum.h" #include <vespa/searchlib/fef/featurenamebuilder.h> diff --git a/searchlib/src/vespa/searchlib/fef/test/queryenvironmentbuilder.cpp b/searchlib/src/vespa/searchlib/fef/test/queryenvironmentbuilder.cpp index 7db5110e627..107ad9914b2 100644 --- a/searchlib/src/vespa/searchlib/fef/test/queryenvironmentbuilder.cpp +++ b/searchlib/src/vespa/searchlib/fef/test/queryenvironmentbuilder.cpp @@ -1,5 +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 "queryenvironmentbuilder.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/fef/test/rankresult.cpp b/searchlib/src/vespa/searchlib/fef/test/rankresult.cpp index 218153db489..167f569995f 100644 --- a/searchlib/src/vespa/searchlib/fef/test/rankresult.cpp +++ b/searchlib/src/vespa/searchlib/fef/test/rankresult.cpp @@ -1,10 +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/log/log.h> -LOG_SETUP(".fef.rankresult"); #include "rankresult.h" #include <cmath> -#include <iostream> +#include <ostream> + +#include <vespa/log/log.h> +LOG_SETUP(".fef.rankresult"); namespace search { namespace fef { diff --git a/searchlib/src/vespa/searchlib/fef/utils.cpp b/searchlib/src/vespa/searchlib/fef/utils.cpp index 70396857759..06eed77a3a9 100644 --- a/searchlib/src/vespa/searchlib/fef/utils.cpp +++ b/searchlib/src/vespa/searchlib/fef/utils.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 "utils.h" #include <vector> diff --git a/searchlib/src/vespa/searchlib/fef/verify_feature.cpp b/searchlib/src/vespa/searchlib/fef/verify_feature.cpp index ebfdf1622ba..e2fa8faa5b8 100644 --- a/searchlib/src/vespa/searchlib/fef/verify_feature.cpp +++ b/searchlib/src/vespa/searchlib/fef/verify_feature.cpp @@ -1,11 +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/log/log.h> -LOG_SETUP(".fef.verify_feature"); #include "verify_feature.h" #include "blueprintresolver.h" +#include <vespa/log/log.h> +LOG_SETUP(".fef.verify_feature"); + namespace search { namespace fef { diff --git a/searchlib/src/vespa/searchlib/grouping/groupandcollectengine.cpp b/searchlib/src/vespa/searchlib/grouping/groupandcollectengine.cpp index 6f06960d5c5..554737cc481 100644 --- a/searchlib/src/vespa/searchlib/grouping/groupandcollectengine.cpp +++ b/searchlib/src/vespa/searchlib/grouping/groupandcollectengine.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 <vespa/searchlib/grouping/groupandcollectengine.h> +#include "groupandcollectengine.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/grouping/groupingengine.cpp b/searchlib/src/vespa/searchlib/grouping/groupingengine.cpp index a8f12ce9fd4..010d947590e 100644 --- a/searchlib/src/vespa/searchlib/grouping/groupingengine.cpp +++ b/searchlib/src/vespa/searchlib/grouping/groupingengine.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 <vespa/searchlib/grouping/groupingengine.h> -#include <vespa/searchlib/grouping/groupandcollectengine.h> + +#include "groupingengine.h" +#include "groupandcollectengine.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/index/dummyfileheadercontext.cpp b/searchlib/src/vespa/searchlib/index/dummyfileheadercontext.cpp index 9256feeae26..6d7dace1f8c 100644 --- a/searchlib/src/vespa/searchlib/index/dummyfileheadercontext.cpp +++ b/searchlib/src/vespa/searchlib/index/dummyfileheadercontext.cpp @@ -1,18 +1,12 @@ // 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> -LOG_SETUP(".index.dummyfileheadercontext"); #include "dummyfileheadercontext.h" #include <vespa/vespalib/data/fileheader.h> #include <vespa/searchlib/util/fileheadertk.h> #include <vespa/vespalib/util/host_name.h> +#include <unistd.h> -namespace search -{ - -namespace index -{ +namespace search::index { vespalib::string DummyFileHeaderContext::_creator; @@ -65,7 +59,4 @@ DummyFileHeaderContext::setCreator(const vespalib::string &creator) _creator = creator; } - -} // namespace index - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/index/indexbuilder.cpp b/searchlib/src/vespa/searchlib/index/indexbuilder.cpp index 8168bb62175..6ab25c1cce1 100644 --- a/searchlib/src/vespa/searchlib/index/indexbuilder.cpp +++ b/searchlib/src/vespa/searchlib/index/indexbuilder.cpp @@ -1,28 +1,13 @@ // 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> -LOG_SETUP(".index.indexbuilder"); #include "indexbuilder.h" -namespace search -{ - -namespace index -{ - +namespace search::index { IndexBuilder::IndexBuilder(const Schema &schema) : _schema(schema) -{ -} +{ } +IndexBuilder::~IndexBuilder() { } -IndexBuilder::~IndexBuilder() -{ } - - -} // namespace index - -} // namespace search diff --git a/searchlib/src/vespa/searchlib/index/olddictionaryfile.cpp b/searchlib/src/vespa/searchlib/index/olddictionaryfile.cpp index b2aa74ddcc4..774b373115f 100644 --- a/searchlib/src/vespa/searchlib/index/olddictionaryfile.cpp +++ b/searchlib/src/vespa/searchlib/index/olddictionaryfile.cpp @@ -1,16 +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/log/log.h> -LOG_SETUP(".index.dictionaryfile"); #include "olddictionaryfile.h" -namespace search -{ - -namespace index -{ - +namespace search::index { OldDictionaryIndexMapping::OldDictionaryIndexMapping() : _fieldIdToLocalId(), @@ -109,7 +101,4 @@ OldDictionaryFileSeqWrite::~OldDictionaryFileSeqWrite() { } - -} // namespace index - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/index/postinglistcountfile.cpp b/searchlib/src/vespa/searchlib/index/postinglistcountfile.cpp index ff218860237..314476628a1 100644 --- a/searchlib/src/vespa/searchlib/index/postinglistcountfile.cpp +++ b/searchlib/src/vespa/searchlib/index/postinglistcountfile.cpp @@ -1,15 +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/log/log.h> -LOG_SETUP(".index.postinglistcountfile"); #include "postinglistcountfile.h" -namespace search -{ - -namespace index -{ +namespace search::index { PostingListCountFileSeqRead::PostingListCountFileSeqRead() { @@ -54,7 +47,4 @@ getParams(PostingListParams ¶ms) params.clear(); } - -} // namespace index - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/index/postinglistcounts.cpp b/searchlib/src/vespa/searchlib/index/postinglistcounts.cpp index 8268b1e5c64..2679e33f2c2 100644 --- a/searchlib/src/vespa/searchlib/index/postinglistcounts.cpp +++ b/searchlib/src/vespa/searchlib/index/postinglistcounts.cpp @@ -1,16 +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> -LOG_SETUP(".index.postinglistcounts"); #include <vespa/vespalib/objects/nbostream.h> #include "postinglistcounts.h" -namespace search -{ - -namespace index -{ +namespace search::index { void swap(PostingListCounts & a, PostingListCounts & b) { @@ -84,7 +77,4 @@ operator>>(nbostream &in, PostingListOffsetAndCounts &offsetAndCounts) return in; } - -} // namespace index - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/index/postinglistfile.cpp b/searchlib/src/vespa/searchlib/index/postinglistfile.cpp index 25443440a94..dc04b3fe716 100644 --- a/searchlib/src/vespa/searchlib/index/postinglistfile.cpp +++ b/searchlib/src/vespa/searchlib/index/postinglistfile.cpp @@ -1,15 +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> -LOG_SETUP(".index.postinglistfile"); #include "postinglistfile.h" +#include <vespa/fastos/file.h> -namespace search -{ - -namespace index -{ +namespace search::index { PostingListFileSeqRead::PostingListFileSeqRead() : _counts(), @@ -164,7 +158,4 @@ PostingListFileRandReadPassThrough::close() return _lower->close(); } - -} // namespace index - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/index/postinglistparams.cpp b/searchlib/src/vespa/searchlib/index/postinglistparams.cpp index be585e8aa60..ed0ed3eeee2 100644 --- a/searchlib/src/vespa/searchlib/index/postinglistparams.cpp +++ b/searchlib/src/vespa/searchlib/index/postinglistparams.cpp @@ -1,23 +1,15 @@ // 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> -LOG_SETUP(".index.postinglistparams"); #include "postinglistparams.h" #include <sstream> -namespace -{ +namespace { vespalib::string empty; } -namespace search -{ - -namespace index -{ +namespace search::index { bool PostingListParams::isSet(const vespalib::string &key) const @@ -133,6 +125,4 @@ template void PostingListParams::get<uint64_t>(const vespalib::string &key, uint64_t &val) const; -} // namespace index - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/index/schemautil.cpp b/searchlib/src/vespa/searchlib/index/schemautil.cpp index 52c5a1caee4..544bb5f8a3c 100644 --- a/searchlib/src/vespa/searchlib/index/schemautil.cpp +++ b/searchlib/src/vespa/searchlib/index/schemautil.cpp @@ -1,15 +1,13 @@ // 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 <fstream> #include "schemautil.h" #include <set> -LOG_SETUP(".index.schemautil"); +#include <fstream> -namespace search { +#include <vespa/log/log.h> +LOG_SETUP(".index.schemautil"); -namespace index { +namespace search::index { using schema::DataType; @@ -207,6 +205,4 @@ SchemaUtil::getIndexIds(const Schema &schema, return true; } - -} // namespace search::index -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/memoryindex/dictionary.cpp b/searchlib/src/vespa/searchlib/memoryindex/dictionary.cpp index e013384f935..063f177fd18 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/dictionary.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/dictionary.cpp @@ -1,11 +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 <vespa/log/log.h> -#include <vespa/vespalib/util/stringfmt.h> -#include <vespa/vespalib/util/exceptions.h> #include "dictionary.h" - +#include "fieldinverter.h" #include <vespa/searchlib/bitcompression/posocccompression.h> #include <vespa/searchlib/btree/btreenode.hpp> @@ -15,9 +11,9 @@ #include <vespa/searchlib/btree/btreeiterator.hpp> #include <vespa/searchlib/btree/btreeroot.hpp> #include <vespa/searchlib/btree/btree.hpp> -#include "fieldinverter.h" +#include <vespa/vespalib/util/stringfmt.h> +#include <vespa/vespalib/util/exceptions.h> -LOG_SETUP(".memoryindex.dictionary"); namespace search { diff --git a/searchlib/src/vespa/searchlib/memoryindex/document_remover.cpp b/searchlib/src/vespa/searchlib/memoryindex/document_remover.cpp index 3c9c8bb6ac4..bf20415843d 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/document_remover.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/document_remover.cpp @@ -1,13 +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 "document_remover.h" #include "i_document_remove_listener.h" #include "wordstore.h" #include <vespa/searchlib/common/sort.h> -LOG_SETUP(".memoryindex.document_remover"); - namespace search { namespace memoryindex { diff --git a/searchlib/src/vespa/searchlib/memoryindex/documentinverter.cpp b/searchlib/src/vespa/searchlib/memoryindex/documentinverter.cpp index 7e6d2a998d5..0cb5a6377c3 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/documentinverter.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/documentinverter.cpp @@ -1,7 +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 "documentinverter.h" +#include "fieldinverter.h" +#include "urlfieldinverter.h" +#include "dictionary.h" +#include "ordereddocumentinserter.h" #include <vespa/document/datatype/urldatatype.h> #include <vespa/document/annotation/alternatespanlist.h> #include <vespa/searchlib/util/url.h> @@ -10,19 +13,12 @@ #include <vespa/vespalib/text/lowercase.h> #include <vespa/searchlib/common/sort.h> #include <vespa/document/repo/fixedtyperepo.h> -#include "fieldinverter.h" -#include "urlfieldinverter.h" -#include "dictionary.h" -#include "ordereddocumentinserter.h" #include <vespa/searchlib/common/isequencedtaskexecutor.h> #include <vespa/log/log.h> -LOG_SETUP(".memoryindex.documentinverter"); -namespace search -{ +LOG_SETUP(".memoryindex.documentinverter"); -namespace memoryindex -{ +namespace search::memoryindex { using document::Field; using document::FieldValue; @@ -208,8 +204,5 @@ DocumentInverter::pushDocuments(Dictionary &dict, } } - -} // namespace memoryindex - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/memoryindex/featurestore.cpp b/searchlib/src/vespa/searchlib/memoryindex/featurestore.cpp index 363029ecedf..403c9f7da96 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/featurestore.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/featurestore.cpp @@ -1,17 +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/log/log.h> -LOG_SETUP(".memoryindex.featurestore"); #include "featurestore.h" #include <vespa/searchlib/index/schemautil.h> #include <vespa/searchlib/datastore/datastore.hpp> -namespace search -{ - -namespace memoryindex -{ +namespace search::memoryindex { constexpr size_t MIN_CLUSTERS = 1024u; @@ -155,8 +148,4 @@ FeatureStore::moveFeatures(uint32_t packedIndex, return moveFeatures(ref, bitLen); } - -} // namespace memoryindex - - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/memoryindex/fieldinverter.cpp b/searchlib/src/vespa/searchlib/memoryindex/fieldinverter.cpp index cd8265a46fe..e635256a030 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/fieldinverter.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/fieldinverter.cpp @@ -1,14 +1,13 @@ // 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 "fieldinverter.h" +#include "ordereddocumentinserter.h" #include <vespa/document/datatype/urldatatype.h> #include <vespa/searchlib/util/url.h> #include <stdexcept> #include <vespa/vespalib/text/utf8.h> #include <vespa/vespalib/text/lowercase.h> #include <vespa/searchlib/common/sort.h> -#include "ordereddocumentinserter.h" #include <vespa/searchlib/bitcompression/compression.h> #include <vespa/searchlib/bitcompression/posocccompression.h> #include <vespa/document/annotation/annotation.h> diff --git a/searchlib/src/vespa/searchlib/memoryindex/iordereddocumentinserter.h b/searchlib/src/vespa/searchlib/memoryindex/iordereddocumentinserter.h index aef68b62d23..0218f45529a 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/iordereddocumentinserter.h +++ b/searchlib/src/vespa/searchlib/memoryindex/iordereddocumentinserter.h @@ -2,21 +2,23 @@ #pragma once -namespace search -{ +#include <vespa/vespalib/stllike/string.h> +#include <cstdint> -namespace memoryindex -{ +namespace search { + +namespace index { class DocIdAndFeatures; } + +namespace memoryindex { /** * Interface class for ordered document inserter. * * Insert order must be properly sorted, by (word, docId) */ -class IOrderedDocumentInserter -{ +class IOrderedDocumentInserter { public: - virtual ~IOrderedDocumentInserter() { } + virtual ~IOrderedDocumentInserter() {} /** * Set next word to operate on. @@ -26,8 +28,7 @@ public: /** * Add (word, docId) tuple with given features. */ - virtual void add(uint32_t docId, - const index::DocIdAndFeatures &features) = 0; + virtual void add(uint32_t docId, const index::DocIdAndFeatures &features) = 0; /** * Remove (word, docId) tuple. @@ -48,5 +49,4 @@ public: }; } - } diff --git a/searchlib/src/vespa/searchlib/memoryindex/ordereddocumentinserter.cpp b/searchlib/src/vespa/searchlib/memoryindex/ordereddocumentinserter.cpp index d65dbdf5910..e79032718af 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/ordereddocumentinserter.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/ordereddocumentinserter.cpp @@ -1,13 +1,12 @@ // 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 <vespa/vespalib/stllike/string.h> +#include "ordereddocumentinserter.h" +#include "i_document_insert_listener.h" + #include <vespa/searchlib/index/docidandfeatures.h> +#include <vespa/vespalib/stllike/string.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/util/exceptions.h> -#include "ordereddocumentinserter.h" -#include "i_document_insert_listener.h" #include <vespa/searchlib/btree/btreenode.hpp> #include <vespa/searchlib/btree/btreenodeallocator.hpp> @@ -17,22 +16,14 @@ #include <vespa/searchlib/btree/btreeroot.hpp> #include <vespa/searchlib/btree/btree.hpp> -LOG_SETUP(".memoryindex.orderedfieldinserter"); - -namespace search -{ - -namespace memoryindex -{ +namespace search::memoryindex { -namespace -{ +namespace { const vespalib::string emptyWord = ""; } - OrderedDocumentInserter::OrderedDocumentInserter(MemoryFieldIndex &fieldIndex) : _word(), _prevDocId(noDocId), @@ -152,7 +143,4 @@ OrderedDocumentInserter::getWordRef() const return _dItr.getKey()._wordRef; } - -} - } diff --git a/searchlib/src/vespa/searchlib/memoryindex/urlfieldinverter.cpp b/searchlib/src/vespa/searchlib/memoryindex/urlfieldinverter.cpp index ab59718d064..117f69b7954 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/urlfieldinverter.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/urlfieldinverter.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 "urlfieldinverter.h" #include "fieldinverter.h" #include <vespa/document/datatype/urldatatype.h> @@ -9,6 +8,7 @@ #include <vespa/vespalib/text/utf8.h> #include <vespa/vespalib/text/lowercase.h> #include <vespa/searchlib/common/sort.h> + #include <vespa/log/log.h> LOG_SETUP(".memoryindex.urlfieldinverter"); diff --git a/searchlib/src/vespa/searchlib/memoryindex/wordstore.cpp b/searchlib/src/vespa/searchlib/memoryindex/wordstore.cpp index 750da341c98..db76226c697 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/wordstore.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/wordstore.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".memoryindex.wordstore"); #include "wordstore.h" #include <vespa/searchlib/datastore/datastore.hpp> diff --git a/searchlib/src/vespa/searchlib/parsequery/parse.cpp b/searchlib/src/vespa/searchlib/parsequery/parse.cpp index b4f72c61f0d..591adf9188a 100644 --- a/searchlib/src/vespa/searchlib/parsequery/parse.cpp +++ b/searchlib/src/vespa/searchlib/parsequery/parse.cpp @@ -1,7 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/searchlib/parsequery/parse.h> +#include "parse.h" #include <vespa/vespalib/objects/nbo.h> +#include <cassert> namespace search { diff --git a/searchlib/src/vespa/searchlib/parsequery/simplequerystack.cpp b/searchlib/src/vespa/searchlib/parsequery/simplequerystack.cpp index 8103ccfa289..61fdc4e4ff1 100644 --- a/searchlib/src/vespa/searchlib/parsequery/simplequerystack.cpp +++ b/searchlib/src/vespa/searchlib/parsequery/simplequerystack.cpp @@ -7,13 +7,12 @@ * Copyright (C) 2003 Overture Services Norway AS * ALL RIGHTS RESERVED */ -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> +#include "simplequerystack.h" #include <vespa/vespalib/util/vstringfmt.h> #include <vespa/vespalib/util/compress.h> #include <vespa/vespalib/objects/nbo.h> -#include <vespa/searchlib/parsequery/simplequerystack.h> +#include <vespa/log/log.h> LOG_SETUP(".search.simplequerystack"); using vespalib::make_vespa_string; @@ -299,7 +298,7 @@ SimpleQueryStack::StackbufToString(const vespalib::stringref &theBuf) vespalib::string key = ReadString(p); vespalib::string value = ReadString(p); uint64_t sub_queries = ReadUint64(p); - result.append(make_vespa_string("%s:%s:%" PRIx64, key.c_str(), value.c_str(), sub_queries)); + result.append(make_vespa_string("%s:%s:%lx", key.c_str(), value.c_str(), sub_queries)); if (i < feature_count - 1) { result.append(','); } @@ -311,7 +310,7 @@ SimpleQueryStack::StackbufToString(const vespalib::stringref &theBuf) vespalib::string key = ReadString(p); uint64_t value = ReadUint64(p); uint64_t sub_queries = ReadUint64(p); - result.append(make_vespa_string("%s:%" PRIu64 ":%" PRIx64, key.c_str(), value, sub_queries)); + result.append(make_vespa_string("%s:%zu:%lx", key.c_str(), value, sub_queries)); if (i < range_feature_count - 1) { result.append(','); } diff --git a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp index 17e1cc16baa..f406f8a70c9 100644 --- a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp +++ b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp @@ -6,11 +6,10 @@ * Copyright (C) 2003 Overture Services Norway AS * ALL RIGHTS RESERVED */ -#include <vespa/fastos/fastos.h> -#include <vespa/searchlib/parsequery/stackdumpiterator.h> -#include <vespa/searchlib/util/rawbuf.h> +#include "stackdumpiterator.h" #include <vespa/vespalib/util/compress.h> #include <vespa/vespalib/objects/nbo.h> +#include <cassert> using search::query::PredicateQueryTerm; diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_interval_store.cpp b/searchlib/src/vespa/searchlib/predicate/predicate_interval_store.cpp index 7bb3a2abbcf..5970f565783 100644 --- a/searchlib/src/vespa/searchlib/predicate/predicate_interval_store.cpp +++ b/searchlib/src/vespa/searchlib/predicate/predicate_interval_store.cpp @@ -1,15 +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 "predicate_interval_store.h" #include "predicate_index.h" #include <vespa/searchlib/datastore/bufferstate.h> #include <vespa/searchlib/datastore/datastore.hpp> #include <vespa/searchlib/datastore/entryref.h> -#include <vespa/log/log.h> -LOG_SETUP(".predicate_interval_store"); using search::datastore::BufferState; using search::datastore::EntryRef; diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_range_expander.cpp b/searchlib/src/vespa/searchlib/predicate/predicate_range_expander.cpp index 16052ec41d0..c970882bffc 100644 --- a/searchlib/src/vespa/searchlib/predicate/predicate_range_expander.cpp +++ b/searchlib/src/vespa/searchlib/predicate/predicate_range_expander.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 "predicate_range_expander.h" + #include <vespa/log/log.h> LOG_SETUP(".predicate_range_expander"); diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_ref_cache.h b/searchlib/src/vespa/searchlib/predicate/predicate_ref_cache.h index 9aae296311a..7393cf40947 100644 --- a/searchlib/src/vespa/searchlib/predicate/predicate_ref_cache.h +++ b/searchlib/src/vespa/searchlib/predicate/predicate_ref_cache.h @@ -4,6 +4,8 @@ #pragma once #include <set> +#include <cstdint> +#include <cassert> namespace search { namespace predicate { diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_tree_analyzer.cpp b/searchlib/src/vespa/searchlib/predicate/predicate_tree_analyzer.cpp index 41d754c6649..9823f984a1b 100644 --- a/searchlib/src/vespa/searchlib/predicate/predicate_tree_analyzer.cpp +++ b/searchlib/src/vespa/searchlib/predicate/predicate_tree_analyzer.cpp @@ -1,15 +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 "predicate_tree_analyzer.h" #include <vespa/document/predicate/predicate.h> #include <algorithm> #include <iostream> #include <cmath> -#include <vespa/log/log.h> - -LOG_SETUP(".predicate_tree_analyzer"); using document::Predicate; using std::map; diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_zero_constraint_posting_list.cpp b/searchlib/src/vespa/searchlib/predicate/predicate_zero_constraint_posting_list.cpp index 4ca88d5b4b8..d0803bd4d64 100644 --- a/searchlib/src/vespa/searchlib/predicate/predicate_zero_constraint_posting_list.cpp +++ b/searchlib/src/vespa/searchlib/predicate/predicate_zero_constraint_posting_list.cpp @@ -1,10 +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 "predicate_zero_constraint_posting_list.h" -#include <vespa/log/log.h> -LOG_SETUP(".predicate_zero_constraint_posting_list"); namespace search { namespace predicate { diff --git a/searchlib/src/vespa/searchlib/queryeval/booleanmatchiteratorwrapper.cpp b/searchlib/src/vespa/searchlib/queryeval/booleanmatchiteratorwrapper.cpp index 9c3dec5c1b2..c029dcdc13a 100644 --- a/searchlib/src/vespa/searchlib/queryeval/booleanmatchiteratorwrapper.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/booleanmatchiteratorwrapper.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 "booleanmatchiteratorwrapper.h" #include <vespa/searchlib/fef/termfieldmatchdata.h> #include <vespa/searchlib/fef/termfieldmatchdataarray.h> diff --git a/searchlib/src/vespa/searchlib/queryeval/create-class-cpp.sh b/searchlib/src/vespa/searchlib/queryeval/create-class-cpp.sh index 728ab7a11ce..d25e2a84754 100755 --- a/searchlib/src/vespa/searchlib/queryeval/create-class-cpp.sh +++ b/searchlib/src/vespa/searchlib/queryeval/create-class-cpp.sh @@ -8,13 +8,9 @@ name=`echo $class | tr 'A-Z' 'a-z'` cat <<EOF // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/log/log.h> -LOG_SETUP(".$name"); -#include <vespa/fastos/fastos.h> #include "$name.h" -namespace search { -namespace queryeval { +namespace search::queryeval { $class::$class() { @@ -24,6 +20,5 @@ $class::~$class() { } -} // namespace queryeval -} // namespace search +} EOF diff --git a/searchlib/src/vespa/searchlib/queryeval/document_weight_search_iterator.cpp b/searchlib/src/vespa/searchlib/queryeval/document_weight_search_iterator.cpp index 9f876e788bf..947ae6720f5 100644 --- a/searchlib/src/vespa/searchlib/queryeval/document_weight_search_iterator.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/document_weight_search_iterator.cpp @@ -1,4 +1,3 @@ // 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 "document_weight_search_iterator.h" diff --git a/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.cpp index 015b3f25499..7554883cce8 100644 --- a/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.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 "dot_product_blueprint.h" #include "dot_product_search.h" #include <vespa/searchlib/fef/termfieldmatchdata.h> diff --git a/searchlib/src/vespa/searchlib/queryeval/emptysearch.cpp b/searchlib/src/vespa/searchlib/queryeval/emptysearch.cpp index b500e977848..475686d550e 100644 --- a/searchlib/src/vespa/searchlib/queryeval/emptysearch.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/emptysearch.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 "emptysearch.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.cpp index 30ae5e023ef..070d4b80f0b 100644 --- a/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.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 "equiv_blueprint.h" #include "equivsearch.h" #include <vespa/vespalib/objects/visit.hpp> diff --git a/searchlib/src/vespa/searchlib/queryeval/fake_search.cpp b/searchlib/src/vespa/searchlib/queryeval/fake_search.cpp index 85946e1a758..cf8d81747e8 100644 --- a/searchlib/src/vespa/searchlib/queryeval/fake_search.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/fake_search.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> -LOG_SETUP(".fakesearch"); -#include <vespa/vespalib/objects/visit.h> #include "fake_search.h" #include <vespa/searchlib/fef/termfieldmatchdataposition.h> #include <vespa/searchlib/fef/termfieldmatchdata.h> +#include <vespa/vespalib/objects/visit.h> namespace search { namespace queryeval { diff --git a/searchlib/src/vespa/searchlib/queryeval/field_spec.cpp b/searchlib/src/vespa/searchlib/queryeval/field_spec.cpp index 60cdefab2c1..caa7c364b06 100644 --- a/searchlib/src/vespa/searchlib/queryeval/field_spec.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/field_spec.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".fieldspec"); #include "field_spec.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.cpp b/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.cpp index b7e9cb8efc3..e39e27c0bf9 100644 --- a/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".queryeval.leaf_blueprints"); #include "leaf_blueprints.h" #include "emptysearch.h" #include "simplesearch.h" diff --git a/searchlib/src/vespa/searchlib/queryeval/monitoring_dump_iterator.cpp b/searchlib/src/vespa/searchlib/queryeval/monitoring_dump_iterator.cpp index 198634c56a9..d78e5ae2eb7 100644 --- a/searchlib/src/vespa/searchlib/queryeval/monitoring_dump_iterator.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/monitoring_dump_iterator.cpp @@ -1,8 +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 "monitoring_dump_iterator.h" #include <vespa/log/log.h> LOG_SETUP(".queryeval.monitoring_dump_iterator"); -#include "monitoring_dump_iterator.h" namespace search { namespace queryeval { diff --git a/searchlib/src/vespa/searchlib/queryeval/multisearch.cpp b/searchlib/src/vespa/searchlib/queryeval/multisearch.cpp index 3ba06875441..41ebca00b09 100644 --- a/searchlib/src/vespa/searchlib/queryeval/multisearch.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/multisearch.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 "multisearch.h" #include <vespa/vespalib/objects/visit.hpp> diff --git a/searchlib/src/vespa/searchlib/queryeval/nearsearch.cpp b/searchlib/src/vespa/searchlib/queryeval/nearsearch.cpp index b33ab946acc..c39ed08982e 100644 --- a/searchlib/src/vespa/searchlib/queryeval/nearsearch.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/nearsearch.cpp @@ -1,14 +1,13 @@ // 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> -LOG_SETUP(".nearsearch"); - #include "nearsearch.h" #include <vespa/vespalib/objects/visit.h> #include <vespa/vespalib/util/priority_queue.h> #include <limits> #include <set> +#include <vespa/log/log.h> +LOG_SETUP(".nearsearch"); + namespace search { namespace queryeval { diff --git a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.cpp index cce2f22797b..449523b0da5 100644 --- a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.cpp @@ -1,10 +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 "simple_phrase_blueprint.h" #include "simple_phrase_search.h" #include <vespa/searchlib/fef/termfieldmatchdata.h> -#include <vespa/searchlib/queryeval/searchiterator.h> #include <vespa/vespalib/objects/visit.hpp> #include <algorithm> #include <map> diff --git a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_search.cpp b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_search.cpp index 9a624724933..686bf3608e7 100644 --- a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_search.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_search.cpp @@ -1,9 +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/log/log.h> -LOG_SETUP(".simple_phrase_search"); - #include "simple_phrase_search.h" #include <vespa/searchlib/fef/termfieldmatchdata.h> #include <vespa/vespalib/objects/visit.h> diff --git a/searchlib/src/vespa/searchlib/queryeval/simpleresult.cpp b/searchlib/src/vespa/searchlib/queryeval/simpleresult.cpp index f114eef8b39..20e3f482b62 100644 --- a/searchlib/src/vespa/searchlib/queryeval/simpleresult.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/simpleresult.cpp @@ -1,9 +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/log/log.h> -LOG_SETUP(".simpleresult"); #include "simpleresult.h" +#include <cassert> +#include <ostream> namespace search { namespace queryeval { diff --git a/searchlib/src/vespa/searchlib/queryeval/simplesearch.cpp b/searchlib/src/vespa/searchlib/queryeval/simplesearch.cpp index 2d5b6b3e8b8..17641b38634 100644 --- a/searchlib/src/vespa/searchlib/queryeval/simplesearch.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/simplesearch.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".simplesearch"); #include "simplesearch.h" #include <vespa/vespalib/objects/visit.h> diff --git a/searchlib/src/vespa/searchlib/queryeval/split_float.cpp b/searchlib/src/vespa/searchlib/queryeval/split_float.cpp index dd6a370ceda..f4a4c231871 100644 --- a/searchlib/src/vespa/searchlib/queryeval/split_float.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/split_float.cpp @@ -1,9 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// $Id$ -#include <vespa/fastos/fastos.h> #include "split_float.h" -#include <ctype.h> +#include <cctype> namespace search { namespace queryeval { diff --git a/searchlib/src/vespa/searchlib/queryeval/truesearch.cpp b/searchlib/src/vespa/searchlib/queryeval/truesearch.cpp index 0c808ce06f2..bbc604db772 100644 --- a/searchlib/src/vespa/searchlib/queryeval/truesearch.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/truesearch.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 "truesearch.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.cpp index d92ed9007bd..96ddaae1b03 100644 --- a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.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 "wand_parts.h" #include "parallel_weak_and_blueprint.h" #include "parallel_weak_and_search.h" diff --git a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_search.cpp b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_search.cpp index 05a2d7d6822..4250f424d32 100644 --- a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_search.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_search.cpp @@ -1,16 +1,13 @@ // 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> -LOG_SETUP(".queryeval.parallel_weak_and_search"); + #include "parallel_weak_and_search.h" +#include <vespa/searchlib/queryeval/document_weight_search_iterator.h> #include <vespa/searchlib/queryeval/monitoring_dump_iterator.h> -#include <vespa/searchlib/queryeval/monitoring_search_iterator.h> -#include "wand_parts.h" -#include <vespa/vespalib/objects/visit.h> -#include <vespa/vespalib/util/stringfmt.h> -#include <vespa/searchlib/queryeval/emptysearch.h> #include <vespa/searchlib/fef/matchdatalayout.h> -#include <vespa/searchlib/queryeval/document_weight_search_iterator.h> +#include <vespa/vespalib/objects/visit.h> + +#include <vespa/log/log.h> +LOG_SETUP(".queryeval.parallel_weak_and_search"); using vespalib::make_string; diff --git a/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_search.cpp b/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_search.cpp index 2fe27f8504b..af3e0b866f1 100644 --- a/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_search.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_search.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 "wand_parts.h" #include "weak_and_search.h" #include <vespa/searchlib/queryeval/orsearch.h> diff --git a/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute_saver.cpp b/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute_saver.cpp index 7daec1159ca..d449ff3ee28 100644 --- a/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute_saver.cpp +++ b/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute_saver.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 "dense_tensor_attribute_saver.h" #include <vespa/searchlib/util/bufferwriter.h> #include "dense_tensor_store.h" diff --git a/searchlib/src/vespa/searchlib/tensor/generic_tensor_attribute_saver.cpp b/searchlib/src/vespa/searchlib/tensor/generic_tensor_attribute_saver.cpp index 6c22434afe9..104f563afb3 100644 --- a/searchlib/src/vespa/searchlib/tensor/generic_tensor_attribute_saver.cpp +++ b/searchlib/src/vespa/searchlib/tensor/generic_tensor_attribute_saver.cpp @@ -1,9 +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 "generic_tensor_attribute_saver.h" -#include <vespa/searchlib/util/bufferwriter.h> #include "generic_tensor_store.h" +#include <vespa/searchlib/util/bufferwriter.h> #include <vespa/searchlib/attribute/iattributesavetarget.h> using vespalib::GenerationHandler; diff --git a/searchlib/src/vespa/searchlib/tensor/tensor_store.cpp b/searchlib/src/vespa/searchlib/tensor/tensor_store.cpp index df22869f2d3..85befd85fe5 100644 --- a/searchlib/src/vespa/searchlib/tensor/tensor_store.cpp +++ b/searchlib/src/vespa/searchlib/tensor/tensor_store.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 "tensor_store.h" #include <vespa/searchlib/datastore/datastore.hpp> diff --git a/searchlib/src/vespa/searchlib/test/diskindex/testdiskindex.cpp b/searchlib/src/vespa/searchlib/test/diskindex/testdiskindex.cpp index ad1ff63c133..e8e41f61ae9 100644 --- a/searchlib/src/vespa/searchlib/test/diskindex/testdiskindex.cpp +++ b/searchlib/src/vespa/searchlib/test/diskindex/testdiskindex.cpp @@ -1,6 +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/test/diskindex/testdiskindex.h> + +#include "testdiskindex.h" #include <vespa/searchlib/diskindex/indexbuilder.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/vespalib/io/fileutil.h> diff --git a/searchlib/src/vespa/searchlib/test/document_weight_attribute_helper.cpp b/searchlib/src/vespa/searchlib/test/document_weight_attribute_helper.cpp index cfd06a86d0e..6efea89cd7f 100644 --- a/searchlib/src/vespa/searchlib/test/document_weight_attribute_helper.cpp +++ b/searchlib/src/vespa/searchlib/test/document_weight_attribute_helper.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 "document_weight_attribute_helper.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/test/fakedata/bitdecode64.cpp b/searchlib/src/vespa/searchlib/test/fakedata/bitdecode64.cpp index cda9314366c..57e61270913 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/bitdecode64.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/bitdecode64.cpp @@ -1,22 +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/log/log.h> -LOG_SETUP(".bitdecode64"); #include "bitencode64.h" #include "bitdecode64.h" - -namespace search -{ - -namespace fakedata -{ +namespace search::fakedata { template class BitDecode64<true>; - template class BitDecode64<false>; -} // namespace fakedata - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/test/fakedata/bitencode64.cpp b/searchlib/src/vespa/searchlib/test/fakedata/bitencode64.cpp index 27b330e5896..98cdb50c3fc 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/bitencode64.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/bitencode64.cpp @@ -1,16 +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/log/log.h> -LOG_SETUP(".bitencode64"); #include "bitencode64.h" - -namespace search -{ - -namespace fakedata -{ +namespace search::fakedata { template <bool bigEndian> BitEncode64<bigEndian>::BitEncode64() @@ -21,17 +13,12 @@ BitEncode64<bigEndian>::BitEncode64() this->afterWrite(_cbuf, 0, 0); } - template <bool bigEndian> BitEncode64<bigEndian>::~BitEncode64() { } template class BitEncode64<true>; - template class BitEncode64<false>; - -} // namespace fakedata - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp index a56ec56c5da..fcc83b39138 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp @@ -1,14 +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/log/log.h> -LOG_SETUP(".fakeegcompr64filterocc"); #include "fakeegcompr64filterocc.h" +#include "fpfactory.h" #include <vespa/searchlib/bitcompression/compression.h> #include <vespa/searchlib/bitcompression/posocccompression.h> #include <vespa/searchlib/queryeval/iterators.h> #include <vespa/searchlib/fef/termfieldmatchdataarray.h> -#include "fpfactory.h" using search::fef::TermFieldMatchData; using search::fef::TermFieldMatchDataPosition; @@ -16,11 +13,7 @@ using search::fef::TermFieldMatchDataPosition; #include "bitencode64.h" #include "bitdecode64.h" -namespace search -{ - -namespace fakedata -{ +namespace search::fakedata { #define DEBUG_EGCOMPR64FILTEROCC_PRINTF 0 #define DEBUG_EGCOMPR64FILTEROCC_ASSERT 1 @@ -1512,7 +1505,4 @@ createIterator(const fef::TermFieldMatchDataArray &matchData) const matchData); } - -} // namespace fakedata - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakefilterocc.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakefilterocc.cpp index 8cbf2ede7d3..1c4b318ed71 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakefilterocc.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakefilterocc.cpp @@ -1,20 +1,13 @@ // 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> -LOG_SETUP(".fakefilterocc"); -#include <vespa/searchlib/queryeval/iterators.h> #include "fakefilterocc.h" #include "fpfactory.h" +#include <vespa/searchlib/queryeval/iterators.h> using search::fef::TermFieldMatchData; using search::fef::TermFieldMatchDataPosition; -namespace search -{ - -namespace fakedata -{ +namespace search::fakedata { static FPFactoryInit init(std::make_pair("FilterOcc", @@ -201,6 +194,4 @@ createIterator(const fef::TermFieldMatchDataArray &matchData) const matchData); } -} // namespace fakedata - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.cpp index 632d85ffcd1..750be8b84dc 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.cpp @@ -1,27 +1,22 @@ // 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> -LOG_SETUP(".fakememtreeocc"); -#include <vespa/searchlib/queryeval/iterators.h> #include "fakememtreeocc.h" +#include "fpfactory.h" +#include <vespa/searchlib/queryeval/iterators.h> #include <vespa/searchlib/btree/btreeroot.hpp> #include <vespa/searchlib/btree/btreeiterator.hpp> #include <vespa/searchlib/btree/btreenodeallocator.hpp> #include <vespa/searchlib/btree/btreenode.hpp> #include <vespa/searchlib/btree/btreenodestore.hpp> #include <vespa/searchlib/memoryindex/postingiterator.h> -#include "fpfactory.h" #include <vespa/searchlib/util/postingpriorityqueue.h> +#include <vespa/log/log.h> +LOG_SETUP(".fakememtreeocc"); using search::fef::TermFieldMatchData; using search::fef::TermFieldMatchDataPosition; -namespace search -{ - -namespace fakedata -{ +namespace search::fakedata { static FPFactoryInit init(std::make_pair("MemTreeOcc", @@ -298,7 +293,6 @@ FakeMemTreeOccMgr::compactTrees() itr.begin(); tree.setRoot(itr.moveFirstLeafNode(tree.getRoot()), _allocator); while (itr.valid()) { - // LOG(info, "Leaf moved to %d", UNWRAP(itr.getKey())); itr.moveNextLeafNode(); } } @@ -424,7 +418,4 @@ FakeMemTreeOcc2Factory::setup(const std::vector<const FakeWord *> &fws) LOG(info, "done compacting trees"); } - -} // namespace fakedata - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakeposting.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakeposting.cpp index 3fb5a0991f2..b68fac37fcd 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakeposting.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakeposting.cpp @@ -1,15 +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/log/log.h> -LOG_SETUP(".fakeposting"); #include "fakeposting.h" -namespace search -{ - -namespace fakedata -{ +namespace search::fakedata { FakePosting::FakePosting(const std::string &name) : _name(name) @@ -56,6 +49,4 @@ FakePosting::l4SkipBitSize() const return 0; } -} // namespace fakedata - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakeword.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakeword.cpp index c30d5f2b61f..d28d4e80fd8 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakeword.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakeword.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".fakeword"); #include "fakeword.h" #include <vespa/searchlib/index/postinglistfile.h> @@ -609,7 +606,7 @@ FakeWord::validate(std::shared_ptr<FieldReader> &fieldReader, features._wordPositions.begin(); TermFieldMatchData *tfmd = matchData[0]; - LOG_ASSERT(tfmd != 0); + assert(tfmd != 0); tfmd->reset(features._docId); uint32_t elementResidue = features._elements.size(); diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakewordset.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakewordset.cpp index 46313066116..9bf87ecac1a 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakewordset.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakewordset.cpp @@ -1,9 +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 "fakewordset.h" #include "fakeword.h" #include <vespa/searchlib/index/schemautil.h> + #include <vespa/log/log.h> LOG_SETUP(".fakewordset"); diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakezcbfilterocc.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakezcbfilterocc.cpp index 20ee2394156..6b1cee01cad 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakezcbfilterocc.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakezcbfilterocc.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".fakezcbfilterocc"); #include "fakezcbfilterocc.h" #include <vespa/searchlib/bitcompression/compression.h> #include <vespa/searchlib/bitcompression/posocccompression.h> @@ -12,11 +9,7 @@ LOG_SETUP(".fakezcbfilterocc"); using search::fef::TermFieldMatchData; using search::fef::TermFieldMatchDataPosition; -namespace search -{ - -namespace fakedata -{ +namespace search::fakedata { static FPFactoryInit init(std::make_pair("ZcbFilterOcc", @@ -262,6 +255,4 @@ createIterator(const fef::TermFieldMatchDataArray &matchData) const matchData); } -} // namespace fakedata - -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fpfactory.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fpfactory.cpp index 37820a88a8e..6af2d61f110 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fpfactory.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fpfactory.cpp @@ -1,8 +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/log/log.h> -LOG_SETUP(".fpfactory"); #include "fakeegcompr64filterocc.h" #include "fakefilterocc.h" #include "fakezcbfilterocc.h" @@ -11,11 +8,7 @@ LOG_SETUP(".fpfactory"); #include "fpfactory.h" #include "fakewordset.h" -namespace search -{ - -namespace fakedata -{ +namespace search::fakedata { using index::Schema; @@ -113,8 +106,6 @@ FPFactoryInit::forceLink() FakeZcbFilterOcc::forceLink(); FakeZcFilterOcc::forceLink(); FakeMemTreeOcc::forceLink(); -}; - -} // namespace fakedata +} -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/test/statefile.cpp b/searchlib/src/vespa/searchlib/test/statefile.cpp index 005145c5cb3..9779cfa28a4 100644 --- a/searchlib/src/vespa/searchlib/test/statefile.cpp +++ b/searchlib/src/vespa/searchlib/test/statefile.cpp @@ -1,19 +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 "statefile.h" #include <vespa/searchlib/util/statefile.h> #include <iostream> #include <fstream> #include <string> -#include "statefile.h" - -namespace search -{ -namespace test -{ - -namespace statefile -{ +namespace search::test::statefile { vespalib::string readState(StateFile &sf) @@ -23,7 +15,6 @@ readState(StateFile &sf) return vespalib::string(buf.begin(), buf.end()); } - std::vector<vespalib::string> readHistory(const char *name) { @@ -40,9 +31,4 @@ readHistory(const char *name) return res; } - -} - -} - } diff --git a/searchlib/src/vespa/searchlib/test/statefile.h b/searchlib/src/vespa/searchlib/test/statefile.h index a5aee2ff2a3..6c67a112ebb 100644 --- a/searchlib/src/vespa/searchlib/test/statefile.h +++ b/searchlib/src/vespa/searchlib/test/statefile.h @@ -1,22 +1,16 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + #include <vespa/vespalib/stllike/string.h> +#include <vector> -namespace search -{ +namespace search { class StateFile; -namespace test -{ - -namespace statefile -{ +namespace test::statefile { vespalib::string readState(StateFile &sf); std::vector<vespalib::string> readHistory(const char *name); } - -} - } diff --git a/searchlib/src/vespa/searchlib/test/statestring.cpp b/searchlib/src/vespa/searchlib/test/statestring.cpp index e1c8df43c4b..0fb08415434 100644 --- a/searchlib/src/vespa/searchlib/test/statestring.cpp +++ b/searchlib/src/vespa/searchlib/test/statestring.cpp @@ -1,16 +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 <sstream> #include "statestring.h" +#include <sstream> -namespace search -{ - -namespace test -{ - -namespace statestring -{ +namespace search::test::statestring { bool testStartPos(vespalib::string &s, size_t pos) @@ -18,7 +10,6 @@ testStartPos(vespalib::string &s, size_t pos) return (pos < s.size() && (pos == 0 || s[pos - 1] == ' ')); } - size_t findStartPos(vespalib::string &s, const vespalib::string &key) { @@ -33,7 +24,6 @@ findStartPos(vespalib::string &s, const vespalib::string &key) return pos; } - size_t scanBreakPos(vespalib::string &s, size_t pos) { @@ -43,7 +33,6 @@ scanBreakPos(vespalib::string &s, size_t pos) return pos; } - void normalizeTimestamp(vespalib::string &s) { @@ -55,7 +44,6 @@ normalizeTimestamp(vespalib::string &s) } } - void normalizeAddr(vespalib::string &s, void *addr) { @@ -72,7 +60,6 @@ normalizeAddr(vespalib::string &s, void *addr) } } - void normalizeTimestamps(std::vector<vespalib::string> &sv) { @@ -81,7 +68,6 @@ normalizeTimestamps(std::vector<vespalib::string> &sv) } } - void normalizeAddrs(std::vector<vespalib::string> &sv, void *addr) { @@ -90,9 +76,4 @@ normalizeAddrs(std::vector<vespalib::string> &sv, void *addr) } } - -} - -} - } diff --git a/searchlib/src/vespa/searchlib/test/statestring.h b/searchlib/src/vespa/searchlib/test/statestring.h index ad5d70186dc..7fb6f1fce85 100644 --- a/searchlib/src/vespa/searchlib/test/statestring.h +++ b/searchlib/src/vespa/searchlib/test/statestring.h @@ -1,24 +1,13 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/vespalib/stllike/string.h> - -namespace search -{ -namespace test -{ +#include <vespa/vespalib/stllike/string.h> +#include <vector> -namespace statestring -{ +namespace search::test::statestring { void normalizeTimestamp(vespalib::string &s); void normalizeAddr(vespalib::string &s, void *addr); void normalizeTimestamps(std::vector<vespalib::string> &sv); void normalizeAddrs(std::vector<vespalib::string> &sv, void *addr); -} - -} - -} - - +}
\ No newline at end of file diff --git a/searchlib/src/vespa/searchlib/transactionlog/nosyncproxy.cpp b/searchlib/src/vespa/searchlib/transactionlog/nosyncproxy.cpp index 68962a386f6..5304697627b 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/nosyncproxy.cpp +++ b/searchlib/src/vespa/searchlib/transactionlog/nosyncproxy.cpp @@ -1,20 +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 "nosyncproxy.h" -namespace search -{ -namespace transactionlog -{ +namespace search::transactionlog { -NoSyncProxy::NoSyncProxy() -{ -} +NoSyncProxy::NoSyncProxy() { } - -NoSyncProxy::~NoSyncProxy() -{ -} +NoSyncProxy::~NoSyncProxy() { } void @@ -24,5 +15,3 @@ NoSyncProxy::sync(SerialNum syncTo) } } - -} diff --git a/searchlib/src/vespa/searchlib/transactionlog/session.cpp b/searchlib/src/vespa/searchlib/transactionlog/session.cpp index fc5e94c1859..734c7da8055 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/session.cpp +++ b/searchlib/src/vespa/searchlib/transactionlog/session.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/transactionlog/session.h> #include <vespa/searchlib/transactionlog/domain.h> #include <vespa/fastlib/io/bufferedfile.h> diff --git a/searchlib/src/vespa/searchlib/transactionlog/session.h b/searchlib/src/vespa/searchlib/transactionlog/session.h index 46723bed04c..6616e311aa4 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/session.h +++ b/searchlib/src/vespa/searchlib/transactionlog/session.h @@ -7,6 +7,8 @@ #include <vespa/vespalib/util/sync.h> #include <deque> +class FastOS_FileInterface; + namespace search { namespace transactionlog { diff --git a/searchlib/src/vespa/searchlib/transactionlog/trans_log_server_explorer.cpp b/searchlib/src/vespa/searchlib/transactionlog/trans_log_server_explorer.cpp index fdc771a7b58..2fda267645f 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/trans_log_server_explorer.cpp +++ b/searchlib/src/vespa/searchlib/transactionlog/trans_log_server_explorer.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 "trans_log_server_explorer.h" #include "domain.h" #include <vespa/vespalib/data/slime/slime.h> diff --git a/searchlib/src/vespa/searchlib/transactionlog/translogserverapp.cpp b/searchlib/src/vespa/searchlib/transactionlog/translogserverapp.cpp index fdfd9189cd8..1b0959d63fd 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/translogserverapp.cpp +++ b/searchlib/src/vespa/searchlib/transactionlog/translogserverapp.cpp @@ -1,17 +1,14 @@ // 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/transactionlog/translogserverapp.h> + +#include "translogserverapp.h" #include <vespa/log/log.h> LOG_SETUP(".translogserverapp"); using search::common::FileHeaderContext; -namespace search -{ - -namespace transactionlog -{ +namespace search { +namespace transactionlog { TransLogServerApp::TransLogServerApp(const config::ConfigUri & tlsConfigUri, const FileHeaderContext & fileHeaderContext) diff --git a/searchlib/src/vespa/searchlib/uca/ucafunctionnode.cpp b/searchlib/src/vespa/searchlib/uca/ucafunctionnode.cpp index 59e990f6df0..88cd4fb5817 100644 --- a/searchlib/src/vespa/searchlib/uca/ucafunctionnode.cpp +++ b/searchlib/src/vespa/searchlib/uca/ucafunctionnode.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/uca/ucafunctionnode.h> -#include <vespa/searchlib/uca/ucaconverter.h> +#include "ucafunctionnode.h" +#include "ucaconverter.h" namespace search { namespace expression { diff --git a/searchlib/src/vespa/searchlib/util/bufferwriter.cpp b/searchlib/src/vespa/searchlib/util/bufferwriter.cpp index 21e1d16a079..af27001aba3 100644 --- a/searchlib/src/vespa/searchlib/util/bufferwriter.cpp +++ b/searchlib/src/vespa/searchlib/util/bufferwriter.cpp @@ -1,10 +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 "bufferwriter.h" -namespace search -{ +namespace search { BufferWriter::BufferWriter() : _cur(nullptr), diff --git a/searchlib/src/vespa/searchlib/util/bufferwriter.h b/searchlib/src/vespa/searchlib/util/bufferwriter.h index b4183f779ed..f0a0557da67 100644 --- a/searchlib/src/vespa/searchlib/util/bufferwriter.h +++ b/searchlib/src/vespa/searchlib/util/bufferwriter.h @@ -2,8 +2,9 @@ #pragma once -namespace search -{ +#include <cstddef> + +namespace search { /** * Abstract class to write to a buffer with an abstract backing store diff --git a/searchlib/src/vespa/searchlib/util/comprfile.cpp b/searchlib/src/vespa/searchlib/util/comprfile.cpp index 7078ac3764b..d0b78e6bdd0 100644 --- a/searchlib/src/vespa/searchlib/util/comprfile.cpp +++ b/searchlib/src/vespa/searchlib/util/comprfile.cpp @@ -2,16 +2,12 @@ // Copyright (C) 2002-2003 Fast Search & Transfer ASA // Copyright (C) 2003 Overture Services Norway AS -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -#include <vespa/searchlib/util/comprbuffer.h> -#include <vespa/searchlib/util/comprfile.h> +#include "comprfile.h" #include <vespa/vespalib/objects/nbostream.h> +#include <vespa/fastos/file.h> +#include <cassert> -LOG_SETUP(".comprbuffer"); - -namespace search -{ +namespace search { using vespalib::nbostream; diff --git a/searchlib/src/vespa/searchlib/util/dirtraverse.cpp b/searchlib/src/vespa/searchlib/util/dirtraverse.cpp index 3c021174979..c5260c7f454 100644 --- a/searchlib/src/vespa/searchlib/util/dirtraverse.cpp +++ b/searchlib/src/vespa/searchlib/util/dirtraverse.cpp @@ -2,11 +2,11 @@ // Copyright (C) 2002-2003 Fast Search & Transfer ASA // Copyright (C) 2003 Overture Services Norway AS -#include <vespa/fastos/fastos.h> #include "dirtraverse.h" +#include <vespa/fastos/file.h> +#include <cassert> -namespace search -{ +namespace search { extern "C" { static int cmpname(const void *av, const void *bv) @@ -19,10 +19,16 @@ static int cmpname(const void *av, const void *bv) } } +DirectoryTraverse::Name::Name(const char *name) + : _name(nullptr), + _next(nullptr) +{ + _name = strdup(name); +} +DirectoryTraverse::Name::~Name() { free(_name); } DirectoryTraverse::Name * -DirectoryTraverse::Name::sort(Name *head, - int count) +DirectoryTraverse::Name::sort(Name *head, int count) { Name *nl; Name **names; @@ -30,7 +36,7 @@ DirectoryTraverse::Name::sort(Name *head, names = new Name *[count]; i = 0; - for(nl = head; nl != NULL; nl = nl->_next) + for(nl = head; nl != nullptr; nl = nl->_next) names[i++] = nl; assert(i == count); qsort(names, count, sizeof(Name *), cmpname); @@ -38,7 +44,7 @@ DirectoryTraverse::Name::sort(Name *head, if (i + 1 < count) names[i]->_next = names[i + 1]; else - names[i]->_next = NULL; + names[i]->_next = nullptr; } head = names[0]; delete [] names; @@ -50,7 +56,7 @@ void DirectoryTraverse::QueueDir(const char *name) { Name *n = new Name(name); - if (_dirTail == NULL) + if (_dirTail == nullptr) _dirHead = n; else _dirTail->_next = n; @@ -80,12 +86,12 @@ void DirectoryTraverse::PushPushedDirs() { Name *n; - while (_pdirHead != NULL) { + while (_pdirHead != nullptr) { n = _pdirHead; _pdirHead = n->_next; n->_next = _dirHead; _dirHead = n; - if (_dirTail == NULL) + if (_dirTail == nullptr) _dirTail = n; } } @@ -96,13 +102,13 @@ DirectoryTraverse::UnQueueDir() { Name *n; PushPushedDirs(); - if (_dirHead == NULL) - return NULL; + if (_dirHead == nullptr) + return nullptr; n = _dirHead; _dirHead = n->_next; - n->_next = NULL; - if (_dirHead == NULL) - _dirTail = NULL; + n->_next = nullptr; + if (_dirHead == nullptr) + _dirTail = nullptr; return n; } @@ -110,11 +116,11 @@ DirectoryTraverse::Name * DirectoryTraverse::UnQueueName() { Name *n; - if (_nameHead == NULL) - return NULL; + if (_nameHead == nullptr) + return nullptr; n = _nameHead; _nameHead = n->_next; - n->_next = NULL; + n->_next = nullptr; _nameCount--; return n; } @@ -123,13 +129,13 @@ DirectoryTraverse::UnQueueName() void DirectoryTraverse::ScanSingleDir() { - assert(_nameHead == NULL); + assert(_nameHead == nullptr); assert(_nameCount == 0); delete _curDir; free(_fullDirName); - _fullDirName = NULL; + _fullDirName = nullptr; _curDir = UnQueueDir(); - if (_curDir == NULL) + if (_curDir == nullptr) return; _fullDirName = (char *) malloc(strlen(_baseDir) + 1 + strlen(_curDir->_name) + 1); @@ -159,10 +165,10 @@ bool DirectoryTraverse::NextName() { delete _curName; - _curName = NULL; - while (_nameHead == NULL && (_dirHead != NULL || _pdirHead != NULL)) + _curName = nullptr; + while (_nameHead == nullptr && (_dirHead != nullptr || _pdirHead != nullptr)) ScanSingleDir(); - if (_nameHead == NULL) + if (_nameHead == nullptr) return false; _curName = UnQueueName(); free(_fullName); @@ -182,8 +188,8 @@ DirectoryTraverse::NextRemoveDir() Name *curName; delete _curName; - _curName = NULL; - if (_rdirHead == NULL) + _curName = nullptr; + if (_rdirHead == nullptr) return false; curName = _rdirHead; _rdirHead = curName->_next; @@ -246,18 +252,18 @@ DirectoryTraverse::GetTreeSize() } DirectoryTraverse::DirectoryTraverse(const char *baseDir) - : _baseDir(NULL), - _nameHead(NULL), + : _baseDir(nullptr), + _nameHead(nullptr), _nameCount(0), - _dirHead(NULL), - _dirTail(NULL), - _pdirHead(NULL), - _rdirHead(NULL), - _curDir(NULL), - _curName(NULL), - _fullDirName(NULL), - _fullName(NULL), - _relName(NULL) + _dirHead(nullptr), + _dirTail(nullptr), + _pdirHead(nullptr), + _rdirHead(nullptr), + _curDir(nullptr), + _curName(nullptr), + _fullDirName(nullptr), + _fullName(nullptr), + _relName(nullptr) { _baseDir = strdup(baseDir); QueueDir(""); @@ -273,15 +279,15 @@ DirectoryTraverse::~DirectoryTraverse() delete _curDir; delete _curName; PushPushedDirs(); - while (_dirHead != NULL) + while (_dirHead != nullptr) delete UnQueueDir(); - while (_nameHead != NULL) + while (_nameHead != nullptr) delete UnQueueName(); - while (_rdirHead != NULL) { + while (_rdirHead != nullptr) { Name *n; n = _rdirHead; _rdirHead = n->_next; - n->_next = NULL; + n->_next = nullptr; delete n; } } diff --git a/searchlib/src/vespa/searchlib/util/dirtraverse.h b/searchlib/src/vespa/searchlib/util/dirtraverse.h index a9ce8c5f635..6351e20230f 100644 --- a/searchlib/src/vespa/searchlib/util/dirtraverse.h +++ b/searchlib/src/vespa/searchlib/util/dirtraverse.h @@ -4,8 +4,9 @@ #pragma once -namespace search -{ +#include <cstdint> + +namespace search { class DirectoryTraverse { @@ -23,13 +24,8 @@ public: public: char *_name; Name *_next; - explicit Name(const char *name) - : _name(NULL), - _next(NULL) - { - _name = strdup(name); - } - ~Name() { free(_name); } + explicit Name(const char *name); + ~Name(); static Name *sort(Name *head, int count); }; private: @@ -64,4 +60,3 @@ public: }; } // namespace search - diff --git a/searchlib/src/vespa/searchlib/util/drainingbufferwriter.cpp b/searchlib/src/vespa/searchlib/util/drainingbufferwriter.cpp index 9c1150917a7..db721f5e9b6 100644 --- a/searchlib/src/vespa/searchlib/util/drainingbufferwriter.cpp +++ b/searchlib/src/vespa/searchlib/util/drainingbufferwriter.cpp @@ -1,10 +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 "drainingbufferwriter.h" +#include <cassert> -namespace search -{ +namespace search { DrainingBufferWriter::DrainingBufferWriter() : BufferWriter(), diff --git a/searchlib/src/vespa/searchlib/util/drainingbufferwriter.h b/searchlib/src/vespa/searchlib/util/drainingbufferwriter.h index 2c471ce2148..e02c30c7ca8 100644 --- a/searchlib/src/vespa/searchlib/util/drainingbufferwriter.h +++ b/searchlib/src/vespa/searchlib/util/drainingbufferwriter.h @@ -4,9 +4,9 @@ #include "bufferwriter.h" #include <vector> +#include <cstdint> -namespace search -{ +namespace search { /** * Class to write to a "drain" buffer, used to measure performance of @@ -21,11 +21,8 @@ public: static constexpr size_t BUFFER_SIZE = 262144; DrainingBufferWriter(); - - virtual ~DrainingBufferWriter(); - - virtual void flush() override; - + ~DrainingBufferWriter() override; + void flush() override; size_t getBytesWritten() const { return _bytesWritten; } }; diff --git a/searchlib/src/vespa/searchlib/util/fileheadertk.cpp b/searchlib/src/vespa/searchlib/util/fileheadertk.cpp index 6451df32b69..fbaf5712a29 100644 --- a/searchlib/src/vespa/searchlib/util/fileheadertk.cpp +++ b/searchlib/src/vespa/searchlib/util/fileheadertk.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 <vespa/vespalib/component/vtag.h> + #include "fileheadertk.h" +#include <vespa/vespalib/component/vtag.h> using namespace search; using vespalib::GenericHeader; diff --git a/searchlib/src/vespa/searchlib/util/filekit.cpp b/searchlib/src/vespa/searchlib/util/filekit.cpp index df509f2ea96..c5b35f92f0c 100644 --- a/searchlib/src/vespa/searchlib/util/filekit.cpp +++ b/searchlib/src/vespa/searchlib/util/filekit.cpp @@ -2,16 +2,14 @@ // Copyright (C) 1998-2003 Fast Search & Transfer ASA // Copyright (C) 2003 Overture Services Norway AS -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> #include <vespa/searchlib/util/filekit.h> #include <vespa/vespalib/util/error.h> -#include <memory> -#include <string> +#include <vespa/fastos/file.h> + +#include <vespa/log/log.h> LOG_SETUP(".filekit"); -namespace search -{ +namespace search { using vespalib::getLastErrorString; diff --git a/searchlib/src/vespa/searchlib/util/filekit.h b/searchlib/src/vespa/searchlib/util/filekit.h index fb2332529d4..77dbe92a200 100644 --- a/searchlib/src/vespa/searchlib/util/filekit.h +++ b/searchlib/src/vespa/searchlib/util/filekit.h @@ -5,6 +5,7 @@ #pragma once #include <vespa/vespalib/stllike/string.h> +#include <vespa/fastos/timestamp.h> namespace search { @@ -13,23 +14,15 @@ class FileKit private: static bool _syncFiles; public: - static bool - createStamp(const vespalib::stringref &name); - - static bool - hasStamp(const vespalib::stringref &name); - - static bool - removeStamp(const vespalib::stringref &name); + static bool createStamp(const vespalib::stringref &name); + static bool hasStamp(const vespalib::stringref &name); + static bool removeStamp(const vespalib::stringref &name); /** * Returns the modification time of the given file/directory, * or time stamp 0 if stating of file/directory fails. **/ - static fastos::TimeStamp - getModificationTime(const vespalib::stringref &name); - + static fastos::TimeStamp getModificationTime(const vespalib::stringref &name); }; } - diff --git a/searchlib/src/vespa/searchlib/util/filesizecalculator.cpp b/searchlib/src/vespa/searchlib/util/filesizecalculator.cpp index 4ae53c03430..342ccb0104e 100644 --- a/searchlib/src/vespa/searchlib/util/filesizecalculator.cpp +++ b/searchlib/src/vespa/searchlib/util/filesizecalculator.cpp @@ -1,14 +1,12 @@ // 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 "filesizecalculator.h" +#include <vespa/vespalib/data/fileheader.h> #include <vespa/log/log.h> LOG_SETUP(".searchlib.util.filesizecalculator"); -#include "filesizecalculator.h" -#include <vespa/vespalib/data/fileheader.h> -namespace search -{ +namespace search { namespace { diff --git a/searchlib/src/vespa/searchlib/util/foldedstringcompare.cpp b/searchlib/src/vespa/searchlib/util/foldedstringcompare.cpp index ac63d1a7a64..068e58e0591 100644 --- a/searchlib/src/vespa/searchlib/util/foldedstringcompare.cpp +++ b/searchlib/src/vespa/searchlib/util/foldedstringcompare.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 "foldedstringcompare.h" #include <vespa/vespalib/text/utf8.h> #include <vespa/vespalib/text/lowercase.h> diff --git a/searchlib/src/vespa/searchlib/util/foldedstringcompare.h b/searchlib/src/vespa/searchlib/util/foldedstringcompare.h index 7b05ce9bcd8..568305255e7 100644 --- a/searchlib/src/vespa/searchlib/util/foldedstringcompare.h +++ b/searchlib/src/vespa/searchlib/util/foldedstringcompare.h @@ -2,7 +2,7 @@ #pragma once - +#include <cstddef> namespace search { @@ -54,4 +54,3 @@ public: }; } // namespace search - diff --git a/searchlib/src/vespa/searchlib/util/ioerrorhandler.cpp b/searchlib/src/vespa/searchlib/util/ioerrorhandler.cpp index 394ee2403ec..23fa3529599 100644 --- a/searchlib/src/vespa/searchlib/util/ioerrorhandler.cpp +++ b/searchlib/src/vespa/searchlib/util/ioerrorhandler.cpp @@ -1,19 +1,15 @@ // 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 "ioerrorhandler.h" #include "statebuf.h" #include "statefile.h" -#include <atomic> - -namespace search -{ +#include <vespa/fastos/file.h> +namespace search { IOErrorHandler *IOErrorHandler::_instance = nullptr; -namespace -{ +namespace { std::atomic<int> nesting; diff --git a/searchlib/src/vespa/searchlib/util/ioerrorhandler.h b/searchlib/src/vespa/searchlib/util/ioerrorhandler.h index acdc0d12282..1feb0045c4f 100644 --- a/searchlib/src/vespa/searchlib/util/ioerrorhandler.h +++ b/searchlib/src/vespa/searchlib/util/ioerrorhandler.h @@ -2,8 +2,11 @@ #pragma once -namespace search -{ +#include <cstdint> +#include <cstddef> +#include <sys/types.h> + +namespace search { class StateFile; @@ -17,44 +20,22 @@ class IOErrorHandler bool _trapped; bool _fired; - using FailedHandler = void (*)(const char *op, - const char *file, - int error, - int64_t offset, - size_t len, - ssize_t rlen); - void - trap(); - - void - untrap(); - - static void - forward(const char *op, - const char *file, - int error, - int64_t offset, - size_t len, - ssize_t rlen); - - void - handle(const char *op, - const char *file, - int error, - int64_t offset, - size_t len, - ssize_t rlen); + using FailedHandler = void (*)(const char *op, const char *file, int error, + int64_t offset, size_t len, ssize_t rlen); + void trap(); + void untrap(); + + static void forward(const char *op, const char *file, int error, + int64_t offset, size_t len, ssize_t rlen); + + void handle(const char *op, const char *file, int error, + int64_t offset, size_t len, ssize_t rlen); public: IOErrorHandler(StateFile *stateFile); - ~IOErrorHandler(); - bool - fired() const - { - return _fired; - } + bool fired() const { return _fired; } }; diff --git a/searchlib/src/vespa/searchlib/util/logutil.cpp b/searchlib/src/vespa/searchlib/util/logutil.cpp index f8dd7120aac..db51fe8a155 100644 --- a/searchlib/src/vespa/searchlib/util/logutil.cpp +++ b/searchlib/src/vespa/searchlib/util/logutil.cpp @@ -1,7 +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/log/log.h> -LOG_SETUP(".searchlib.util.logutil"); #include "logutil.h" #include <vespa/searchlib/util/dirtraverse.h> diff --git a/searchlib/src/vespa/searchlib/util/rawbuf.cpp b/searchlib/src/vespa/searchlib/util/rawbuf.cpp index 2f8b279aac1..4954c9b3955 100644 --- a/searchlib/src/vespa/searchlib/util/rawbuf.cpp +++ b/searchlib/src/vespa/searchlib/util/rawbuf.cpp @@ -2,21 +2,21 @@ // Copyright (C) 1998-2003 Fast Search & Transfer ASA // Copyright (C) 2003 Overture Services Norway AS - -#include <vespa/fastos/fastos.h> -#include <vespa/searchlib/util/rawbuf.h> +#include "rawbuf.h" #include <vespa/vespalib/util/compress.h> +#include <vespa/fastos/file.h> +#include <cassert> namespace search { static inline size_t smin(size_t a, size_t b) { return (a < b) ? a : b; } RawBuf::RawBuf(size_t size) - : _bufStart(NULL), - _bufEnd(NULL), - _bufFillPos(NULL), - _bufDrainPos(NULL), - _initialBufStart(NULL), + : _bufStart(nullptr), + _bufEnd(nullptr), + _bufFillPos(nullptr), + _bufDrainPos(nullptr), + _initialBufStart(nullptr), _initialSize(size) { if (size > 0) { @@ -28,10 +28,10 @@ RawBuf::RawBuf(size_t size) RawBuf::RawBuf(char *start, size_t size) - : _bufStart(NULL), - _bufEnd(NULL), - _bufFillPos(NULL), - _bufDrainPos(NULL), + : _bufStart(nullptr), + _bufEnd(nullptr), + _bufFillPos(nullptr), + _bufDrainPos(nullptr), _initialBufStart(start), _initialSize(size) { @@ -176,13 +176,13 @@ RawBuf::Reuse() if (static_cast<size_t>(_bufEnd - _bufStart) > _initialSize * 4) { free(_bufStart); if (_initialSize > 0) { - if (_initialBufStart != NULL) + if (_initialBufStart != nullptr) _bufStart = _initialBufStart; else _bufStart = static_cast<char *>(malloc(_initialSize)); - assert(_bufStart != NULL); + assert(_bufStart != nullptr); } else - _bufStart = NULL; + _bufStart = nullptr; _bufEnd = _bufStart + _initialSize; } _bufDrainPos = _bufFillPos = _bufStart; @@ -357,4 +357,10 @@ RawBuf::readFile(FastOS_FileInterface &file, size_t maxlen) return got; } +void +RawBuf::ensureSizeInternal(size_t size) { + expandBuf(size); + assert(static_cast<size_t>(_bufEnd - _bufFillPos) >= size); +} + } diff --git a/searchlib/src/vespa/searchlib/util/rawbuf.h b/searchlib/src/vespa/searchlib/util/rawbuf.h index cffb5909075..03378665189 100644 --- a/searchlib/src/vespa/searchlib/util/rawbuf.h +++ b/searchlib/src/vespa/searchlib/util/rawbuf.h @@ -5,8 +5,7 @@ #pragma once #include <vespa/searchlib/common/hitrank.h> -#include <stdint.h> -#include <assert.h> +#include <cstdint> #include <sys/types.h> class FastOS_FileInterface; @@ -31,6 +30,8 @@ private: char* _bufDrainPos; // ref. to next byte to take out of buffer char* _initialBufStart; size_t _initialSize; + + void ensureSizeInternal(size_t size); public: RawBuf(char *start, size_t size);// Initially use provided buffer @@ -74,8 +75,7 @@ public: void ensureSize(size_t size) { if (static_cast<size_t>(_bufEnd - _bufFillPos) < size) { - expandBuf(size); - assert(static_cast<size_t>(_bufEnd - _bufFillPos) >= size); + ensureSizeInternal(size); } } @@ -144,4 +144,3 @@ public: }; } - diff --git a/searchlib/src/vespa/searchlib/util/sigbushandler.cpp b/searchlib/src/vespa/searchlib/util/sigbushandler.cpp index 3acbafb7ba8..fa7958a853b 100644 --- a/searchlib/src/vespa/searchlib/util/sigbushandler.cpp +++ b/searchlib/src/vespa/searchlib/util/sigbushandler.cpp @@ -1,23 +1,16 @@ // 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 "sigbushandler.h" #include "statefile.h" #include "statebuf.h" -#include "sigbushandler.h" -#include <setjmp.h> -#include <system_error> -#include <mutex> -#include <atomic> - -namespace search -{ +#include <unistd.h> +#include <cstring> +namespace search { SigBusHandler *SigBusHandler::_instance = nullptr; - -namespace -{ +namespace { std::atomic<int> sigBusNesting; @@ -32,18 +25,13 @@ public: _gotLock = sigBusNesting.compare_exchange_strong(expzero, 1); } - ~TryLockGuard() noexcept - { + ~TryLockGuard() noexcept { if (_gotLock) { sigBusNesting = 0; } } - bool - gotLock() const noexcept - { - return _gotLock; - } + bool gotLock() const noexcept { return _gotLock; } }; @@ -158,11 +146,9 @@ SigBusHandler::SigBusHandler(StateFile *stateFile) trap(); } - SigBusHandler::~SigBusHandler() { untrap(); } - } diff --git a/searchlib/src/vespa/searchlib/util/sigbushandler.h b/searchlib/src/vespa/searchlib/util/sigbushandler.h index 49c7879b10a..b41cc0d606b 100644 --- a/searchlib/src/vespa/searchlib/util/sigbushandler.h +++ b/searchlib/src/vespa/searchlib/util/sigbushandler.h @@ -2,10 +2,10 @@ #pragma once -#include <setjmp.h> +#include <csetjmp> +#include <csignal> -namespace search -{ +namespace search { class StateFile; @@ -22,39 +22,20 @@ class SigBusHandler bool _fired; char _buf[2048]; - void - trap(); - - void - untrap(); - - static void - forward(int sig, siginfo_t *si, void *ucv); - - void - handle(int sig, siginfo_t *si, void *ucv); - + void trap(); + void untrap(); + static void forward(int sig, siginfo_t *si, void *ucv); + void handle(int sig, siginfo_t *si, void *ucv); public: SigBusHandler(StateFile *stateFile); - ~SigBusHandler(); - bool - fired() const - { - return _fired; - } + bool fired() const { return _fired; } /* * Setup siglongjmp based unwinding, used by unit tests. */ - void - setUnwind(sigjmp_buf *unwind) - { - _unwind = unwind; - } + void setUnwind(sigjmp_buf *unwind) { _unwind = unwind; } }; - } - diff --git a/searchlib/src/vespa/searchlib/util/slime_output_raw_buf_adapter.cpp b/searchlib/src/vespa/searchlib/util/slime_output_raw_buf_adapter.cpp index c86303e5a97..0f1648d7f67 100644 --- a/searchlib/src/vespa/searchlib/util/slime_output_raw_buf_adapter.cpp +++ b/searchlib/src/vespa/searchlib/util/slime_output_raw_buf_adapter.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 "slime_output_raw_buf_adapter.h" namespace search { diff --git a/searchlib/src/vespa/searchlib/util/statebuf.cpp b/searchlib/src/vespa/searchlib/util/statebuf.cpp index 69021f3b5f5..2a0f6e1db4a 100644 --- a/searchlib/src/vespa/searchlib/util/statebuf.cpp +++ b/searchlib/src/vespa/searchlib/util/statebuf.cpp @@ -1,12 +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 "statebuf.h" static const char *hexx = "0123456789abcdef"; -namespace search -{ +namespace search { void StateBuf::overflow() noexcept diff --git a/searchlib/src/vespa/searchlib/util/statefile.cpp b/searchlib/src/vespa/searchlib/util/statefile.cpp index d093a036f19..58a2167f30f 100644 --- a/searchlib/src/vespa/searchlib/util/statefile.cpp +++ b/searchlib/src/vespa/searchlib/util/statefile.cpp @@ -1,18 +1,19 @@ // 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 "statefile.h" +#include <vespa/vespalib/util/stringfmt.h> #include <system_error> #include <mutex> +#include <unistd.h> +#include <fcntl.h> +#include <sys/stat.h> using Mutex = std::mutex; using Guard = std::lock_guard<Mutex>; -namespace search -{ +namespace search { -namespace -{ +namespace { Mutex stateMutex; @@ -456,5 +457,4 @@ StateFile::getGen() const return _gen; } - } diff --git a/searchlib/src/vespa/searchlib/util/statefile.h b/searchlib/src/vespa/searchlib/util/statefile.h index f05e4363656..95789c0b1bc 100644 --- a/searchlib/src/vespa/searchlib/util/statefile.h +++ b/searchlib/src/vespa/searchlib/util/statefile.h @@ -4,9 +4,9 @@ #include <string> #include <atomic> +#include <vector> -namespace search -{ +namespace search { /* * Class used to store application state in a mostly safe manner. @@ -30,27 +30,23 @@ class StateFile /* * Zero pad file, to ensure that a later write won't run out of space. */ - void - zeroPad(); + void zeroPad(); /* * Read state file to buffer in raw form, including padding. */ - void - readRawState(std::vector<char> &buf); + void readRawState(std::vector<char> &buf); /* * Trim padding and everything after state (i.e. stop at first newline). */ - static void - trimState(std::vector<char> &buf); + static void trimState(std::vector<char> &buf); /* * Trim partial state from end of history. */ - static void - trimHistory(std::vector<char> &history, const char *historyName, int hfd, - std::vector<char> &lastHistoryState); + static void trimHistory(std::vector<char> &history, const char *historyName, int hfd, + std::vector<char> &lastHistoryState); /* * Fixup history: trim partial state from end and append current state @@ -58,49 +54,36 @@ class StateFile * If main state file doesn't have a state but history has a state then * restore main state from history. */ - void - fixupHistory(); + void fixupHistory(); /* * Check that state doesn't contain nul bytes or early newline and * that it is terminated by a newline at end. */ - void - checkState(const char *buf, size_t bufLen) noexcept; - - void - internalAddSignalState(const char *buf, size_t bufLen, - const char *name, - int appendFlag, - const char *openerr, - const char *writeerr, - const char *fsyncerr, - const char *closeerr) noexcept; - - void - addSignalState(const char *buf, size_t bufLen) noexcept; + void checkState(const char *buf, size_t bufLen) noexcept; + + void internalAddSignalState(const char *buf, size_t bufLen, const char *name, int appendFlag, + const char *openerr, const char *writeerr, const char *fsyncerr, + const char *closeerr) noexcept; + + void addSignalState(const char *buf, size_t bufLen) noexcept; public: StateFile(const std::string &name); - ~StateFile(); - void - addState(const char *buf, size_t bufLen, bool signal); + void addState(const char *buf, size_t bufLen, bool signal); - static void - erase(const std::string &name); + static void erase(const std::string &name); /* * Read state file to buffer and trim it down to a state. */ - void - readState(std::vector<char> &buf); + void readState(std::vector<char> &buf); /* * Get current state generation (bumped whenever new state is written). */ - int - getGen() const; + int getGen() const; }; } diff --git a/searchlib/src/vespa/searchlib/util/url.cpp b/searchlib/src/vespa/searchlib/util/url.cpp index d3e1d99bc1c..82a2f35e738 100644 --- a/searchlib/src/vespa/searchlib/util/url.cpp +++ b/searchlib/src/vespa/searchlib/util/url.cpp @@ -2,20 +2,13 @@ // Copyright (C) 2000-2003 Fast Search & Transfer ASA // Copyright (C) 2003 Overture Services Norway AS -/* - * Note for bugs / fixes: - * Please update fastserver4/test/regress/url/testurl.cpp - * with test for new url's when bugs are discovered/fixed. - */ +#include "url.h" -#include <vespa/fastos/fastos.h> #include <vespa/log/log.h> -#include <vespa/searchlib/util/url.h> - LOG_SETUP(".searchlib.util.url"); -namespace search { -namespace util { +namespace search::util { + bool URL::IsAlphaChar(unsigned char c) // According to RFC2396 { @@ -189,7 +182,7 @@ URL::URL(const unsigned char *url, size_t len) : _gotCompleteURL(false) { Reset(); - if (url != NULL) + if (url != nullptr) SetURL(url, len); } @@ -303,7 +296,7 @@ URL::SetURL(const unsigned char *url, size_t length) // Locate main-tld info. ptmp = reinterpret_cast<unsigned char *> (strrchr(reinterpret_cast<char *>(_host), '.')); - if (ptmp != NULL) { + if (ptmp != nullptr) { _maintld = &ptmp[1]; _startMainTld = _startHost + (_maintld - _host); if (*_tld == '\0') { @@ -315,7 +308,7 @@ URL::SetURL(const unsigned char *url, size_t length) if (_siteowner[0] == '\0') { pso = reinterpret_cast<unsigned char *> (strrchr(reinterpret_cast<char *>(_host), '.')); - if (pso != NULL && pso > _host) { + if (pso != nullptr && pso > _host) { pso--; solen = 0; while (pso > _host && *pso != '.') { @@ -367,7 +360,7 @@ URL::SetURL(const unsigned char *url, size_t length) extension = reinterpret_cast<unsigned char *> (strrchr(reinterpret_cast<char *>(_filename), '.')); - if (extension != NULL) { + if (extension != nullptr) { extension++; strcpy(reinterpret_cast<char *>(_extension), reinterpret_cast<char *>(extension)); @@ -376,7 +369,7 @@ URL::SetURL(const unsigned char *url, size_t length) // Parse params part. if ((ptmp = reinterpret_cast<unsigned char *> - (strchr(reinterpret_cast<char *>(_path), ';'))) != NULL) { + (strchr(reinterpret_cast<char *>(_path), ';'))) != nullptr) { ptmp++; _startParams = _startPath + (ptmp - _path); ParseURLPart<IsParamsChar>(ptmp, _params, sizeof(_params)); @@ -457,7 +450,7 @@ URL::GetToken(URL_CONTEXT &ctx) if (_token[0] != '\0') return _token; else - return NULL; + return nullptr; } const char * @@ -546,10 +539,9 @@ URL::Dump() const unsigned char *token; URL_CONTEXT ctx; - while ((token = GetToken(ctx)) != NULL) { + while ((token = GetToken(ctx)) != nullptr) { printf("TOKEN: %s '%s'\n", ContextName(ctx), token); } } } -} diff --git a/searchlib/src/vespa/searchlib/util/url.h b/searchlib/src/vespa/searchlib/util/url.h index 71c8e16ef52..88a4ef6d9f7 100644 --- a/searchlib/src/vespa/searchlib/util/url.h +++ b/searchlib/src/vespa/searchlib/util/url.h @@ -24,8 +24,9 @@ * roughly 40kB / instance. */ -namespace search { -namespace util { +#include <cstddef> + +namespace search::util { class URL { @@ -252,8 +253,8 @@ public: /** * Get tokens with corresponding context information from the current url. * The first call to this function will return the first token in the url. - * This function may be called repetedly untill the value NULL is returned. - * @return Pointer to string containing the token, NULL when all tokens have + * This function may be called repetedly untill the value nullptr is returned. + * @return Pointer to string containing the token, nullptr when all tokens have * been returned. */ const unsigned char *GetToken(URL_CONTEXT &ctx); @@ -271,7 +272,4 @@ public: void Dump(); }; -} -} - - +}
\ No newline at end of file diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsumformat.cpp b/searchsummary/src/vespa/searchsummary/docsummary/docsumformat.cpp index f964eafb2c9..baa2afb4631 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/docsumformat.cpp +++ b/searchsummary/src/vespa/searchsummary/docsummary/docsumformat.cpp @@ -1,9 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "docsumformat.h" +#include <cassert> -namespace search { -namespace docsummary { +namespace search::docsummary { size_t DocsumFormat::addByte(search::RawBuf &target, uint8_t value) @@ -98,5 +98,4 @@ DocsumFormat::addEmpty(ResType type, search::RawBuf &target) return 0; } -} // namespace docsummary -} // namespace search +} diff --git a/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.cpp b/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.cpp index 5b38a00fa3b..4b7e3c49cf5 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.cpp +++ b/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.cpp @@ -41,6 +41,28 @@ KeywordExtractor::~KeywordExtractor() } } +KeywordExtractor::IndexPrefix::IndexPrefix(const char *prefix, IndexPrefix **list) + : _prefix(NULL), + _prefixLen(0), + _next(NULL) +{ + _prefix = strdup(prefix); + assert(_prefix != NULL); + _prefixLen = strlen(prefix); + _next = *list; + *list = this; +} + +KeywordExtractor::IndexPrefix::~IndexPrefix() +{ + free(_prefix); +} + +bool +KeywordExtractor::IndexPrefix::Match(const char *idxName) const +{ + return (strncmp(idxName, _prefix, _prefixLen) == 0); +} void KeywordExtractor::AddLegalIndexSpec(const char *spec) diff --git a/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.h b/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.h index a276b5bf38a..5ee598d98d9 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.h +++ b/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.h @@ -31,29 +31,9 @@ public: int _prefixLen; IndexPrefix *_next; - - IndexPrefix(const char *prefix, - IndexPrefix **list) - : _prefix(NULL), - _prefixLen(0), - _next(NULL) - { - _prefix = strdup(prefix); - assert(_prefix != NULL); - _prefixLen = strlen(prefix); - _next = *list; - *list = this; - } - - ~IndexPrefix() - { - free(_prefix); - } - - bool Match(const char *idxName) const - { - return (strncmp(idxName, _prefix, _prefixLen) == 0); - } + IndexPrefix(const char *prefix, IndexPrefix **list); + ~IndexPrefix(); + bool Match(const char *idxName) const; }; private: diff --git a/searchsummary/src/vespa/searchsummary/docsummary/resultclass.cpp b/searchsummary/src/vespa/searchsummary/docsummary/resultclass.cpp index 9c28861eee6..ba63d2cd6a1 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/resultclass.cpp +++ b/searchsummary/src/vespa/searchsummary/docsummary/resultclass.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 "resultclass.h" #include "resultconfig.h" +#include <cassert> #include <zlib.h> namespace search { diff --git a/vespalog/src/vespa/log/log.h b/vespalog/src/vespa/log/log.h index a14ff87e1be..6ecd69de792 100644 --- a/vespalog/src/vespa/log/log.h +++ b/vespalog/src/vespa/log/log.h @@ -2,7 +2,7 @@ #pragma once #include <memory> -#include <inttypes.h> +#include <cstdint> #include <sys/types.h> // for pid_t #include <new> // for placement new #include <cstdlib> // for malloc |