diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-01-05 10:22:08 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-01-05 10:22:08 +0000 |
commit | 11ce3477660410df0b858b9111c129975ecbe6f4 (patch) | |
tree | 60996cc74746a9d906fe65ed5aaaf0f454001cc5 /juniper | |
parent | cbe2b9f63a29e784e6f46e5d2063c88529796fe2 (diff) |
Juniper no longer needs vespalib.
Diffstat (limited to 'juniper')
27 files changed, 68 insertions, 103 deletions
diff --git a/juniper/CMakeLists.txt b/juniper/CMakeLists.txt index 8bbfb1ccf93..f60405fedce 100644 --- a/juniper/CMakeLists.txt +++ b/juniper/CMakeLists.txt @@ -4,8 +4,6 @@ vespa_define_module( fastos fastlib_fast vespalog - staging_vespalib - LIBS src/vespa/juniper diff --git a/juniper/src/vespa/juniper/Matcher.cpp b/juniper/src/vespa/juniper/Matcher.cpp index 2a9ab3e52eb..2eeac3417af 100644 --- a/juniper/src/vespa/juniper/Matcher.cpp +++ b/juniper/src/vespa/juniper/Matcher.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. -/* $Id$ */ -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".juniper.matcher"); #include <algorithm> #include <string> #include "query.h" @@ -18,6 +14,8 @@ LOG_SETUP(".juniper.matcher"); #include "result.h" #include "juniperparams.h" #include "config.h" +#include <vespa/log/log.h> +LOG_SETUP(".juniper.matcher"); unsigned debug_level = 0; diff --git a/juniper/src/vespa/juniper/Matcher.h b/juniper/src/vespa/juniper/Matcher.h index 01f230c8f39..dbfa99fb7a4 100644 --- a/juniper/src/vespa/juniper/Matcher.h +++ b/juniper/src/vespa/juniper/Matcher.h @@ -190,11 +190,6 @@ private: void popcontext(int ctxt); }; -/** Other utilities exposed for debug purposes - */ -bool wordchar(const unsigned char* s); -bool nonwordchar(const unsigned char* s); - /** Actually build / release the textual summary from a description. * These functions is not dependent of any Matcher info. */ diff --git a/juniper/src/vespa/juniper/SummaryConfig.cpp b/juniper/src/vespa/juniper/SummaryConfig.cpp index 58774cc6c5b..03e4747b772 100644 --- a/juniper/src/vespa/juniper/SummaryConfig.cpp +++ b/juniper/src/vespa/juniper/SummaryConfig.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> + #define _NEED_SUMMARY_CONFIG_IMPL 1 #include "SummaryConfig.h" #include <string> -#include <sstream> +#include <cstring> SummaryConfig* CreateSummaryConfig(const char* highlight_on, const char* highlight_off, diff --git a/juniper/src/vespa/juniper/SummaryConfig.h b/juniper/src/vespa/juniper/SummaryConfig.h index f5d19897c74..f2c89f41d01 100644 --- a/juniper/src/vespa/juniper/SummaryConfig.h +++ b/juniper/src/vespa/juniper/SummaryConfig.h @@ -1,4 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// #pragma once #include <string> diff --git a/juniper/src/vespa/juniper/config.cpp b/juniper/src/vespa/juniper/config.cpp index 301e7ff0c3b..b52da1c738b 100644 --- a/juniper/src/vespa/juniper/config.cpp +++ b/juniper/src/vespa/juniper/config.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. /* $Id$ */ -#include <vespa/fastos/fastos.h> #include "config.h" #include "IJuniperProperties.h" #include "rpinterface.h" diff --git a/juniper/src/vespa/juniper/dpinterface.cpp b/juniper/src/vespa/juniper/dpinterface.cpp index 874290b840e..1e96396edb8 100644 --- a/juniper/src/vespa/juniper/dpinterface.cpp +++ b/juniper/src/vespa/juniper/dpinterface.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. /* $Id$ */ -#include <vespa/fastos/fastos.h> #include "dpinterface.h" diff --git a/juniper/src/vespa/juniper/dpinterface.h b/juniper/src/vespa/juniper/dpinterface.h index f5bc9b50657..da0747e6eb8 100644 --- a/juniper/src/vespa/juniper/dpinterface.h +++ b/juniper/src/vespa/juniper/dpinterface.h @@ -1,8 +1,10 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/* $Id$ */ #pragma once +#include <cstddef> +#include <cstdio> + /** @file dpinterface.h This file is the main include file for inetgrators of the document * processing/indexing stages of Juniper specific processing. For integrating * result processing (core Juniper - highlighting/proximity metric computation) refer to @@ -16,8 +18,7 @@ #define UNIT_SEPARATOR 0x1F -namespace juniper -{ +namespace juniper { /** class Tokentype Hint as to which type of token this is. * If this information is already aggregated by the caller diff --git a/juniper/src/vespa/juniper/expcache.cpp b/juniper/src/vespa/juniper/expcache.cpp index 3e61add149a..7982b28c8f9 100644 --- a/juniper/src/vespa/juniper/expcache.cpp +++ b/juniper/src/vespa/juniper/expcache.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 "expcache.h" #include "matchobject.h" diff --git a/juniper/src/vespa/juniper/juniperparams.cpp b/juniper/src/vespa/juniper/juniperparams.cpp index 0824b300d5c..ff5235d2494 100644 --- a/juniper/src/vespa/juniper/juniperparams.cpp +++ b/juniper/src/vespa/juniper/juniperparams.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 "juniperdebug.h" #include "juniperparams.h" #include "Matcher.h" +#include <cstring> // DocsumParams implementation: // --------------------------------------------------------------- diff --git a/juniper/src/vespa/juniper/keyocc.cpp b/juniper/src/vespa/juniper/keyocc.cpp index 623a90311bc..861b42be745 100644 --- a/juniper/src/vespa/juniper/keyocc.cpp +++ b/juniper/src/vespa/juniper/keyocc.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 "keyocc.h" key_occ::key_occ(const char* term_, off_t spos, off_t stoken, int len) : diff --git a/juniper/src/vespa/juniper/matchelem.cpp b/juniper/src/vespa/juniper/matchelem.cpp index 4abdb618507..3db45393a7b 100644 --- a/juniper/src/vespa/juniper/matchelem.cpp +++ b/juniper/src/vespa/juniper/matchelem.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. -/* $Id$ */ -#include <vespa/fastos/fastos.h> #include "matchelem.h" MatchElement::MatchElement(off_t spos, off_t stoken) : diff --git a/juniper/src/vespa/juniper/matchobject.cpp b/juniper/src/vespa/juniper/matchobject.cpp index 1c66a485ec0..dee70362545 100644 --- a/juniper/src/vespa/juniper/matchobject.cpp +++ b/juniper/src/vespa/juniper/matchobject.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. -/* $Id$ */ -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".juniper.matchobject"); #include "query.h" #include "matchobject.h" #include "juniperdebug.h" @@ -14,6 +10,8 @@ LOG_SETUP(".juniper.matchobject"); #include "querymodifier.h" #include "queryhandle.h" #include <stack> +#include <vespa/log/log.h> +LOG_SETUP(".juniper.matchobject"); class traverser : public IQueryExprVisitor { diff --git a/juniper/src/vespa/juniper/mcand.cpp b/juniper/src/vespa/juniper/mcand.cpp index b8c2434c7a5..d657bb020ba 100644 --- a/juniper/src/vespa/juniper/mcand.cpp +++ b/juniper/src/vespa/juniper/mcand.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. -/* $Id$ */ -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".juniper.mcand"); #include "mcand.h" #include "Matcher.h" #include "juniperdebug.h" #include <vespa/vespalib/util/stringfmt.h> +#include <vespa/log/log.h> +LOG_SETUP(".juniper.mcand"); // Invariant: elms has room for query->_arity match element pointers MatchCandidate::MatchCandidate(QueryExpr* m, MatchElement** elms, off_t ctxt_start) : diff --git a/juniper/src/vespa/juniper/propreader.cpp b/juniper/src/vespa/juniper/propreader.cpp index 3797e0d02b7..117d5c09956 100644 --- a/juniper/src/vespa/juniper/propreader.cpp +++ b/juniper/src/vespa/juniper/propreader.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. -/* - * Simple property reader (format a la fsearchrc) - */ -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".juniper.propreader"); #include "propreader.h" #include <vespa/fastlib/io/bufferedfile.h> #include "juniperdebug.h" +#include <vespa/log/log.h> +LOG_SETUP(".juniper.propreader"); PropReader::PropReader(const char* filename) : _keymap() diff --git a/juniper/src/vespa/juniper/query.h b/juniper/src/vespa/juniper/query.h index a7cd82ae308..9a6f37b3c0e 100644 --- a/juniper/src/vespa/juniper/query.h +++ b/juniper/src/vespa/juniper/query.h @@ -1,13 +1,14 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/* $Id$ */ #pragma once +#include <cstddef> +#include <cstdint> + #ifndef JUNIPER_RPIF #define JUNIPER_RPIF 1 #endif - /** @file query.h * This file describes describes Juniper's expected interface for * advanced query processing. Clients of Juniper wishing to receive optimal @@ -24,8 +25,7 @@ * single string of null or space separated words and is depreciated as of Juniper v.2.0.x */ -namespace juniper -{ +namespace juniper { enum ItemCreator { @@ -48,7 +48,7 @@ struct QueryItem; class IQuery { public: - virtual ~IQuery() {} + virtual ~IQuery() { } /** Traverse the query. * This will lead to a prefix depth first traversal of the complete query @@ -190,9 +190,7 @@ public: const char* keyword, const size_t length = 0, bool prefix = false, bool specialToken = false) = 0; - virtual ~IQueryVisitor() {}; + virtual ~IQueryVisitor() { } }; - -} // end namespace juniper - +} diff --git a/juniper/src/vespa/juniper/queryhandle.cpp b/juniper/src/vespa/juniper/queryhandle.cpp index 67a4fe1ced5..497918ae1f1 100644 --- a/juniper/src/vespa/juniper/queryhandle.cpp +++ b/juniper/src/vespa/juniper/queryhandle.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. -/* $Id$ */ -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".juniper.queryhandle"); #include "query.h" #include "queryhandle.h" #include "juniperdebug.h" #include "Matcher.h" #include "queryparser.h" #include "querymodifier.h" +#include <vespa/log/log.h> +LOG_SETUP(".juniper.queryhandle"); namespace juniper { diff --git a/juniper/src/vespa/juniper/querymodifier.cpp b/juniper/src/vespa/juniper/querymodifier.cpp index b5312d6fc32..e72404fe82f 100644 --- a/juniper/src/vespa/juniper/querymodifier.cpp +++ b/juniper/src/vespa/juniper/querymodifier.cpp @@ -1,15 +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(".juniper.querymodifier"); + #include "juniperdebug.h" #include "querymodifier.h" #include "foreach_utils.h" #include "querynode.h" +#include <vespa/log/log.h> +LOG_SETUP(".juniper.querymodifier"); -namespace juniper -{ +namespace juniper { Rewriter::Rewriter(IRewriter* rewriter, bool for_query, bool for_document) : _rewriter(rewriter), _for_query(for_query), _for_document(for_document) diff --git a/juniper/src/vespa/juniper/querynode.cpp b/juniper/src/vespa/juniper/querynode.cpp index 75c47f5479b..8718a76bf61 100644 --- a/juniper/src/vespa/juniper/querynode.cpp +++ b/juniper/src/vespa/juniper/querynode.cpp @@ -1,25 +1,20 @@ // 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 <vespa/log/log.h> -LOG_SETUP(".juniper.querynode"); #include "querynode.h" #include "queryvisitor.h" #include "juniperdebug.h" #include <vespa/vespalib/util/stringfmt.h> - - +#include <vespa/log/log.h> +LOG_SETUP(".juniper.querynode"); /** Implementation of the internal query data structure used by the matching engine * in Matcher.h */ - QueryExpr::QueryExpr(int weight, int arity) : _options(0), _weight(weight), _arity(arity), _parent(NULL), _childno(0) -{} +{ } QueryExpr::QueryExpr(QueryExpr* e) : _options(e->_options), @@ -27,10 +22,9 @@ QueryExpr::QueryExpr(QueryExpr* e) : _arity(e->_arity), _parent(NULL), _childno(0) -{} +{ } -QueryExpr::~QueryExpr() -{} +QueryExpr::~QueryExpr() { } QueryTerm::QueryTerm(const char* t, int length, int ix, int wgt) diff --git a/juniper/src/vespa/juniper/queryparser.cpp b/juniper/src/vespa/juniper/queryparser.cpp index b7e4a49fcdf..2355e41d005 100644 --- a/juniper/src/vespa/juniper/queryparser.cpp +++ b/juniper/src/vespa/juniper/queryparser.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. +// /* Simple prefix query parser for Juniper for debugging purposes */ -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".juniper.queryparser"); #include "queryparser.h" #include "juniperdebug.h" #include <vector> +#include <vespa/log/log.h> +LOG_SETUP(".juniper.queryparser"); + #define TOK_NORM_OP 1 #define TOK_PARAM1_OP 2 -namespace juniper -{ +namespace juniper { // simple syntax tree diff --git a/juniper/src/vespa/juniper/queryvisitor.cpp b/juniper/src/vespa/juniper/queryvisitor.cpp index 4d739204637..21943b0615f 100644 --- a/juniper/src/vespa/juniper/queryvisitor.cpp +++ b/juniper/src/vespa/juniper/queryvisitor.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. -/* $Id$ */ -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".juniper.queryvisitor"); #include "query.h" #include "juniperdebug.h" #include "queryvisitor.h" @@ -11,6 +7,8 @@ LOG_SETUP(".juniper.queryvisitor"); #include "queryhandle.h" #include "querymodifier.h" +#include <vespa/log/log.h> +LOG_SETUP(".juniper.queryvisitor"); /* Implementation of the query visit interface between Juniper and the query provider */ /* Implementation note: insert() must be called for all calls in the tree to diff --git a/juniper/src/vespa/juniper/reducematcher.cpp b/juniper/src/vespa/juniper/reducematcher.cpp index 68b2452d03c..89d2bda8632 100644 --- a/juniper/src/vespa/juniper/reducematcher.cpp +++ b/juniper/src/vespa/juniper/reducematcher.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(".juniper.reducematcher"); + #include "juniperdebug.h" #include "reducematcher.h" #include "querynode.h" -namespace juniper -{ +#include <vespa/log/log.h> +LOG_SETUP(".juniper.reducematcher"); + +namespace juniper { ReduceMatcher::ReduceMatcher() : _matchers() diff --git a/juniper/src/vespa/juniper/result.cpp b/juniper/src/vespa/juniper/result.cpp index 66a1a5a8656..786e9aa15d1 100644 --- a/juniper/src/vespa/juniper/result.cpp +++ b/juniper/src/vespa/juniper/result.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 <vespa/log/log.h> -LOG_SETUP(".juniper.result"); + #define _NEED_SUMMARY_CONFIG_IMPL 1 #include "SummaryConfig.h" #include "rpinterface.h" @@ -12,8 +10,10 @@ LOG_SETUP(".juniper.result"); #include "config.h" #include "appender.h" -namespace juniper -{ +#include <vespa/log/log.h> +LOG_SETUP(".juniper.result"); + +namespace juniper { /** Actual implementation of Juniper generated summaries. */ class SummaryImpl : public Summary diff --git a/juniper/src/vespa/juniper/rpinterface.cpp b/juniper/src/vespa/juniper/rpinterface.cpp index 285eb9bacd6..9f10972a448 100644 --- a/juniper/src/vespa/juniper/rpinterface.cpp +++ b/juniper/src/vespa/juniper/rpinterface.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. -/* $Id$ */ -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".juniper.rpinterface"); #include "rpinterface.h" #include <string> #include <vector> @@ -20,10 +16,12 @@ LOG_SETUP(".juniper.rpinterface"); #include "querymodifier.h" #include <vespa/fastlib/text/normwordfolder.h> +#include <vespa/log/log.h> +LOG_SETUP(".juniper.rpinterface"); + /* Implementation of the interface between Juniper and the content/query provider */ -namespace juniper -{ +namespace juniper { bool AnalyseCompatible(Config* conf1, Config* conf2) { diff --git a/juniper/src/vespa/juniper/specialtokenregistry.cpp b/juniper/src/vespa/juniper/specialtokenregistry.cpp index 0533c10efdf..92a9b719751 100644 --- a/juniper/src/vespa/juniper/specialtokenregistry.cpp +++ b/juniper/src/vespa/juniper/specialtokenregistry.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 "specialtokenregistry.h" namespace { diff --git a/juniper/src/vespa/juniper/sumdesc.cpp b/juniper/src/vespa/juniper/sumdesc.cpp index 9721a84d1f5..f6c92432d0b 100644 --- a/juniper/src/vespa/juniper/sumdesc.cpp +++ b/juniper/src/vespa/juniper/sumdesc.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. -/* $Id$ */ -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".juniper.sumdesc"); #include "sumdesc.h" #include "juniperdebug.h" -#include <vespa/fastlib/text/unicodeutil.h> #include "Matcher.h" #include "appender.h" +#include <vespa/fastlib/text/unicodeutil.h> + +#include <vespa/log/log.h> +LOG_SETUP(".juniper.sumdesc"); /** SummaryDesc: A class of objects describing a query highlight * dynamic summary based on the current state of the provided @@ -17,6 +16,8 @@ LOG_SETUP(".juniper.sumdesc"); /* a few utilities: */ +namespace { + bool wordchar(const unsigned char* s) { unsigned char c = *s; @@ -149,6 +150,7 @@ int complete_word(unsigned char* start, ssize_t length, return moved; } +} SummaryDesc::highlight_desc::highlight_desc(off_t pos, ssize_t len, bool highlight) diff --git a/juniper/src/vespa/juniper/tokenizer.cpp b/juniper/src/vespa/juniper/tokenizer.cpp index 262c0046fb3..719f470189b 100644 --- a/juniper/src/vespa/juniper/tokenizer.cpp +++ b/juniper/src/vespa/juniper/tokenizer.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(".juniper.tokenizer"); -#include <vespa/fastlib/text/wordfolder.h> +// #include "tokenizer.h" #include "juniperdebug.h" +#include <vespa/fastlib/text/wordfolder.h> + +#include <vespa/log/log.h> +LOG_SETUP(".juniper.tokenizer"); JuniperTokenizer::JuniperTokenizer(Fast_WordFolder* wordfolder, const char* text, size_t len, ITokenProcessor* successor, const juniper::SpecialTokenRegistry * registry) : _wordfolder(wordfolder), _text(text), _len(len), _successor(successor), _registry(registry), _charpos(0), _wordpos(0) -{ -} +{ } void JuniperTokenizer::SetText(const char* text, size_t len) |