From 60ca007af52d5c89d9bb5a02c039d86f6c618599 Mon Sep 17 00:00:00 2001 From: ioannispan Date: Fri, 29 Sep 2023 16:24:40 +0200 Subject: [PATCH 1/2] Decouple ConsecutiveIds from SeedConfig --- .../java/org/neo4j/gds/leiden/LeidenBaseConfig.java | 2 ++ .../org/neo4j/gds/config/ConsecutiveIdsConfig.java | 10 +++++++--- .../org/neo4j/gds/config/ConsecutiveIdsConfigTest.java | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/algo/src/main/java/org/neo4j/gds/leiden/LeidenBaseConfig.java b/algo/src/main/java/org/neo4j/gds/leiden/LeidenBaseConfig.java index 00ce54aa4ad..7257b44e6ea 100644 --- a/algo/src/main/java/org/neo4j/gds/leiden/LeidenBaseConfig.java +++ b/algo/src/main/java/org/neo4j/gds/leiden/LeidenBaseConfig.java @@ -25,6 +25,7 @@ import org.neo4j.gds.config.ConsecutiveIdsConfig; import org.neo4j.gds.config.RandomSeedConfig; import org.neo4j.gds.config.RelationshipWeightConfig; +import org.neo4j.gds.config.SeedConfig; import org.neo4j.gds.config.ToleranceConfig; public interface LeidenBaseConfig extends @@ -32,6 +33,7 @@ public interface LeidenBaseConfig extends ConsecutiveIdsConfig, RelationshipWeightConfig, RandomSeedConfig, + SeedConfig, ToleranceConfig { @Value.Default diff --git a/core/src/main/java/org/neo4j/gds/config/ConsecutiveIdsConfig.java b/core/src/main/java/org/neo4j/gds/config/ConsecutiveIdsConfig.java index 0d89e102753..86d07ae2a10 100644 --- a/core/src/main/java/org/neo4j/gds/config/ConsecutiveIdsConfig.java +++ b/core/src/main/java/org/neo4j/gds/config/ConsecutiveIdsConfig.java @@ -21,7 +21,7 @@ import org.immutables.value.Value; -public interface ConsecutiveIdsConfig extends SeedConfig { +public interface ConsecutiveIdsConfig { @Value.Default default boolean consecutiveIds() { return false; @@ -29,8 +29,12 @@ default boolean consecutiveIds() { @Value.Check default void forbidSeedingAndConsecutiveIds() { - if (isIncremental() && consecutiveIds()) { - throw new IllegalArgumentException("Seeding and the `consecutiveIds` option cannot be used at the same time."); + if (this instanceof SeedConfig) { + var thisAsASeedConfig = (SeedConfig) this; + if (thisAsASeedConfig.isIncremental() && consecutiveIds()) { + throw new IllegalArgumentException( + "Seeding and the `consecutiveIds` option cannot be used at the same time."); + } } } } diff --git a/core/src/test/java/org/neo4j/gds/config/ConsecutiveIdsConfigTest.java b/core/src/test/java/org/neo4j/gds/config/ConsecutiveIdsConfigTest.java index 465293c4f49..c7004b1e20f 100644 --- a/core/src/test/java/org/neo4j/gds/config/ConsecutiveIdsConfigTest.java +++ b/core/src/test/java/org/neo4j/gds/config/ConsecutiveIdsConfigTest.java @@ -55,7 +55,7 @@ void shouldNotFailOnValidCombinations() { @Configuration - interface TestConsecutiveIdsConfig extends ConsecutiveIdsConfig { + interface TestConsecutiveIdsConfig extends ConsecutiveIdsConfig, SeedConfig { static TestConsecutiveIdsConfig of(CypherMapWrapper map) { return new TestConsecutiveIdsConfigImpl(map); } From b9eaa5b819c5b91f59fd6dbdde507dff242ef094 Mon Sep 17 00:00:00 2001 From: Lasse Westh-Nielsen Date: Mon, 2 Oct 2023 12:28:46 +0200 Subject: [PATCH 2/2] turn last exporter builders into the request scoped things that they are --- .../CatalogBusinessFacade.java | 6 +++ .../DefaultCatalogBusinessFacade.java | 27 ++++++++---- .../WriteNodeLabelApplication.java | 5 +-- ...riteRelationshipPropertiesApplication.java | 8 +--- .../WriteRelationshipsApplication.java | 7 +-- .../neo4j/gds/catalog/CatalogFacadeTest.java | 6 +++ .../gds/procedures/catalog/CatalogFacade.java | 15 +++++++ .../integration/CatalogFacadeProvider.java | 43 ++++++++++--------- .../CatalogFacadeProviderFactory.java | 9 ++++ 9 files changed, 85 insertions(+), 41 deletions(-) diff --git a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/CatalogBusinessFacade.java b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/CatalogBusinessFacade.java index 42ed8a725a4..c8881063b60 100644 --- a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/CatalogBusinessFacade.java +++ b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/CatalogBusinessFacade.java @@ -30,7 +30,10 @@ import org.neo4j.gds.core.utils.TerminationFlag; import org.neo4j.gds.core.utils.progress.TaskRegistryFactory; import org.neo4j.gds.core.utils.warnings.UserLogRegistryFactory; +import org.neo4j.gds.core.write.NodeLabelExporterBuilder; import org.neo4j.gds.core.write.NodePropertyExporterBuilder; +import org.neo4j.gds.core.write.RelationshipExporterBuilder; +import org.neo4j.gds.core.write.RelationshipPropertiesExporterBuilder; import org.neo4j.gds.projection.GraphProjectNativeResult; import org.neo4j.gds.results.MemoryEstimateResult; import org.neo4j.gds.transaction.TransactionContext; @@ -216,6 +219,7 @@ NodePropertiesWriteResult writeNodeProperties( WriteRelationshipPropertiesResult writeRelationshipProperties( User user, DatabaseId databaseId, + RelationshipPropertiesExporterBuilder relationshipPropertiesExporterBuilder, TerminationFlag terminationFlag, String graphName, String relationshipType, @@ -226,6 +230,7 @@ WriteRelationshipPropertiesResult writeRelationshipProperties( WriteLabelResult writeNodeLabel( User user, DatabaseId databaseId, + NodeLabelExporterBuilder nodeLabelExporterBuilder, TerminationFlag terminationFlag, String graphName, String nodeLabel, @@ -235,6 +240,7 @@ WriteLabelResult writeNodeLabel( WriteRelationshipResult writeRelationships( User user, DatabaseId databaseId, + RelationshipExporterBuilder relationshipExporterBuilder, TaskRegistryFactory taskRegistryFactory, TerminationFlag terminationFlag, UserLogRegistryFactory userLogRegistryFactory, diff --git a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/DefaultCatalogBusinessFacade.java b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/DefaultCatalogBusinessFacade.java index 346aac5e190..baf0ff01831 100644 --- a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/DefaultCatalogBusinessFacade.java +++ b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/DefaultCatalogBusinessFacade.java @@ -36,7 +36,10 @@ import org.neo4j.gds.core.utils.TerminationFlag; import org.neo4j.gds.core.utils.progress.TaskRegistryFactory; import org.neo4j.gds.core.utils.warnings.UserLogRegistryFactory; +import org.neo4j.gds.core.write.NodeLabelExporterBuilder; import org.neo4j.gds.core.write.NodePropertyExporterBuilder; +import org.neo4j.gds.core.write.RelationshipExporterBuilder; +import org.neo4j.gds.core.write.RelationshipPropertiesExporterBuilder; import org.neo4j.gds.graphsampling.RandomWalkBasedNodesSampler; import org.neo4j.gds.graphsampling.config.RandomWalkWithRestartsConfig; import org.neo4j.gds.logging.Log; @@ -111,25 +114,25 @@ public DefaultCatalogBusinessFacade( GraphNameValidationService graphNameValidationService, GraphStoreCatalogService graphStoreCatalogService, GraphStoreValidationService graphStoreValidationService, - DropGraphApplication dropGraphApplication, - ListGraphApplication listGraphApplication, - NativeProjectApplication nativeProjectApplication, CypherProjectApplication cypherProjectApplication, - SubGraphProjectApplication subGraphProjectApplication, - GraphMemoryUsageApplication graphMemoryUsageApplication, + DropGraphApplication dropGraphApplication, DropNodePropertiesApplication dropNodePropertiesApplication, DropRelationshipsApplication dropRelationshipsApplication, + EstimateCommonNeighbourAwareRandomWalkApplication estimateCommonNeighbourAwareRandomWalkApplication, + GenerateGraphApplication generateGraphApplication, + GraphMemoryUsageApplication graphMemoryUsageApplication, + GraphSamplingApplication graphSamplingApplication, + ListGraphApplication listGraphApplication, + NativeProjectApplication nativeProjectApplication, NodeLabelMutatorApplication nodeLabelMutatorApplication, StreamNodePropertiesApplication streamNodePropertiesApplication, StreamRelationshipPropertiesApplication streamRelationshipPropertiesApplication, StreamRelationshipsApplication streamRelationshipsApplication, + SubGraphProjectApplication subGraphProjectApplication, WriteNodePropertiesApplication writeNodePropertiesApplication, WriteRelationshipPropertiesApplication writeRelationshipPropertiesApplication, WriteNodeLabelApplication writeNodeLabelApplication, - WriteRelationshipsApplication writeRelationshipsApplication, - GraphSamplingApplication graphSamplingApplication, - EstimateCommonNeighbourAwareRandomWalkApplication estimateCommonNeighbourAwareRandomWalkApplication, - GenerateGraphApplication generateGraphApplication + WriteRelationshipsApplication writeRelationshipsApplication ) { this.log = log; @@ -692,6 +695,7 @@ public NodePropertiesWriteResult writeNodeProperties( public WriteRelationshipPropertiesResult writeRelationshipProperties( User user, DatabaseId databaseId, + RelationshipPropertiesExporterBuilder relationshipPropertiesExporterBuilder, TerminationFlag terminationFlag, String graphNameAsString, String relationshipType, @@ -713,6 +717,7 @@ public WriteRelationshipPropertiesResult writeRelationshipProperties( var configuration = catalogConfigurationService.parseWriteRelationshipPropertiesConfiguration(rawConfiguration); return writeRelationshipPropertiesApplication.compute( + relationshipPropertiesExporterBuilder, terminationFlag, graphStore, graphName, @@ -726,6 +731,7 @@ public WriteRelationshipPropertiesResult writeRelationshipProperties( public WriteLabelResult writeNodeLabel( User user, DatabaseId databaseId, + NodeLabelExporterBuilder nodeLabelExporterBuilder, TerminationFlag terminationFlag, String graphNameAsString, String nodeLabel, @@ -741,6 +747,7 @@ public WriteLabelResult writeNodeLabel( var nodeFilter = NodeFilterParser.parseAndValidate(graphStore, configuration.nodeFilter()); return writeNodeLabelApplication.compute( + nodeLabelExporterBuilder, terminationFlag, graphStore, graphName, @@ -754,6 +761,7 @@ public WriteLabelResult writeNodeLabel( public WriteRelationshipResult writeRelationships( User user, DatabaseId databaseId, + RelationshipExporterBuilder relationshipExporterBuilder, TaskRegistryFactory taskRegistryFactory, TerminationFlag terminationFlag, UserLogRegistryFactory userLogRegistryFactory, @@ -779,6 +787,7 @@ public WriteRelationshipResult writeRelationships( ); return writeRelationshipsApplication.compute( + relationshipExporterBuilder, taskRegistryFactory, terminationFlag, userLogRegistryFactory, diff --git a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/WriteNodeLabelApplication.java b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/WriteNodeLabelApplication.java index 4a475dc9bf3..2b7f91b4711 100644 --- a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/WriteNodeLabelApplication.java +++ b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/WriteNodeLabelApplication.java @@ -35,14 +35,13 @@ public class WriteNodeLabelApplication { private final Log log; - private final NodeLabelExporterBuilder nodeLabelExporterBuilder; - public WriteNodeLabelApplication(Log log, NodeLabelExporterBuilder nodeLabelExporterBuilder) { + public WriteNodeLabelApplication(Log log) { this.log = log; - this.nodeLabelExporterBuilder = nodeLabelExporterBuilder; } WriteLabelResult compute( + NodeLabelExporterBuilder nodeLabelExporterBuilder, TerminationFlag terminationFlag, GraphStore graphStore, GraphName graphName, diff --git a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/WriteRelationshipPropertiesApplication.java b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/WriteRelationshipPropertiesApplication.java index 155a0158a95..76df13f133d 100644 --- a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/WriteRelationshipPropertiesApplication.java +++ b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/WriteRelationshipPropertiesApplication.java @@ -34,17 +34,13 @@ public class WriteRelationshipPropertiesApplication { private final Log log; - private final RelationshipPropertiesExporterBuilder relationshipPropertiesExporterBuilder; - public WriteRelationshipPropertiesApplication( - Log log, - RelationshipPropertiesExporterBuilder relationshipPropertiesExporterBuilder - ) { + public WriteRelationshipPropertiesApplication(Log log) { this.log = log; - this.relationshipPropertiesExporterBuilder = relationshipPropertiesExporterBuilder; } WriteRelationshipPropertiesResult compute( + RelationshipPropertiesExporterBuilder relationshipPropertiesExporterBuilder, TerminationFlag terminationFlag, GraphStore graphStore, GraphName graphName, diff --git a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/WriteRelationshipsApplication.java b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/WriteRelationshipsApplication.java index 98406a01830..80d465aa859 100644 --- a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/WriteRelationshipsApplication.java +++ b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/WriteRelationshipsApplication.java @@ -39,14 +39,13 @@ public class WriteRelationshipsApplication { private final Log log; - private final RelationshipExporterBuilder relationshipExporterBuilder; - public WriteRelationshipsApplication(Log log, RelationshipExporterBuilder relationshipExporterBuilder) { + public WriteRelationshipsApplication(Log log) { this.log = log; - this.relationshipExporterBuilder = relationshipExporterBuilder; } WriteRelationshipResult compute( + RelationshipExporterBuilder relationshipExporterBuilder, TaskRegistryFactory taskRegistryFactory, TerminationFlag terminationFlag, UserLogRegistryFactory userLogRegistryFactory, @@ -76,6 +75,7 @@ WriteRelationshipResult compute( try (var ignored = ProgressTimer.start(builder::withWriteMillis)) { try { long relationshipsWritten = writeRelationshipType( + relationshipExporterBuilder, terminationFlag, progressTracker, configuration.arrowConnectionInfo(), @@ -96,6 +96,7 @@ WriteRelationshipResult compute( } private long writeRelationshipType( + RelationshipExporterBuilder relationshipExporterBuilder, TerminationFlag terminationFlag, ProgressTracker progressTracker, Optional arrowConnectionInfo, diff --git a/proc/catalog/src/test/java/org/neo4j/gds/catalog/CatalogFacadeTest.java b/proc/catalog/src/test/java/org/neo4j/gds/catalog/CatalogFacadeTest.java index 76cfeba46eb..ec47567cb02 100644 --- a/proc/catalog/src/test/java/org/neo4j/gds/catalog/CatalogFacadeTest.java +++ b/proc/catalog/src/test/java/org/neo4j/gds/catalog/CatalogFacadeTest.java @@ -49,6 +49,9 @@ void shouldDetermineIfGraphExists() { null, null, null, + null, + null, + null, new User("current user", false), null, null, @@ -87,6 +90,9 @@ void shouldQueryUserLog() { null, null, null, + null, + null, + null, new User("current user", false), null, userLogStore, diff --git a/procedures/facade/src/main/java/org/neo4j/gds/procedures/catalog/CatalogFacade.java b/procedures/facade/src/main/java/org/neo4j/gds/procedures/catalog/CatalogFacade.java index 3a543bbdd15..ab8fe3d07f3 100644 --- a/procedures/facade/src/main/java/org/neo4j/gds/procedures/catalog/CatalogFacade.java +++ b/procedures/facade/src/main/java/org/neo4j/gds/procedures/catalog/CatalogFacade.java @@ -48,7 +48,10 @@ import org.neo4j.gds.core.utils.warnings.UserLogEntry; import org.neo4j.gds.core.utils.warnings.UserLogRegistryFactory; import org.neo4j.gds.core.utils.warnings.UserLogStore; +import org.neo4j.gds.core.write.NodeLabelExporterBuilder; import org.neo4j.gds.core.write.NodePropertyExporterBuilder; +import org.neo4j.gds.core.write.RelationshipExporterBuilder; +import org.neo4j.gds.core.write.RelationshipPropertiesExporterBuilder; import org.neo4j.gds.projection.GraphProjectNativeResult; import org.neo4j.gds.results.MemoryEstimateResult; import org.neo4j.gds.transaction.TransactionContext; @@ -82,8 +85,11 @@ public class CatalogFacade { private final DatabaseId databaseId; private final GraphDatabaseService graphDatabaseService; private final GraphProjectMemoryUsageService graphProjectMemoryUsageService; + private final NodeLabelExporterBuilder nodeLabelExporterBuilder; private final NodePropertyExporterBuilder nodePropertyExporterBuilder; private final ProcedureReturnColumns procedureReturnColumns; + private final RelationshipExporterBuilder relationshipExporterBuilder; + private final RelationshipPropertiesExporterBuilder relationshipPropertiesExporterBuilder; private final TaskRegistryFactory taskRegistryFactory; private final TerminationFlag terminationFlag; private final TransactionContext transactionContext; @@ -102,8 +108,11 @@ public CatalogFacade( DatabaseId databaseId, GraphDatabaseService graphDatabaseService, GraphProjectMemoryUsageService graphProjectMemoryUsageService, + NodeLabelExporterBuilder nodeLabelExporterBuilder, NodePropertyExporterBuilder nodePropertyExporterBuilder, ProcedureReturnColumns procedureReturnColumns, + RelationshipExporterBuilder relationshipExporterBuilder, + RelationshipPropertiesExporterBuilder relationshipPropertiesExporterBuilder, TaskRegistryFactory taskRegistryFactory, TerminationFlag terminationFlag, TransactionContext transactionContext, @@ -116,8 +125,11 @@ public CatalogFacade( this.databaseId = databaseId; this.graphDatabaseService = graphDatabaseService; this.graphProjectMemoryUsageService = graphProjectMemoryUsageService; + this.nodeLabelExporterBuilder = nodeLabelExporterBuilder; this.nodePropertyExporterBuilder = nodePropertyExporterBuilder; this.procedureReturnColumns = procedureReturnColumns; + this.relationshipExporterBuilder = relationshipExporterBuilder; + this.relationshipPropertiesExporterBuilder = relationshipPropertiesExporterBuilder; this.taskRegistryFactory = taskRegistryFactory; this.terminationFlag = terminationFlag; this.transactionContext = transactionContext; @@ -538,6 +550,7 @@ public Stream writeRelationshipProperties( var result = businessFacade.writeRelationshipProperties( user, databaseId, + relationshipPropertiesExporterBuilder, terminationFlag, graphName, relationshipType, @@ -556,6 +569,7 @@ public Stream writeNodeLabel( var result = businessFacade.writeNodeLabel( user, databaseId, + nodeLabelExporterBuilder, terminationFlag, graphName, nodeLabel, @@ -574,6 +588,7 @@ public Stream writeRelationships( var result = businessFacade.writeRelationships( user, databaseId, + relationshipExporterBuilder, taskRegistryFactory, terminationFlag, userLogRegistryFactory, diff --git a/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/CatalogFacadeProvider.java b/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/CatalogFacadeProvider.java index cc49145dd5d..97170d8d739 100644 --- a/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/CatalogFacadeProvider.java +++ b/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/CatalogFacadeProvider.java @@ -106,7 +106,10 @@ public class CatalogFacadeProvider { private final StreamRelationshipPropertiesApplication streamRelationshipPropertiesApplication; private final StreamRelationshipsApplication streamRelationshipsApplication; private final SubGraphProjectApplication subGraphProjectApplication; + private final WriteNodeLabelApplication writeNodeLabelApplication; private final WriteNodePropertiesApplication writeNodePropertiesApplication; + private final WriteRelationshipPropertiesApplication writeRelationshipPropertiesApplication; + private final WriteRelationshipsApplication writeRelationshipsApplication; // Business logic private final Optional> businessFacadeDecorator; @@ -147,7 +150,10 @@ public class CatalogFacadeProvider { StreamRelationshipPropertiesApplication streamRelationshipPropertiesApplication, StreamRelationshipsApplication streamRelationshipsApplication, SubGraphProjectApplication subGraphProjectApplication, + WriteNodeLabelApplication writeNodeLabelApplication, WriteNodePropertiesApplication writeNodePropertiesApplication, + WriteRelationshipPropertiesApplication writeRelationshipPropertiesApplication, + WriteRelationshipsApplication writeRelationshipsApplication, Optional> businessFacadeDecorator ) { this.catalogConfigurationService = catalogConfigurationService; @@ -181,7 +187,10 @@ public class CatalogFacadeProvider { this.streamRelationshipPropertiesApplication = streamRelationshipPropertiesApplication; this.streamRelationshipsApplication = streamRelationshipsApplication; this.subGraphProjectApplication = subGraphProjectApplication; + this.writeNodeLabelApplication = writeNodeLabelApplication; this.writeNodePropertiesApplication = writeNodePropertiesApplication; + this.writeRelationshipPropertiesApplication = writeRelationshipPropertiesApplication; + this.writeRelationshipsApplication = writeRelationshipsApplication; this.businessFacadeDecorator = businessFacadeDecorator; } @@ -222,20 +231,11 @@ public void accept(AutoCloseable autoCloseable) { // Exporter builders var exportBuildersProvider = exporterBuildersProviderService.identifyExportBuildersProvider(graphDatabaseService); var exporterContext = new ExporterContext.ProcedureContextWrapper(context); + var nodeLabelExporterBuilder = exportBuildersProvider.nodeLabelExporterBuilder(exporterContext); var nodePropertyExporterBuilder = exportBuildersProvider.nodePropertyExporterBuilder(exporterContext); + var relationshipExporterBuilder = exportBuildersProvider.relationshipExporterBuilder(exporterContext); var relationshipPropertiesExporterBuilder = exportBuildersProvider.relationshipPropertiesExporterBuilder( exporterContext); - var nodeLabelExporterBuilder = exportBuildersProvider.nodeLabelExporterBuilder(exporterContext); - var relationshipExporterBuilder = exportBuildersProvider.relationshipExporterBuilder(exporterContext); - - // GDS applications - // TODO request scope so need to change - var writeRelationshipPropertiesApplication = new WriteRelationshipPropertiesApplication( - log, - relationshipPropertiesExporterBuilder - ); - var writeNodeLabelApplication = new WriteNodeLabelApplication(log, nodeLabelExporterBuilder); - var writeRelationshipsApplication = new WriteRelationshipsApplication(log, relationshipExporterBuilder); // GDS business facade CatalogBusinessFacade businessFacade = new DefaultCatalogBusinessFacade( @@ -244,25 +244,25 @@ public void accept(AutoCloseable autoCloseable) { graphNameValidationService, graphStoreCatalogService, graphStoreValidationService, - dropGraphApplication, - listGraphApplication, - nativeProjectApplication, cypherProjectApplication, - subGraphProjectApplication, - graphMemoryUsageApplication, + dropGraphApplication, dropNodePropertiesApplication, dropRelationshipsApplication, + estimateCommonNeighbourAwareRandomWalkApplication, + generateGraphApplication, + graphMemoryUsageApplication, + graphSamplingApplication, + listGraphApplication, + nativeProjectApplication, nodeLabelMutatorApplication, streamNodePropertiesApplication, streamRelationshipPropertiesApplication, streamRelationshipsApplication, + subGraphProjectApplication, writeNodePropertiesApplication, writeRelationshipPropertiesApplication, writeNodeLabelApplication, - writeRelationshipsApplication, - graphSamplingApplication, - estimateCommonNeighbourAwareRandomWalkApplication, - generateGraphApplication + writeRelationshipsApplication ); // wrap in decorator to inject conditional behaviour @@ -275,8 +275,11 @@ public void accept(AutoCloseable autoCloseable) { databaseId, graphDatabaseService, graphProjectMemoryUsageService, + nodeLabelExporterBuilder, nodePropertyExporterBuilder, procedureReturnColumns, + relationshipExporterBuilder, + relationshipPropertiesExporterBuilder, taskRegistryFactory, terminationFlag, transactionContext, diff --git a/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/CatalogFacadeProviderFactory.java b/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/CatalogFacadeProviderFactory.java index b12b5e1bf49..84d8e726b2b 100644 --- a/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/CatalogFacadeProviderFactory.java +++ b/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/CatalogFacadeProviderFactory.java @@ -39,7 +39,10 @@ import org.neo4j.gds.applications.graphstorecatalog.StreamRelationshipPropertiesApplication; import org.neo4j.gds.applications.graphstorecatalog.StreamRelationshipsApplication; import org.neo4j.gds.applications.graphstorecatalog.SubGraphProjectApplication; +import org.neo4j.gds.applications.graphstorecatalog.WriteNodeLabelApplication; import org.neo4j.gds.applications.graphstorecatalog.WriteNodePropertiesApplication; +import org.neo4j.gds.applications.graphstorecatalog.WriteRelationshipPropertiesApplication; +import org.neo4j.gds.applications.graphstorecatalog.WriteRelationshipsApplication; import org.neo4j.gds.beta.filter.GraphStoreFilterService; import org.neo4j.gds.core.loading.GraphProjectCypherResult; import org.neo4j.gds.core.loading.GraphStoreCatalogService; @@ -128,7 +131,10 @@ CatalogFacadeProvider createCatalogFacadeProvider( graphStoreFilterService, graphStoreCatalogService ); + var writeNodeLabelApplication = new WriteNodeLabelApplication(this.log); var writeNodePropertiesApplication = new WriteNodePropertiesApplication(log); + var writeRelationshipPropertiesApplication = new WriteRelationshipPropertiesApplication(this.log); + var writeRelationshipsApplication = new WriteRelationshipsApplication(this.log); return new CatalogFacadeProvider( catalogConfigurationService, @@ -160,7 +166,10 @@ CatalogFacadeProvider createCatalogFacadeProvider( streamRelationshipPropertiesApplication, streamRelationshipsApplication, subGraphProjectApplication, + writeNodeLabelApplication, writeNodePropertiesApplication, + writeRelationshipPropertiesApplication, + writeRelationshipsApplication, businessFacadeDecorator ); }