| 20 | namespace function { |
| 21 | |
| 22 | static std::shared_ptr<FrontierTask> getFrontierTask(const main::ClientContext* context, |
| 23 | const GraphRelInfo& relInfo, Graph* graph, ExtendDirection extendDirection, |
| 24 | const GDSComputeState& computeState, std::vector<std::string> propertiesToScan) { |
| 25 | auto info = FrontierTaskInfo(relInfo.srcTableID, relInfo.dstTableID, relInfo.relGroupEntry, |
| 26 | graph, extendDirection, *computeState.edgeCompute, std::move(propertiesToScan)); |
| 27 | computeState.beginFrontierCompute(info.getBoundTableID(), info.getNbrTableID()); |
| 28 | auto numThreads = context->getMaxNumThreadForExec(); |
| 29 | auto sharedState = |
| 30 | std::make_shared<FrontierTaskSharedState>(numThreads, *computeState.frontierPair); |
| 31 | auto maxOffset = |
| 32 | graph->getMaxOffset(transaction::Transaction::Get(*context), info.getBoundTableID()); |
| 33 | sharedState->morselDispatcher.init(maxOffset); |
| 34 | return std::make_shared<FrontierTask>(numThreads, info, sharedState); |
| 35 | } |
| 36 | |
| 37 | static void scheduleFrontierTask(ExecutionContext* context, const GraphRelInfo& relInfo, |
| 38 | Graph* graph, ExtendDirection extendDirection, const GDSComputeState& computeState, |
no test coverage detected