diff --git a/src/engine/Server.cpp b/src/engine/Server.cpp index d73ed75b4c..2990a1a103 100644 --- a/src/engine/Server.cpp +++ b/src/engine/Server.cpp @@ -503,25 +503,6 @@ auto Server::parseOperation(ad_utility::websocket::MessageSender& messageSender, } // ____________________________________________________________________________ -void Server::setupPlannedQuery(PlannedQuery& plannedOperation, - SharedCancellationHandle handle, - TimeLimit timeLimit, - const ad_utility::Timer& requestTimer) { - plannedOperation.queryExecutionTree_.getRootOperation() - ->recursivelySetCancellationHandle(std::move(handle)); - plannedOperation.queryExecutionTree_.getRootOperation() - ->recursivelySetTimeConstraint(timeLimit); - auto& qet = plannedOperation.queryExecutionTree_; - qet.isRoot() = true; // allow pinning of the final result - auto timeForQueryPlanning = requestTimer.msecs(); - auto& runtimeInfoWholeQuery = - qet.getRootOperation()->getRuntimeInfoWholeQuery(); - runtimeInfoWholeQuery.timeQueryPlanning = timeForQueryPlanning; - LOG(INFO) << "Query planning done in " << timeForQueryPlanning.count() - << " ms" << std::endl; - LOG(TRACE) << qet.getCacheKey() << std::endl; -} - Awaitable Server::planQuery( net::static_thread_pool& threadPool, ParsedQuery&& operation, const ad_utility::Timer& requestTimer, TimeLimit timeLimit, @@ -544,7 +525,20 @@ Awaitable Server::planQuery( handle); auto qetOpt = co_await std::move(coroutine); PlannedQuery plannedQuery{std::move(operation), std::move(qetOpt).value()}; - setupPlannedQuery(plannedQuery, handle, timeLimit, requestTimer); + // Set some additional attributes on the `PlannedQuery`. + plannedQuery.queryExecutionTree_.getRootOperation() + ->recursivelySetCancellationHandle(std::move(handle)); + plannedQuery.queryExecutionTree_.getRootOperation() + ->recursivelySetTimeConstraint(timeLimit); + auto& qet = plannedQuery.queryExecutionTree_; + qet.isRoot() = true; // allow pinning of the final result + auto timeForQueryPlanning = requestTimer.msecs(); + auto& runtimeInfoWholeQuery = + qet.getRootOperation()->getRuntimeInfoWholeQuery(); + runtimeInfoWholeQuery.timeQueryPlanning = timeForQueryPlanning; + LOG(INFO) << "Query planning done in " << timeForQueryPlanning.count() + << " ms" << std::endl; + LOG(TRACE) << qet.getCacheKey() << std::endl; co_return plannedQuery; } diff --git a/src/engine/Server.h b/src/engine/Server.h index 119ed32ad0..e4fec17541 100644 --- a/src/engine/Server.h +++ b/src/engine/Server.h @@ -187,11 +187,7 @@ class Server { auto parseOperation(ad_utility::websocket::MessageSender& messageSender, const ad_utility::url_parser::ParamValueMap& params, const Operation& operation, TimeLimit timeLimit); - // Sets up the PlannedQuery s.t. it is ready to be executed. - static void setupPlannedQuery(PlannedQuery& plannedOperation, - SharedCancellationHandle handle, - TimeLimit timeLimit, - const ad_utility::Timer& requestTimer); + // Plan a parsed query. Awaitable planQuery(net::static_thread_pool& thread_pool, ParsedQuery&& operation,