Skip to content

Commit 4d0b07a

Browse files
Remote Scale properties stream
1 parent 7c8667e commit 4d0b07a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/miscellaneous/ScalePropertiesResultBuilderForStreamMode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public Stream<ScalePropertiesStreamResult> build(
4848

4949
return LongStream
5050
.range(0, graph.nodeCount())
51-
.mapToObj(nodeId -> new ScalePropertiesStreamResult(
51+
.mapToObj(nodeId -> ScalePropertiesStreamResult.create(
5252
graph.toOriginalNodeId(nodeId),
5353
nodeProperties.doubleArrayValue(nodeId)
5454
));

procedures/facade-api/miscellaneous-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/miscellaneous/ScalePropertiesStreamResult.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@
2323
import java.util.List;
2424
import java.util.stream.Collectors;
2525

26-
public class ScalePropertiesStreamResult {
27-
public final long nodeId;
28-
public final List<Double> scaledProperty;
26+
public record ScalePropertiesStreamResult( long nodeId, List<Double> scaledProperty){
2927

30-
public ScalePropertiesStreamResult(long nodeId, double[] scaledProperty) {
31-
this.nodeId = nodeId;
32-
this.scaledProperty = Arrays.stream(scaledProperty).boxed().collect(Collectors.toList());
28+
public static ScalePropertiesStreamResult create (long nodeId, double[] scaledProperty) {
29+
30+
var scaledPropertyList = Arrays.stream(scaledProperty).boxed().collect(Collectors.toList());
31+
return new ScalePropertiesStreamResult(nodeId,scaledPropertyList);
3332
}
3433
}

0 commit comments

Comments
 (0)