|
22 | 22 | import org.apache.commons.lang3.mutable.MutableLong; |
23 | 23 | import org.neo4j.gds.RelationshipType; |
24 | 24 | import org.neo4j.gds.api.Graph; |
25 | | -import org.neo4j.gds.core.utils.TerminationFlag; |
26 | 25 | import org.neo4j.gds.core.concurrency.ParallelUtil; |
27 | 26 | import org.neo4j.gds.core.concurrency.Pools; |
| 27 | +import org.neo4j.gds.core.utils.TerminationFlag; |
28 | 28 | import org.neo4j.gds.core.utils.mem.MemoryEstimation; |
29 | 29 | import org.neo4j.gds.core.utils.mem.MemoryEstimations; |
30 | 30 | import org.neo4j.gds.core.utils.mem.MemoryRange; |
@@ -113,20 +113,18 @@ private static HugeLongArray extractLabels( |
113 | 113 | var startRelationshipOffset = relationshipOffset.getValue(); |
114 | 114 | tasks.add(() -> { |
115 | 115 | var currentRelationshipOffset = new MutableLong(startRelationshipOffset); |
116 | | - partition.consume(nodeId -> { |
117 | | - graph.forEachRelationship(nodeId, -10, (src, trg, weight) -> { |
118 | | - if (weight == EdgeSplitter.NEGATIVE || weight == EdgeSplitter.POSITIVE) { |
119 | | - globalLabels.set(currentRelationshipOffset.getAndIncrement(), (long) weight); |
120 | | - } else { |
121 | | - throw new IllegalArgumentException(formatWithLocale("Label should be either `1` or `0`. But got %f for relationship (%d, %d)", |
122 | | - weight, |
123 | | - src, |
124 | | - trg |
125 | | - )); |
126 | | - } |
127 | | - return true; |
128 | | - }); |
129 | | - }); |
| 116 | + partition.consume(nodeId -> graph.concurrentCopy().forEachRelationship(nodeId, -10, (src, trg, weight) -> { |
| 117 | + if (weight == EdgeSplitter.NEGATIVE || weight == EdgeSplitter.POSITIVE) { |
| 118 | + globalLabels.set(currentRelationshipOffset.getAndIncrement(), (long) weight); |
| 119 | + } else { |
| 120 | + throw new IllegalArgumentException(formatWithLocale("Label should be either `1` or `0`. But got %f for relationship (%d, %d)", |
| 121 | + weight, |
| 122 | + src, |
| 123 | + trg |
| 124 | + )); |
| 125 | + } |
| 126 | + return true; |
| 127 | + })); |
130 | 128 | progressTracker.logProgress(partition.totalDegree()); |
131 | 129 | } |
132 | 130 | ); |
|
0 commit comments