Skip to content

Commit 1fe1d39

Browse files
committed
Resolve conflict in PregelBaseProc after merge
1 parent 4051289 commit 1fe1d39

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

proc/pregel/src/main/java/org/neo4j/gds/pregel/proc/PregelBaseProc.java

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,30 @@ static void ensureInverseIndexesExist(
7777
Log log,
7878
TaskRegistryFactory taskRegistryFactory
7979
) {
80-
relationshipTypes
80+
var relationshipTypesWithoutIndex = relationshipTypes
8181
.stream()
8282
.filter(relType -> !graphStore.inverseIndexedRelationshipTypes().contains(relType))
83-
.forEach(relType -> {
84-
var inverseConfig = InverseRelationshipsConfigImpl
85-
.builder()
86-
.concurrency(concurrency)
87-
.relationshipType(relType.name)
88-
.build();
89-
90-
var inverseIndex = new InverseRelationshipsAlgorithmFactory()
91-
.build(graphStore, inverseConfig, log, taskRegistryFactory)
92-
.compute();
93-
94-
graphStore.addInverseIndex(relType, inverseIndex);
95-
});
83+
.map(RelationshipType::name)
84+
.collect(Collectors.toList());
85+
86+
if (relationshipTypesWithoutIndex.isEmpty()) {
87+
return;
88+
}
89+
90+
var inverseConfig = InverseRelationshipsConfigImpl
91+
.builder()
92+
.concurrency(concurrency)
93+
.relationshipTypes(relationshipTypesWithoutIndex)
94+
.build();
95+
96+
new InverseRelationshipsAlgorithmFactory()
97+
.build(graphStore, inverseConfig, log, taskRegistryFactory)
98+
.compute()
99+
.forEach((relationshipType, inverseIndex) -> graphStore.addInverseIndex(
100+
relationshipType,
101+
inverseIndex.topology(),
102+
inverseIndex.properties()
103+
));
96104
}
97105

98106
static void ensureDirectedRelationships(GraphStore graphStore, Collection<RelationshipType> relationshipTypes) {

0 commit comments

Comments
 (0)