Skip to content

Commit

Permalink
Add inturrupt to path writer (#4609)
Browse files Browse the repository at this point in the history
* Add inturrupt to path writer

* Run clang-format

---------

Co-authored-by: CI Bot <[email protected]>
  • Loading branch information
2 people authored and ray6080 committed Dec 18, 2024
1 parent 5ae1ee3 commit e53f6c6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/function/gds/output_writer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "function/gds/output_writer.h"

#include "common/exception/interrupt.h"
#include "function/gds/gds_frontier.h"
#include "main/client_context.h"

Expand Down Expand Up @@ -114,6 +115,9 @@ void PathsOutputWriter::write(processor::FactorizedTable& fTable, nodeID_t dstNo
if (!info.hasNodeMask() && info.semantic == common::PathSemantic::WALK) {
// Fast path when there is no node predicate or semantic check
while (!curPath.empty()) {
if (context->interrupted()) {
throw InterruptException{};
}
auto top = curPath[curPath.size() - 1];
auto topNodeID = top->getNodeID();
if (top->getIter() == 1) {
Expand Down Expand Up @@ -150,6 +154,9 @@ void PathsOutputWriter::write(processor::FactorizedTable& fTable, nodeID_t dstNo
return;
}
while (!curPath.empty()) {
if (context->interrupted()) {
throw InterruptException{};
}
if (getTop(curPath)->getIter() == 1) {
writePath(curPath);
fTable.append(vectors);
Expand Down

0 comments on commit e53f6c6

Please sign in to comment.