diff options
author | Arne H Juul <arnej@yahooinc.com> | 2021-10-15 09:47:40 +0000 |
---|---|---|
committer | Arne H Juul <arnej@yahooinc.com> | 2021-10-15 09:47:40 +0000 |
commit | 0f268db1367835ac3d748a3494ab152ac5f161b4 (patch) | |
tree | 60e0f8a0f4501158020505937dced4898c0b11b9 /searchcore | |
parent | e28a07fab5f83fd06f84bee95f20f457738b7ddb (diff) |
update after review
Diffstat (limited to 'searchcore')
4 files changed, 12 insertions, 11 deletions
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp index fca5e4dfbda..ffe720059c6 100644 --- a/searchcore/src/tests/proton/docsummary/docsummary.cpp +++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp @@ -344,7 +344,7 @@ bool assertSlime(const std::string &exp, const DocsumReply &reply) { vespalib::Slime expSlime; size_t used = JsonFormat::decode(exp, expSlime); EXPECT_TRUE(used > 0); - ASSERT_TRUE(reply.hasResults()); + ASSERT_TRUE(reply.hasResult()); return (EXPECT_EQUAL(expSlime, reply.slime())); } diff --git a/searchcore/src/tests/proton/summaryengine/summaryengine.cpp b/searchcore/src/tests/proton/summaryengine/summaryengine.cpp index b59aaf33908..d942abd28c2 100644 --- a/searchcore/src/tests/proton/summaryengine/summaryengine.cpp +++ b/searchcore/src/tests/proton/summaryengine/summaryengine.cpp @@ -135,7 +135,7 @@ void assertSlime(const std::string &exp, const DocsumReply &reply) { vespalib::Slime expSlime; size_t used = JsonFormat::decode(exp, expSlime); EXPECT_TRUE(used > 0); - ASSERT_TRUE(reply.hasResults()); + ASSERT_TRUE(reply.hasResult()); EXPECT_EQUAL(expSlime, reply.slime()); } @@ -160,7 +160,7 @@ TEST("requireThatGetDocsumsExecute") { DocsumRequest::Source request(createRequest()); DocsumReply::UP reply = engine.getDocsums(std::move(request), client); EXPECT_TRUE(reply); - EXPECT_FALSE(reply->hasResults()); + EXPECT_FALSE(reply->hasResult()); } } diff --git a/searchcore/src/vespa/searchcore/proton/summaryengine/docsum_by_slime.cpp b/searchcore/src/vespa/searchcore/proton/summaryengine/docsum_by_slime.cpp index 1860f3ab989..a5ad7618c84 100644 --- a/searchcore/src/vespa/searchcore/proton/summaryengine/docsum_by_slime.cpp +++ b/searchcore/src/vespa/searchcore/proton/summaryengine/docsum_by_slime.cpp @@ -93,7 +93,7 @@ vespalib::Slime::UP DocsumBySlime::getDocsums(const Inspector & req) { DocsumReply::UP reply = _docsumServer.getDocsums(slimeToRequest(req)); - if (reply && reply->hasResults()) { + if (reply && reply->hasResult()) { return reply->releaseSlime(); } else { LOG(warning, "got <null> docsum reply from back-end"); diff --git a/searchcore/src/vespa/searchcore/proton/summaryengine/summaryengine.cpp b/searchcore/src/vespa/searchcore/proton/summaryengine/summaryengine.cpp index 8a4ac98643d..ec5c8c9b72d 100644 --- a/searchcore/src/vespa/searchcore/proton/summaryengine/summaryengine.cpp +++ b/searchcore/src/vespa/searchcore/proton/summaryengine/summaryengine.cpp @@ -106,11 +106,8 @@ DocsumReply::UP SummaryEngine::getDocsums(DocsumRequest::Source request, DocsumClient & client) { if (_closed) { - LOG(warning, "Receiving docsumrequest after engine has been shutdown"); + vespalib::Issue::report("Received docsum request after engine has been shutdown"); auto ret = std::make_unique<DocsumReply>(); - - // TODO: Notify closed. - return ret; } if (_async) { @@ -127,8 +124,7 @@ SummaryEngine::getDocsums(DocsumRequest::UP req) auto my_issues = std::make_unique<search::UniqueIssues>(); auto capture_issues = vespalib::Issue::listen(*my_issues); - DocsumReply::UP reply = std::make_unique<DocsumReply>(); - + DocsumReply::UP reply; if (req) { ISearchHandler::SP searchHandler = getSearchHandler(DocTypeName(*req)); if (searchHandler) { @@ -145,7 +141,12 @@ SummaryEngine::getDocsums(DocsumRequest::UP req) } updateDocsumMetrics(vespalib::to_s(req->getTimeUsed()), getNumDocs(*reply)); } - return std::make_unique<DocsumReply>(reply->releaseSlime(), std::move(req), std::move(my_issues)); + if (! reply) { + reply = std::make_unique<DocsumReply>(); + } + reply->setRequest(std::move(req)); + reply->setIssues(std::move(my_issues)); + return reply; } void |