diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2016-12-18 05:17:19 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2016-12-19 14:15:45 +0000 |
commit | 561d81f41cf3ac93990c4d13743c97aff932f1c0 (patch) | |
tree | 8b14ef6796af0bc1946d49aa54513cdae8449f34 /vsm | |
parent | 6a33e844b93f483f09bca7cda744cae538209369 (diff) |
Only include what you need
Diffstat (limited to 'vsm')
20 files changed, 56 insertions, 126 deletions
diff --git a/vsm/src/tests/charbuffer/charbuffer.cpp b/vsm/src/tests/charbuffer/charbuffer.cpp index b285005de42..4d4148b6426 100644 --- a/vsm/src/tests/charbuffer/charbuffer.cpp +++ b/vsm/src/tests/charbuffer/charbuffer.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("charbuffer_test"); #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vsm/common/charbuffer.h> diff --git a/vsm/src/tests/docsum/docsum.cpp b/vsm/src/tests/docsum/docsum.cpp index 366fae65849..c084bd5593f 100644 --- a/vsm/src/tests/docsum/docsum.cpp +++ b/vsm/src/tests/docsum/docsum.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("docsum_test"); #include <vespa/vespalib/testkit/testapp.h> #include <vector> diff --git a/vsm/src/tests/textutil/textutil.cpp b/vsm/src/tests/textutil/textutil.cpp index ba6a276eb49..154425e0deb 100644 --- a/vsm/src/tests/textutil/textutil.cpp +++ b/vsm/src/tests/textutil/textutil.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("textutil_test"); #include <vespa/vespalib/testkit/testapp.h> #include <vespa/fastlib/text/unicodeutil.h> diff --git a/vsm/src/vespa/vsm/common/charbuffer.cpp b/vsm/src/vespa/vsm/common/charbuffer.cpp index 2cd25314922..0c6945ef6bf 100644 --- a/vsm/src/vespa/vsm/common/charbuffer.cpp +++ b/vsm/src/vespa/vsm/common/charbuffer.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/vsm/common/charbuffer.h> +#include "charbuffer.h" +#include <cstring> + +namespace vsm { -namespace vsm -{ CharBuffer::CharBuffer(size_t len) : _buffer(len), _pos(0) -{ -} +{ } void CharBuffer::put(const char * src, size_t n) diff --git a/vsm/src/vespa/vsm/common/charbuffer.h b/vsm/src/vespa/vsm/common/charbuffer.h index 9984667bc70..dae3a829d0f 100644 --- a/vsm/src/vespa/vsm/common/charbuffer.h +++ b/vsm/src/vespa/vsm/common/charbuffer.h @@ -2,9 +2,9 @@ #pragma once #include <vector> +#include <memory> -namespace vsm -{ +namespace vsm { /** * Simple growable char buffer. diff --git a/vsm/src/vespa/vsm/common/storagedocument.cpp b/vsm/src/vespa/vsm/common/storagedocument.cpp index 8dae28978a6..4963e1661f0 100644 --- a/vsm/src/vespa/vsm/common/storagedocument.cpp +++ b/vsm/src/vespa/vsm/common/storagedocument.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 "storagedocument.h" #include <vespa/document/fieldvalue/arrayfieldvalue.h> #include <vespa/document/fieldvalue/weightedsetfieldvalue.h> #include <vespa/document/datatype/datatype.h> -#include <vespa/vsm/common/storagedocument.h> + #include <vespa/log/log.h> LOG_SETUP(".vsm.storagedocument"); -#define DEBUGMASK 0x00 - -namespace vsm -{ +namespace vsm { StorageDocument::StorageDocument(const SharedFieldPathMap & fim) : Document(), @@ -18,8 +15,7 @@ StorageDocument::StorageDocument(const SharedFieldPathMap & fim) : _fieldMap(fim), _cachedFields(), _backedFields() -{ -} +{ } StorageDocument::StorageDocument(document::Document::UP doc) : Document(), @@ -27,12 +23,9 @@ StorageDocument::StorageDocument(document::Document::UP doc) : _fieldMap(), _cachedFields(), _backedFields() -{ -} +{ } -StorageDocument::~StorageDocument() -{ -} +StorageDocument::~StorageDocument() { } void StorageDocument::init() { diff --git a/vsm/src/vespa/vsm/searcher/fieldsearcher.cpp b/vsm/src/vespa/vsm/searcher/fieldsearcher.cpp index 21aecabd8d7..68e59a3e395 100644 --- a/vsm/src/vespa/vsm/searcher/fieldsearcher.cpp +++ b/vsm/src/vespa/vsm/searcher/fieldsearcher.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 <vespa/vsm/searcher/fieldsearcher.h> +#include "fieldsearcher.h" #include <vespa/document/fieldvalue/arrayfieldvalue.h> #include <vespa/document/fieldvalue/weightedsetfieldvalue.h> #include <vespa/vsm/vsm/fieldsearchspec.h> + #include <vespa/log/log.h> LOG_SETUP(".vsm.searcher.fieldsearcher"); -#define DEBUGMASK 0x0 - using search::byte; using search::QueryTerm; using search::QueryTermList; diff --git a/vsm/src/vespa/vsm/searcher/floatfieldsearcher.cpp b/vsm/src/vespa/vsm/searcher/floatfieldsearcher.cpp index 3bb5ab212a0..6761bda71e2 100644 --- a/vsm/src/vespa/vsm/searcher/floatfieldsearcher.cpp +++ b/vsm/src/vespa/vsm/searcher/floatfieldsearcher.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 <limits.h> -#include <vespa/vsm/searcher/floatfieldsearcher.h> +#include "floatfieldsearcher.h" #include <vespa/document/fieldvalue/fieldvalue.h> +#include <climits> using search::QueryTerm; using search::QueryTermList; diff --git a/vsm/src/vespa/vsm/searcher/fold.cpp b/vsm/src/vespa/vsm/searcher/fold.cpp index ea61ad9ac2a..240700784dc 100644 --- a/vsm/src/vespa/vsm/searcher/fold.cpp +++ b/vsm/src/vespa/vsm/searcher/fold.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/vsm/searcher/fold.h> +// +#include "fold.h" -namespace vsm -{ +namespace vsm { const unsigned char * sse2_foldaa(const unsigned char * toFoldOrg, size_t sz, unsigned char * foldedOrg) { diff --git a/vsm/src/vespa/vsm/searcher/futf8strchrfieldsearcher.cpp b/vsm/src/vespa/vsm/searcher/futf8strchrfieldsearcher.cpp index b1f1ecef350..760566150e6 100644 --- a/vsm/src/vespa/vsm/searcher/futf8strchrfieldsearcher.cpp +++ b/vsm/src/vespa/vsm/searcher/futf8strchrfieldsearcher.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/vsm/searcher/futf8strchrfieldsearcher.h> -#include <vespa/vsm/searcher/fold.h> +#include "futf8strchrfieldsearcher.h" +#include "fold.h" #include <vespa/vespalib/util/optimized.h> using vespalib::Optimized; @@ -9,8 +8,7 @@ using search::byte; using search::QueryTerm; using search::v16qi; -namespace vsm -{ +namespace vsm { IMPLEMENT_DUPLICATE(FUTF8StrChrFieldSearcher); diff --git a/vsm/src/vespa/vsm/searcher/intfieldsearcher.cpp b/vsm/src/vespa/vsm/searcher/intfieldsearcher.cpp index 72cedc2c01a..c5a45632903 100644 --- a/vsm/src/vespa/vsm/searcher/intfieldsearcher.cpp +++ b/vsm/src/vespa/vsm/searcher/intfieldsearcher.cpp @@ -1,22 +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 <limits.h> -#include <vespa/vsm/searcher/intfieldsearcher.h> +#include "intfieldsearcher.h" #include <vespa/document/fieldvalue/fieldvalue.h> using search::QueryTerm; using search::QueryTermList; -namespace vsm -{ +namespace vsm { IMPLEMENT_DUPLICATE(IntFieldSearcher); IntFieldSearcher::IntFieldSearcher(FieldIdT fId) : FieldSearcher(fId), _intTerm() -{ -} +{ } void IntFieldSearcher::prepare(QueryTermList & qtl, const SharedSearcherBuf & buf) { diff --git a/vsm/src/vespa/vsm/searcher/strchrfieldsearcher.cpp b/vsm/src/vespa/vsm/searcher/strchrfieldsearcher.cpp index 6c25b5c1efe..34f99a191a3 100644 --- a/vsm/src/vespa/vsm/searcher/strchrfieldsearcher.cpp +++ b/vsm/src/vespa/vsm/searcher/strchrfieldsearcher.cpp @@ -1,17 +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/vsm/searcher/strchrfieldsearcher.h> +#include "strchrfieldsearcher.h" #include <vespa/document/fieldvalue/stringfieldvalue.h> -#include <vespa/log/log.h> -LOG_SETUP(".vsm.searcher.strchrfieldmatcher"); - -#define DEBUGMASK 0x00 using search::QueryTerm; using search::QueryTermList; -namespace vsm -{ +namespace vsm { void StrChrFieldSearcher::prepare(QueryTermList & qtl, const SharedSearcherBuf & buf) { @@ -29,7 +23,6 @@ void StrChrFieldSearcher::onValue(const document::FieldValue & fv) bool StrChrFieldSearcher::matchDoc(const FieldRef & fieldRef) { bool retval(true); - LOG(debug, "Matching %zu bytes in %s", fieldRef.size(), fieldRef.c_str()); if (_qtl.size() > 1) { size_t mintsz = shortestTerm(); if (fieldRef.size() >= mintsz) { diff --git a/vsm/src/vespa/vsm/searcher/utf8exactstringfieldsearcher.cpp b/vsm/src/vespa/vsm/searcher/utf8exactstringfieldsearcher.cpp index 4db05a1a918..38d10944656 100644 --- a/vsm/src/vespa/vsm/searcher/utf8exactstringfieldsearcher.cpp +++ b/vsm/src/vespa/vsm/searcher/utf8exactstringfieldsearcher.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 <vespa/vsm/searcher/utf8exactstringfieldsearcher.h> +#include "utf8exactstringfieldsearcher.h" using search::byte; using search::QueryTerm; using search::QueryTermList; -namespace vsm -{ +namespace vsm { IMPLEMENT_DUPLICATE(UTF8ExactStringFieldSearcher); diff --git a/vsm/src/vespa/vsm/searcher/utf8flexiblestringfieldsearcher.cpp b/vsm/src/vespa/vsm/searcher/utf8flexiblestringfieldsearcher.cpp index 48fd3652f5c..99013f38a9e 100644 --- a/vsm/src/vespa/vsm/searcher/utf8flexiblestringfieldsearcher.cpp +++ b/vsm/src/vespa/vsm/searcher/utf8flexiblestringfieldsearcher.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 "utf8flexiblestringfieldsearcher.h" + #include <vespa/log/log.h> LOG_SETUP(".vsm.searcher.utf8flexiblestringfieldsearcher"); -#include <vespa/vsm/searcher/utf8flexiblestringfieldsearcher.h> - using search::QueryTerm; using search::QueryTermList; -namespace vsm -{ +namespace vsm { IMPLEMENT_DUPLICATE(UTF8FlexibleStringFieldSearcher); @@ -58,12 +56,10 @@ UTF8FlexibleStringFieldSearcher::matchTerm(const FieldRef & f, QueryTerm & qt) UTF8FlexibleStringFieldSearcher::UTF8FlexibleStringFieldSearcher() : UTF8StringFieldSearcherBase() -{ -} +{ } UTF8FlexibleStringFieldSearcher::UTF8FlexibleStringFieldSearcher(FieldIdT fId) : UTF8StringFieldSearcherBase(fId) -{ -} +{ } } diff --git a/vsm/src/vespa/vsm/searcher/utf8strchrfieldsearcher.cpp b/vsm/src/vespa/vsm/searcher/utf8strchrfieldsearcher.cpp index e3fcff8d9a7..517f4c21274 100644 --- a/vsm/src/vespa/vsm/searcher/utf8strchrfieldsearcher.cpp +++ b/vsm/src/vespa/vsm/searcher/utf8strchrfieldsearcher.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 <vespa/vsm/searcher/utf8strchrfieldsearcher.h> +#include "utf8strchrfieldsearcher.h" using search::QueryTerm; using search::QueryTermList; using search::byte; -namespace vsm -{ +namespace vsm { IMPLEMENT_DUPLICATE(UTF8StrChrFieldSearcher); diff --git a/vsm/src/vespa/vsm/searcher/utf8substringsnippetmodifier.cpp b/vsm/src/vespa/vsm/searcher/utf8substringsnippetmodifier.cpp index 709875e1782..cc31a070d72 100644 --- a/vsm/src/vespa/vsm/searcher/utf8substringsnippetmodifier.cpp +++ b/vsm/src/vespa/vsm/searcher/utf8substringsnippetmodifier.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 <vespa/log/log.h> -LOG_SETUP(".searcher.utf8substringsnippetmodifier"); -#include <vespa/vsm/searcher/utf8substringsnippetmodifier.h> +#include "utf8substringsnippetmodifier.h" using search::byte; using search::QueryTerm; using search::QueryTermList; -namespace vsm -{ +namespace vsm { IMPLEMENT_DUPLICATE(UTF8SubstringSnippetModifier); @@ -18,7 +14,6 @@ UTF8SubstringSnippetModifier::matchTerms(const FieldRef & f, const size_t mintsz { _modified->reset(); _readPtr = f.c_str(); - LOG(spam, "matchTerm: FieldRef.size = %zd", f.size()); const byte * src = reinterpret_cast<const byte *> (f.c_str()); // resize ucs4 buffer if (f.size() >= _buf->size()) { @@ -52,9 +47,6 @@ UTF8SubstringSnippetModifier::matchTerms(const FieldRef & f, const size_t mintsz if (titr == tend) { const char * mbegin = f.c_str() + (*_offsets)[ditr - dbegin]; const char * mend = f.c_str() + ((dtmp < dend) ? ((*_offsets)[dtmp - dbegin]) : f.size()); - LOG(spam, "match: ditr = %d(%zd), dtmp = %d(%zd), mbegin = %d(%zd), mend = %d(%zd)", - *ditr, (ditr - dbegin), *dtmp, (dtmp - dbegin), - (int)*mbegin, (mbegin - f.c_str()), (int)*mend, (mend - f.c_str())); if (_readPtr <= mbegin) { // We will only copy from the field ref once. // If we have overlapping matches only the first one will be considered. diff --git a/vsm/src/vespa/vsm/searcher/utf8suffixstringfieldsearcher.cpp b/vsm/src/vespa/vsm/searcher/utf8suffixstringfieldsearcher.cpp index e5161de8071..e7851017663 100644 --- a/vsm/src/vespa/vsm/searcher/utf8suffixstringfieldsearcher.cpp +++ b/vsm/src/vespa/vsm/searcher/utf8suffixstringfieldsearcher.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 <vespa/vsm/searcher/utf8suffixstringfieldsearcher.h> +#include "utf8suffixstringfieldsearcher.h" using search::byte; using search::QueryTerm; using search::QueryTermList; -namespace vsm -{ +namespace vsm { IMPLEMENT_DUPLICATE(UTF8SuffixStringFieldSearcher); diff --git a/vsm/src/vespa/vsm/vsm/docsumfieldspec.cpp b/vsm/src/vespa/vsm/vsm/docsumfieldspec.cpp index 127f95ea985..dc1406f6cf2 100644 --- a/vsm/src/vespa/vsm/vsm/docsumfieldspec.cpp +++ b/vsm/src/vespa/vsm/vsm/docsumfieldspec.cpp @@ -1,20 +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 <vespa/vsm/vsm/docsumfieldspec.h> +#include "docsumfieldspec.h" namespace vsm { DocsumFieldSpec::FieldIdentifier::FieldIdentifier() : _id(StringFieldIdTMap::npos), _path() -{ -} +{ } DocsumFieldSpec::FieldIdentifier::FieldIdentifier(FieldIdT id, FieldPath path) : _id(id), _path(path) -{ -} +{ } DocsumFieldSpec::DocsumFieldSpec() : @@ -22,8 +19,7 @@ DocsumFieldSpec::DocsumFieldSpec() : _command(VsmsummaryConfig::Fieldmap::NONE), _outputField(), _inputFields() -{ -} +{ } DocsumFieldSpec::DocsumFieldSpec(search::docsummary::ResType resultType, VsmsummaryConfig::Fieldmap::Command command) : @@ -31,8 +27,6 @@ DocsumFieldSpec::DocsumFieldSpec(search::docsummary::ResType resultType, _command(command), _outputField(), _inputFields() -{ -} +{ } } - diff --git a/vsm/src/vespa/vsm/vsm/flattendocsumwriter.cpp b/vsm/src/vespa/vsm/vsm/flattendocsumwriter.cpp index a2f8c6220e6..8685c4ebfa6 100644 --- a/vsm/src/vespa/vsm/vsm/flattendocsumwriter.cpp +++ b/vsm/src/vespa/vsm/vsm/flattendocsumwriter.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 "flattendocsumwriter.h" #include <vespa/document/fieldvalue/fieldvalues.h> -#include <vespa/vsm/vsm/flattendocsumwriter.h> namespace vsm { @@ -36,7 +35,6 @@ FlattenDocsumWriter::FlattenDocsumWriter(const vespalib::string & separator) : _output(32), _separator(separator), _useSeparator(false) -{ -} +{ } } diff --git a/vsm/src/vespa/vsm/vsm/vsm-adapter.cpp b/vsm/src/vespa/vsm/vsm/vsm-adapter.cpp index 85375cf5f6f..b9b96691c90 100644 --- a/vsm/src/vespa/vsm/vsm/vsm-adapter.cpp +++ b/vsm/src/vespa/vsm/vsm/vsm-adapter.cpp @@ -1,10 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// 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(".vsm.vsm-adapter"); #include <vespa/vsm/vsm/vsm-adapter.h> #include <vespa/vsm/vsm/docsumconfig.h> @@ -13,6 +7,9 @@ LOG_SETUP(".vsm.vsm-adapter"); #include <vespa/config-summary.h> #include <vespa/config-summarymap.h> +#include <vespa/log/log.h> +LOG_SETUP(".vsm.vsm-adapter"); + using search::docsummary::ResConfigEntry; using search::docsummary::KeywordExtractor; using config::ConfigSnapshot; @@ -22,8 +19,7 @@ namespace vsm { GetDocsumsStateCallback::GetDocsumsStateCallback() : _summaryFeatures(), _rankFeatures() -{ -} +{ } void GetDocsumsStateCallback::FillSummaryFeatures(GetDocsumsState * state, IDocsumEnvironment * env) { @@ -54,29 +50,23 @@ void GetDocsumsStateCallback::FillDocumentLocations(GetDocsumsState *state, IDoc } -GetDocsumsStateCallback::~GetDocsumsStateCallback(void) -{ -} +GetDocsumsStateCallback::~GetDocsumsStateCallback(void) { } DocsumTools::FieldSpec::FieldSpec() : _outputName(), _inputNames(), _command(VsmsummaryConfig::Fieldmap::NONE) -{ -} +{ } DocsumTools::DocsumTools(std::unique_ptr<DynamicDocsumWriter> writer) : _writer(std::move(writer)), _juniper(), _resultClass(), _fieldSpecs() -{ -} +{ } -DocsumTools::~DocsumTools() -{ -} +DocsumTools::~DocsumTools() { } bool DocsumTools::obtainFieldNames(const FastS_VsmsummaryHandle &cfg) |