Skip to content

Commit

Permalink
fix: use closable iterator util to close autoclosable edges rather th…
Browse files Browse the repository at this point in the history
…an mannually close it
  • Loading branch information
qwtsc committed Aug 18, 2023
1 parent 2ae0f6c commit 4862a70
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.apache.hugegraph.iterator.FlatMapperIterator;
import org.apache.hugegraph.structure.HugeEdge;
import org.apache.hugegraph.util.E;
import org.apache.tinkerpop.gremlin.structure.util.CloseableIterator;

public class CountTraverser extends HugeTraverser {

Expand Down Expand Up @@ -93,12 +94,7 @@ public long count(Id source, List<EdgeStep> steps,

return this.count.longValue();
} finally {
if (edges instanceof FlatMapperIterator) {
try {
((FlatMapperIterator<?, ?>)edges).close();
} catch (Exception ignored) {
}
}
CloseableIterator.closeIterator(edges);
}
}

Expand Down

0 comments on commit 4862a70

Please sign in to comment.