summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-09-30 17:10:30 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-09-30 17:10:30 +0000
commitcd700875d174d8d12ea501f5ca71f2723307c65c (patch)
tree10e3025f18bae83ac184855531232e37f157c864 /searchcore
parentfbbf3a917e3b3c3e13919b1056fda72a5704099c (diff)
Remove some more transport related stuff.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/tests/proton/docsummary/docsummary.cpp5
-rw-r--r--searchcore/src/tests/proton/matching/matching_test.cpp38
-rw-r--r--searchcore/src/tests/proton/summaryengine/summaryengine.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/matcher.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/result_processor.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/result_processor.h4
7 files changed, 25 insertions, 38 deletions
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp
index 0a9f3127844..0e521e473ae 100644
--- a/searchcore/src/tests/proton/docsummary/docsummary.cpp
+++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp
@@ -23,7 +23,6 @@
#include <vespa/searchcore/proton/server/searchview.h>
#include <vespa/searchcore/proton/server/summaryadapter.h>
#include <vespa/searchlib/common/gatecallback.h>
-#include <vespa/searchlib/common/transport.h>
#include <vespa/searchlib/engine/docsumapi.h>
#include <vespa/searchlib/index/docbuilder.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
@@ -359,7 +358,7 @@ Test::assertTensor(const Tensor::UP & exp, const std::string & fieldName,
uint32_t classId;
ASSERT_LESS_EQUAL(sizeof(classId), docsum.data.size());
memcpy(&classId, docsum.data.c_str(), sizeof(classId));
- ASSERT_EQUAL(::search::fs4transport::SLIME_MAGIC_ID, classId);
+ ASSERT_EQUAL(::search::docsummary::SLIME_MAGIC_ID, classId);
vespalib::Slime slime;
vespalib::Memory serialized(docsum.data.c_str() + sizeof(classId),
docsum.data.size() - sizeof(classId));
@@ -384,7 +383,7 @@ getSlime(const DocsumReply &reply, uint32_t id, bool relaxed)
uint32_t classId;
ASSERT_LESS_EQUAL(sizeof(classId), docsum.data.size());
memcpy(&classId, docsum.data.c_str(), sizeof(classId));
- ASSERT_EQUAL(::search::fs4transport::SLIME_MAGIC_ID, classId);
+ ASSERT_EQUAL(search::docsummary::SLIME_MAGIC_ID, classId);
vespalib::Slime slime;
vespalib::Memory serialized(docsum.data.c_str() + sizeof(classId),
docsum.data.size() - sizeof(classId));
diff --git a/searchcore/src/tests/proton/matching/matching_test.cpp b/searchcore/src/tests/proton/matching/matching_test.cpp
index 3f68b54aca2..950321533b0 100644
--- a/searchcore/src/tests/proton/matching/matching_test.cpp
+++ b/searchcore/src/tests/proton/matching/matching_test.cpp
@@ -18,7 +18,6 @@
#include <vespa/searchlib/aggregation/perdocexpression.h>
#include <vespa/searchlib/attribute/extendableattributes.h>
#include <vespa/searchlib/common/featureset.h>
-#include <vespa/searchlib/common/transport.h>
#include <vespa/searchlib/engine/docsumrequest.h>
#include <vespa/searchlib/engine/searchrequest.h>
#include <vespa/searchlib/engine/docsumreply.h>
@@ -573,27 +572,22 @@ TEST("require that re-ranking is diverse with diversity = 1/10") {
}
TEST("require that sortspec can be used (multi-threaded)") {
- for (bool drop_sort_data: {false, true}) {
- for (size_t threads = 1; threads <= 16; ++threads) {
- MyWorld world;
- world.basicSetup();
- world.basicResults();
- SearchRequest::SP request = world.createSimpleRequest("f1", "spread");
- request->sortSpec = "+a1";
- if (drop_sort_data) {
- request->queryFlags |= fs4transport::QFLAG_DROP_SORTDATA;
- }
- SearchReply::UP reply = world.performSearch(request, threads);
- ASSERT_EQUAL(9u, reply->hits.size());
- EXPECT_EQUAL(document::DocumentId("id:ns:searchdocument::100").getGlobalId(), reply->hits[0].gid);
- EXPECT_EQUAL(zero_rank_value, reply->hits[0].metric);
- EXPECT_EQUAL(document::DocumentId("id:ns:searchdocument::200").getGlobalId(), reply->hits[1].gid);
- EXPECT_EQUAL(zero_rank_value, reply->hits[1].metric);
- EXPECT_EQUAL(document::DocumentId("id:ns:searchdocument::300").getGlobalId(), reply->hits[2].gid);
- EXPECT_EQUAL(zero_rank_value, reply->hits[2].metric);
- EXPECT_EQUAL(drop_sort_data, reply->sortIndex.empty());
- EXPECT_EQUAL(drop_sort_data, reply->sortData.empty());
- }
+ for (size_t threads = 1; threads <= 16; ++threads) {
+ MyWorld world;
+ world.basicSetup();
+ world.basicResults();
+ SearchRequest::SP request = world.createSimpleRequest("f1", "spread");
+ request->sortSpec = "+a1";
+ SearchReply::UP reply = world.performSearch(request, threads);
+ ASSERT_EQUAL(9u, reply->hits.size());
+ EXPECT_EQUAL(document::DocumentId("id:ns:searchdocument::100").getGlobalId(), reply->hits[0].gid);
+ EXPECT_EQUAL(zero_rank_value, reply->hits[0].metric);
+ EXPECT_EQUAL(document::DocumentId("id:ns:searchdocument::200").getGlobalId(), reply->hits[1].gid);
+ EXPECT_EQUAL(zero_rank_value, reply->hits[1].metric);
+ EXPECT_EQUAL(document::DocumentId("id:ns:searchdocument::300").getGlobalId(), reply->hits[2].gid);
+ EXPECT_EQUAL(zero_rank_value, reply->hits[2].metric);
+ EXPECT_FALSE(reply->sortIndex.empty());
+ EXPECT_FALSE(reply->sortData.empty());
}
}
diff --git a/searchcore/src/tests/proton/summaryengine/summaryengine.cpp b/searchcore/src/tests/proton/summaryengine/summaryengine.cpp
index 23ef86a46b7..a9cae7d8ab7 100644
--- a/searchcore/src/tests/proton/summaryengine/summaryengine.cpp
+++ b/searchcore/src/tests/proton/summaryengine/summaryengine.cpp
@@ -7,7 +7,7 @@
#include <vespa/searchlib/util/slime_output_raw_buf_adapter.h>
#include <vespa/vespalib/data/databuffer.h>
#include <vespa/vespalib/util/compressor.h>
-#include <vespa/searchlib/common/transport.h>
+#include <vespa/searchsummary/docsummary/docsumwriter.h>
#include <vespa/metrics/metricset.h>
#include <vespa/fnet/frt/rpcrequest.h>
@@ -336,7 +336,7 @@ void
createSummary(search::RawBuf &buf) {
vespalib::Slime summary;
summary.setObject().setLong("long", 982);
- uint32_t magic = search::fs4transport::SLIME_MAGIC_ID;
+ uint32_t magic = search::docsummary::SLIME_MAGIC_ID;
buf.append(&magic, sizeof(magic));
search::SlimeOutputRawBufAdapter adapter(buf);
BinaryFormat::encode(summary, adapter);
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp
index c65257e7f6a..5951d07a2cb 100644
--- a/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp
+++ b/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp
@@ -5,7 +5,6 @@
#include <vespa/searchlib/attribute/iattributemanager.h>
#include <vespa/searchlib/common/location.h>
#include <vespa/searchlib/common/matching_elements.h>
-#include <vespa/searchlib/common/transport.h>
#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/vespalib/util/stringfmt.h>
@@ -50,7 +49,6 @@ DocsumContext::initState()
{
const DocsumRequest & req = _request;
_docsumState._args.initFromDocsumRequest(req);
- _docsumState._args.SetQueryFlags(req.queryFlags & ~search::fs4transport::QFLAG_DROP_SORTDATA);
_docsumState._docsumcnt = req.hits.size();
_docsumState._docsumbuf = (_docsumState._docsumcnt > 0)
@@ -176,7 +174,7 @@ DocsumContext::FillRankFeatures(search::docsummary::GetDocsumsState * state, sea
{
assert(&_docsumState == state);
// check if we are allowed to run
- if ((state->_args.GetQueryFlags() & search::fs4transport::QFLAG_DUMP_FEATURES) == 0) {
+ if ( ! state->_args.dumpFeatures()) {
return;
}
state->_rankFeatures = _matcher->getRankFeatures(_request, _searchCtx, _attrCtx, _sessionMgr);
diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
index 596635a416a..87c0283d228 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
@@ -224,7 +224,7 @@ Matcher::match(const SearchRequest &request, vespalib::ThreadBundle &threadBundl
!_rankSetup->getSecondPhaseRank().empty(), !willNotNeedRanking(request, groupingContext));
ResultProcessor rp(attrContext, metaStore, sessionMgr, groupingContext, sessionId,
- request.sortSpec, params.offset, params.hits, request.should_drop_sort_data());
+ request.sortSpec, params.offset, params.hits);
size_t numThreadsPerSearch = computeNumThreadsPerSearch(mtf->estimate(), rankProperties);
LimitedThreadBundleWrapper limitedThreadBundle(threadBundle, numThreadsPerSearch);
diff --git a/searchcore/src/vespa/searchcore/proton/matching/result_processor.cpp b/searchcore/src/vespa/searchcore/proton/matching/result_processor.cpp
index dedda1504a5..445aab310d9 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/result_processor.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/result_processor.cpp
@@ -61,8 +61,7 @@ ResultProcessor::ResultProcessor(IAttributeContext &attrContext,
GroupingContext &groupingContext,
const vespalib::string &sessionId,
const vespalib::string &sortSpec,
- size_t offset, size_t hits,
- bool drop_sort_data)
+ size_t offset, size_t hits)
: _attrContext(attrContext),
_metaStore(metaStore),
_sessionMgr(sessionMgr),
@@ -71,7 +70,6 @@ ResultProcessor::ResultProcessor(IAttributeContext &attrContext,
_sortSpec(sortSpec),
_offset(offset),
_hits(hits),
- _drop_sort_data(drop_sort_data),
_wasMerged(false)
{
if (!_groupingContext.empty()) {
@@ -140,7 +138,7 @@ ResultProcessor::makeReply(PartialResultUP full_result)
dst.metric = src._rankValue;
LOG(debug, "convertLidToGid: hit[%zu]: lid(%u) -> gid(%s)", i, docId, dst.gid.toString().c_str());
}
- if (result.hasSortData() && (hitcnt > 0) && !_drop_sort_data) {
+ if (result.hasSortData() && (hitcnt > 0)) {
size_t sortDataSize = result.sortDataSize();
for (size_t i = 0; i < hitOffset; ++i) {
sortDataSize -= result.sortData(i).second;
diff --git a/searchcore/src/vespa/searchcore/proton/matching/result_processor.h b/searchcore/src/vespa/searchcore/proton/matching/result_processor.h
index 41c764d247b..48a8aecebe1 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/result_processor.h
+++ b/searchcore/src/vespa/searchcore/proton/matching/result_processor.h
@@ -88,7 +88,6 @@ private:
const vespalib::string &_sortSpec;
size_t _offset;
size_t _hits;
- bool _drop_sort_data;
bool _wasMerged;
public:
@@ -98,8 +97,7 @@ public:
GroupingContext & groupingContext,
const vespalib::string & sessionId,
const vespalib::string & sortSpec,
- size_t offset, size_t hits,
- bool drop_sort_data);
+ size_t offset, size_t hits);
~ResultProcessor();
size_t countFS4Hits();