From c760731249354271a3b4d02f99b62a69f4a5253f Mon Sep 17 00:00:00 2001 From: ioannispan Date: Thu, 7 Nov 2024 14:05:21 +0100 Subject: [PATCH] From Centrality to Community :oops: --- .../sllp/SpeakerListenerLPAMutateSpec.java | 2 +- .../gds/sllp/SpeakerListenerLPAStatsSpec.java | 2 +- .../sllp/SpeakerListenerLPAStreamSpec.java | 2 +- .../gds/sllp/SpeakerListenerLPAWriteSpec.java | 2 +- .../centrality/CentralityAlgorithms.java | 19 --- ...lgorithmsEstimationModeBusinessFacade.java | 14 --- ...ityAlgorithmsMutateModeBusinessFacade.java | 19 --- ...lityAlgorithmsStatsModeBusinessFacade.java | 18 +-- ...ityAlgorithmsStreamModeBusinessFacade.java | 17 --- ...lityAlgorithmsWriteModeBusinessFacade.java | 21 ---- .../algorithms/community/build.gradle | 1 + .../community/CommunityAlgorithms.java | 21 +++- ...lgorithmsEstimationModeBusinessFacade.java | 16 +++ ...ityAlgorithmsMutateModeBusinessFacade.java | 21 ++++ ...nityAlgorithmsStatsModeBusinessFacade.java | 18 +++ ...ityAlgorithmsStreamModeBusinessFacade.java | 18 +++ ...nityAlgorithmsWriteModeBusinessFacade.java | 21 ++++ .../SpeakerListenerLPAMutateStep.java | 2 +- .../SpeakerListenerLPAWriteStep.java | 2 +- .../stubs/SpeakerListenerLPAStub.java | 4 +- .../SpeakerListenerLPAMutateProcTest.java | 0 .../SpeakerListenerLPAStatsProcTest.java | 0 .../SpeakerListenerLPAStreamProcTest.java | 0 .../SpeakerListenerLPAWriteProcTest.java | 0 .../java/org/neo4j/gds/sllpa/Constants.java | 0 .../sllpa/SpeakerListenerLPAMutateProc.java | 6 +- .../sllpa/SpeakerListenerLPAStatsProc.java | 6 +- .../sllpa/SpeakerListenerLPAStreamProc.java | 6 +- .../sllpa/SpeakerListenerLPAWriteProc.java | 6 +- .../LocalCentralityProcedureFacade.java | 104 +---------------- .../LocalCommunityProcedureFacade.java | 108 ++++++++++++++++++ ...rListenerLPAResultBuilderForStatsMode.java | 2 +- ...ListenerLPAResultBuilderForStreamMode.java | 2 +- ...rListenerLPAResultBuilderForWriteMode.java | 2 +- .../LocalSpeakerListenerLPAMutateStub.java | 16 +-- ...ListenerLPAResultBuilderForMutateMode.java | 4 +- .../centrality/CentralityProcedureFacade.java | 32 ------ .../community/CommunityProcedureFacade.java | 34 ++++++ .../SpeakerListenerLPAMutateResult.java | 2 +- .../SpeakerListenerLPAStatsResult.java | 2 +- .../SpeakerListenerLPAStreamResult.java | 2 +- .../SpeakerListenerLPAWriteResult.java | 2 +- .../stubs/SpeakerListenerLPAMutateStub.java | 4 +- .../gds/sllpa/SpeakerListenerLPAConfig.java | 0 44 files changed, 298 insertions(+), 282 deletions(-) rename applications/algorithms/{centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality => community/src/main/java/org/neo4j/gds/applications/algorithms/community}/SpeakerListenerLPAMutateStep.java (97%) rename applications/algorithms/{centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality => community/src/main/java/org/neo4j/gds/applications/algorithms/community}/SpeakerListenerLPAWriteStep.java (97%) rename proc/{centrality => community}/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAMutateProcTest.java (100%) rename proc/{centrality => community}/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStatsProcTest.java (100%) rename proc/{centrality => community}/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStreamProcTest.java (100%) rename proc/{centrality => community}/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAWriteProcTest.java (100%) rename proc/{centrality => community}/src/main/java/org/neo4j/gds/sllpa/Constants.java (100%) rename proc/{centrality => community}/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAMutateProc.java (90%) rename proc/{centrality => community}/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStatsProc.java (91%) rename proc/{centrality => community}/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStreamProc.java (91%) rename proc/{centrality => community}/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAWriteProc.java (92%) rename procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/{centrality => community}/SpeakerListenerLPAResultBuilderForStatsMode.java (97%) rename procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/{centrality => community}/SpeakerListenerLPAResultBuilderForStreamMode.java (97%) rename procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/{centrality => community}/SpeakerListenerLPAResultBuilderForWriteMode.java (97%) rename procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/{centrality => community}/stubs/LocalSpeakerListenerLPAMutateStub.java (79%) rename procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/{centrality => community}/stubs/SpeakerListenerLPAResultBuilderForMutateMode.java (93%) rename procedures/facade-api/{centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality => community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community}/SpeakerListenerLPAMutateResult.java (96%) rename procedures/facade-api/{centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality => community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community}/SpeakerListenerLPAStatsResult.java (95%) rename procedures/facade-api/{centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality => community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community}/SpeakerListenerLPAStreamResult.java (93%) rename procedures/facade-api/{centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality => community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community}/SpeakerListenerLPAWriteResult.java (96%) rename procedures/facade-api/{centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality => community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community}/stubs/SpeakerListenerLPAMutateStub.java (91%) rename procedures/facade-api/configs/{centrality-configs => community-configs}/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAConfig.java (100%) diff --git a/algorithm-specifications/src/main/java/org/neo4j/gds/sllp/SpeakerListenerLPAMutateSpec.java b/algorithm-specifications/src/main/java/org/neo4j/gds/sllp/SpeakerListenerLPAMutateSpec.java index 1fd1481c77..a6c0c5602a 100644 --- a/algorithm-specifications/src/main/java/org/neo4j/gds/sllp/SpeakerListenerLPAMutateSpec.java +++ b/algorithm-specifications/src/main/java/org/neo4j/gds/sllp/SpeakerListenerLPAMutateSpec.java @@ -30,7 +30,7 @@ import org.neo4j.gds.executor.ExecutionMode; import org.neo4j.gds.executor.GdsCallable; import org.neo4j.gds.mem.MemoryEstimation; -import org.neo4j.gds.procedures.algorithms.centrality.SpeakerListenerLPAMutateResult; +import org.neo4j.gds.procedures.algorithms.community.SpeakerListenerLPAMutateResult; import org.neo4j.gds.procedures.algorithms.configuration.NewConfigFunction; import org.neo4j.gds.sllpa.SpeakerListenerLPA; import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; diff --git a/algorithm-specifications/src/main/java/org/neo4j/gds/sllp/SpeakerListenerLPAStatsSpec.java b/algorithm-specifications/src/main/java/org/neo4j/gds/sllp/SpeakerListenerLPAStatsSpec.java index 03d7211ef2..6ce1770ed8 100644 --- a/algorithm-specifications/src/main/java/org/neo4j/gds/sllp/SpeakerListenerLPAStatsSpec.java +++ b/algorithm-specifications/src/main/java/org/neo4j/gds/sllp/SpeakerListenerLPAStatsSpec.java @@ -30,7 +30,7 @@ import org.neo4j.gds.executor.ExecutionMode; import org.neo4j.gds.executor.GdsCallable; import org.neo4j.gds.mem.MemoryEstimation; -import org.neo4j.gds.procedures.algorithms.centrality.SpeakerListenerLPAStatsResult; +import org.neo4j.gds.procedures.algorithms.community.SpeakerListenerLPAStatsResult; import org.neo4j.gds.procedures.algorithms.configuration.NewConfigFunction; import org.neo4j.gds.sllpa.SpeakerListenerLPA; import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; diff --git a/algorithm-specifications/src/main/java/org/neo4j/gds/sllp/SpeakerListenerLPAStreamSpec.java b/algorithm-specifications/src/main/java/org/neo4j/gds/sllp/SpeakerListenerLPAStreamSpec.java index 820c19b01f..c8ecb2cb24 100644 --- a/algorithm-specifications/src/main/java/org/neo4j/gds/sllp/SpeakerListenerLPAStreamSpec.java +++ b/algorithm-specifications/src/main/java/org/neo4j/gds/sllp/SpeakerListenerLPAStreamSpec.java @@ -30,7 +30,7 @@ import org.neo4j.gds.executor.ExecutionMode; import org.neo4j.gds.executor.GdsCallable; import org.neo4j.gds.mem.MemoryEstimation; -import org.neo4j.gds.procedures.algorithms.centrality.SpeakerListenerLPAStreamResult; +import org.neo4j.gds.procedures.algorithms.community.SpeakerListenerLPAStreamResult; import org.neo4j.gds.procedures.algorithms.configuration.NewConfigFunction; import org.neo4j.gds.sllpa.SpeakerListenerLPA; import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; diff --git a/algorithm-specifications/src/main/java/org/neo4j/gds/sllp/SpeakerListenerLPAWriteSpec.java b/algorithm-specifications/src/main/java/org/neo4j/gds/sllp/SpeakerListenerLPAWriteSpec.java index 97a1fd357f..4d47afdfc4 100644 --- a/algorithm-specifications/src/main/java/org/neo4j/gds/sllp/SpeakerListenerLPAWriteSpec.java +++ b/algorithm-specifications/src/main/java/org/neo4j/gds/sllp/SpeakerListenerLPAWriteSpec.java @@ -30,7 +30,7 @@ import org.neo4j.gds.executor.ExecutionMode; import org.neo4j.gds.executor.GdsCallable; import org.neo4j.gds.mem.MemoryEstimation; -import org.neo4j.gds.procedures.algorithms.centrality.SpeakerListenerLPAWriteResult; +import org.neo4j.gds.procedures.algorithms.community.SpeakerListenerLPAWriteResult; import org.neo4j.gds.procedures.algorithms.configuration.NewConfigFunction; import org.neo4j.gds.sllpa.SpeakerListenerLPA; import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; diff --git a/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithms.java b/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithms.java index 12cff3eab3..4d5db0d112 100644 --- a/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithms.java +++ b/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithms.java @@ -28,7 +28,6 @@ import org.neo4j.gds.articulationpoints.ArticulationPoints; import org.neo4j.gds.articulationpoints.ArticulationPointsProgressTaskCreator; import org.neo4j.gds.beta.pregel.Pregel; -import org.neo4j.gds.beta.pregel.PregelResult; import org.neo4j.gds.betweenness.BetweennessCentrality; import org.neo4j.gds.betweenness.BetweennessCentralityBaseConfig; import org.neo4j.gds.betweenness.BetwennessCentralityResult; @@ -68,13 +67,8 @@ import org.neo4j.gds.pagerank.PageRankComputation; import org.neo4j.gds.pagerank.PageRankConfig; import org.neo4j.gds.pagerank.PageRankResult; -import org.neo4j.gds.sllpa.SpeakerListenerLPA; -import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; -import org.neo4j.gds.sllpa.SpeakerListenerLPAProgressTrackerCreator; import org.neo4j.gds.termination.TerminationFlag; -import java.util.Optional; - import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.ArticleRank; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.EigenVector; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.PageRank; @@ -344,18 +338,5 @@ private PageRankComputation pageRankComputation(Graph graph, PageRankConfig conf return new PageRankComputation(configuration, mappedSourceNodes, degreeFunction); } - PregelResult speakerListenerLPA(Graph graph, SpeakerListenerLPAConfig configuration){ - var task =SpeakerListenerLPAProgressTrackerCreator.progressTask(graph.nodeCount(),configuration.maxIterations(),AlgorithmLabel.SLLPA.asString()); - var progressTracker = progressTrackerCreator.createProgressTracker(configuration, task); - - var algorithm = new SpeakerListenerLPA( - graph, - configuration, - DefaultPool.INSTANCE, - progressTracker, - Optional.empty() - ); - return algorithmMachinery.runAlgorithmsAndManageProgressTracker(algorithm, progressTracker, true); - } } diff --git a/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsEstimationModeBusinessFacade.java b/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsEstimationModeBusinessFacade.java index 7d2d3cbdd4..90d9c5faea 100644 --- a/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsEstimationModeBusinessFacade.java +++ b/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsEstimationModeBusinessFacade.java @@ -38,8 +38,6 @@ import org.neo4j.gds.mem.MemoryEstimation; import org.neo4j.gds.pagerank.PageRankMemoryEstimateDefinition; import org.neo4j.gds.pagerank.RankConfig; -import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; -import org.neo4j.gds.sllpa.SpeakerListenerLPAMemoryEstimateDefinition; public class CentralityAlgorithmsEstimationModeBusinessFacade { private final AlgorithmEstimationTemplate algorithmEstimationTemplate; @@ -156,17 +154,5 @@ MemoryEstimation indirectExposure() { } - public MemoryEstimation speakerListenerLPA() { - return new SpeakerListenerLPAMemoryEstimateDefinition().memoryEstimation(); - } - - public MemoryEstimateResult speakerListenerLPA(SpeakerListenerLPAConfig configuration, Object graphNameOrConfiguration) { - var memoryEstimation = speakerListenerLPA(); - return algorithmEstimationTemplate.estimate( - configuration, - graphNameOrConfiguration, - memoryEstimation - ); - } } diff --git a/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsMutateModeBusinessFacade.java b/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsMutateModeBusinessFacade.java index f9b95e2ebe..beecaa88b3 100644 --- a/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsMutateModeBusinessFacade.java +++ b/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsMutateModeBusinessFacade.java @@ -26,7 +26,6 @@ import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder; import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten; import org.neo4j.gds.articulationpoints.ArticulationPointsMutateConfig; -import org.neo4j.gds.beta.pregel.PregelResult; import org.neo4j.gds.betweenness.BetweennessCentralityMutateConfig; import org.neo4j.gds.betweenness.BetwennessCentralityResult; import org.neo4j.gds.closeness.ClosenessCentralityMutateConfig; @@ -43,7 +42,6 @@ import org.neo4j.gds.pagerank.EigenvectorMutateConfig; import org.neo4j.gds.pagerank.PageRankMutateConfig; import org.neo4j.gds.pagerank.PageRankResult; -import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.ArticleRank; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.ArticulationPoints; @@ -55,7 +53,6 @@ import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.HarmonicCentrality; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.IndirectExposure; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.PageRank; -import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.SLLPA; public class CentralityAlgorithmsMutateModeBusinessFacade { private final CentralityAlgorithmsEstimationModeBusinessFacade estimation; @@ -256,21 +253,5 @@ public RESULT indirectExposure( ); } - public RESULT speakerListenerLPA( - GraphName graphName, - SpeakerListenerLPAConfig configuration, - ResultBuilder resultBuilder - ) { - var mutateStep = new SpeakerListenerLPAMutateStep(mutateNodeProperty, configuration); - return algorithmProcessingTemplateConvenience.processRegularAlgorithmInMutateMode( - graphName, - configuration, - SLLPA, - estimation::indirectExposure, - (graph, __) -> algorithms.speakerListenerLPA(graph, configuration), - mutateStep, - resultBuilder - ); - } } diff --git a/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsStatsModeBusinessFacade.java b/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsStatsModeBusinessFacade.java index 8329ec7b7e..c073539c72 100644 --- a/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsStatsModeBusinessFacade.java +++ b/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsStatsModeBusinessFacade.java @@ -25,7 +25,6 @@ import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTemplateConvenience; import org.neo4j.gds.applications.algorithms.machinery.StatsResultBuilder; import org.neo4j.gds.articulationpoints.ArticulationPointsStatsConfig; -import org.neo4j.gds.beta.pregel.PregelResult; import org.neo4j.gds.betweenness.BetweennessCentralityStatsConfig; import org.neo4j.gds.closeness.ClosenessCentralityStatsConfig; import org.neo4j.gds.degree.DegreeCentralityStatsConfig; @@ -36,7 +35,6 @@ import org.neo4j.gds.pagerank.EigenvectorStatsConfig; import org.neo4j.gds.pagerank.PageRankResult; import org.neo4j.gds.pagerank.PageRankStatsConfig; -import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.ArticleRank; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.ArticulationPoints; @@ -47,7 +45,6 @@ import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.EigenVector; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.HarmonicCentrality; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.PageRank; -import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.SLLPA; public class CentralityAlgorithmsStatsModeBusinessFacade { private final CentralityAlgorithmsEstimationModeBusinessFacade estimationFacade; @@ -199,18 +196,5 @@ public RESULT pageRank( ); } - public RESULT sllpa( - GraphName graphName, - SpeakerListenerLPAConfig configuration, - StatsResultBuilder resultBuilder - ) { - return algorithmProcessingTemplateConvenience.processRegularAlgorithmInStatsMode( - graphName, - configuration, - SLLPA, - estimationFacade::speakerListenerLPA, - (graph, __) -> centralityAlgorithms.speakerListenerLPA(graph, configuration), - resultBuilder - ); - } + } diff --git a/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsStreamModeBusinessFacade.java b/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsStreamModeBusinessFacade.java index 63d0c9ad87..cfbfcab511 100644 --- a/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsStreamModeBusinessFacade.java +++ b/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsStreamModeBusinessFacade.java @@ -25,7 +25,6 @@ import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTemplateConvenience; import org.neo4j.gds.applications.algorithms.machinery.StreamResultBuilder; import org.neo4j.gds.articulationpoints.ArticulationPointsStreamConfig; -import org.neo4j.gds.beta.pregel.PregelResult; import org.neo4j.gds.betweenness.BetweennessCentralityStreamConfig; import org.neo4j.gds.bridges.BridgeResult; import org.neo4j.gds.bridges.BridgesStreamConfig; @@ -39,7 +38,6 @@ import org.neo4j.gds.pagerank.EigenvectorStreamConfig; import org.neo4j.gds.pagerank.PageRankResult; import org.neo4j.gds.pagerank.PageRankStreamConfig; -import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; import java.util.stream.Stream; @@ -53,7 +51,6 @@ import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.EigenVector; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.HarmonicCentrality; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.PageRank; -import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.SLLPA; public class CentralityAlgorithmsStreamModeBusinessFacade { private final CentralityAlgorithmsEstimationModeBusinessFacade estimationFacade; @@ -220,18 +217,4 @@ public Stream pageRank( ); } - public Stream sllpa( - GraphName graphName, - SpeakerListenerLPAConfig configuration, - StreamResultBuilder streamResultBuilder - ) { - return algorithmProcessingTemplateConvenience.processRegularAlgorithmInStreamMode( - graphName, - configuration, - SLLPA, - estimationFacade::pageRank, - (graph, __) -> centralityAlgorithms.speakerListenerLPA(graph, configuration), - streamResultBuilder - ); - } } diff --git a/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsWriteModeBusinessFacade.java b/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsWriteModeBusinessFacade.java index 13824c7b8f..0046c278d9 100644 --- a/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsWriteModeBusinessFacade.java +++ b/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithmsWriteModeBusinessFacade.java @@ -29,7 +29,6 @@ import org.neo4j.gds.applications.algorithms.machinery.WriteToDatabase; import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten; import org.neo4j.gds.articulationpoints.ArticulationPointsWriteConfig; -import org.neo4j.gds.beta.pregel.PregelResult; import org.neo4j.gds.betweenness.BetweennessCentralityWriteConfig; import org.neo4j.gds.closeness.ClosenessCentralityWriteConfig; import org.neo4j.gds.degree.DegreeCentralityWriteConfig; @@ -42,7 +41,6 @@ import org.neo4j.gds.pagerank.EigenvectorWriteConfig; import org.neo4j.gds.pagerank.PageRankResult; import org.neo4j.gds.pagerank.PageRankWriteConfig; -import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.ArticleRank; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.ArticulationPoints; @@ -53,7 +51,6 @@ import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.EigenVector; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.HarmonicCentrality; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.PageRank; -import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.SLLPA; public final class CentralityAlgorithmsWriteModeBusinessFacade { private final CentralityAlgorithmsEstimationModeBusinessFacade estimationFacade; @@ -251,22 +248,4 @@ public RESULT pageRank( ); } - public RESULT sllpa( - GraphName graphName, - SpeakerListenerLPAConfig configuration, - ResultBuilder resultBuilder - ) { - var writeStep = new SpeakerListenerLPAWriteStep(writeToDatabase, configuration, SLLPA); - - return algorithmProcessingTemplateConvenience.processRegularAlgorithmInWriteMode( - graphName, - configuration, - SLLPA, - estimationFacade::speakerListenerLPA, - (graph, __) -> centralityAlgorithms.speakerListenerLPA(graph, configuration), - writeStep, - resultBuilder - ); - } - } diff --git a/applications/algorithms/community/build.gradle b/applications/algorithms/community/build.gradle index 445ffa54b3..dea515c9e0 100644 --- a/applications/algorithms/community/build.gradle +++ b/applications/algorithms/community/build.gradle @@ -14,6 +14,7 @@ dependencies { implementation project(":graph-schema-api") implementation project(":logging") implementation project(":memory-usage") + implementation project(":pregel") implementation project(":progress-tracking") implementation project(":termination") } diff --git a/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithms.java b/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithms.java index 86efa36bb8..f4dd5bfc59 100644 --- a/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithms.java +++ b/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithms.java @@ -27,6 +27,7 @@ import org.neo4j.gds.approxmaxkcut.ApproxMaxKCut; import org.neo4j.gds.approxmaxkcut.ApproxMaxKCutResult; import org.neo4j.gds.approxmaxkcut.config.ApproxMaxKCutBaseConfig; +import org.neo4j.gds.beta.pregel.PregelResult; import org.neo4j.gds.collections.ha.HugeLongArray; import org.neo4j.gds.conductance.Conductance; import org.neo4j.gds.conductance.ConductanceBaseConfig; @@ -68,6 +69,9 @@ import org.neo4j.gds.modularityoptimization.ModularityOptimizationResult; import org.neo4j.gds.scc.Scc; import org.neo4j.gds.scc.SccCommonBaseConfig; +import org.neo4j.gds.sllpa.SpeakerListenerLPA; +import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; +import org.neo4j.gds.sllpa.SpeakerListenerLPAProgressTrackerCreator; import org.neo4j.gds.termination.TerminationFlag; import org.neo4j.gds.triangle.IntersectingTriangleCount; import org.neo4j.gds.triangle.IntersectingTriangleCountFactory; @@ -76,8 +80,8 @@ import org.neo4j.gds.triangle.LocalClusteringCoefficientResult; import org.neo4j.gds.triangle.TriangleCountBaseConfig; import org.neo4j.gds.triangle.TriangleCountResult; -import org.neo4j.gds.triangle.TriangleStream; import org.neo4j.gds.triangle.TriangleResult; +import org.neo4j.gds.triangle.TriangleStream; import org.neo4j.gds.wcc.Wcc; import org.neo4j.gds.wcc.WccBaseConfig; @@ -489,4 +493,19 @@ private K1ColoringBaseConfig createModularityConfig() { .build(); } + + PregelResult speakerListenerLPA(Graph graph, SpeakerListenerLPAConfig configuration){ + var task = SpeakerListenerLPAProgressTrackerCreator.progressTask(graph.nodeCount(),configuration.maxIterations(),AlgorithmLabel.SLLPA.asString()); + var progressTracker = progressTrackerCreator.createProgressTracker(configuration, task); + + var algorithm = new SpeakerListenerLPA( + graph, + configuration, + DefaultPool.INSTANCE, + progressTracker, + Optional.empty() + ); + + return algorithmMachinery.runAlgorithmsAndManageProgressTracker(algorithm, progressTracker, true); + } } diff --git a/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsEstimationModeBusinessFacade.java b/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsEstimationModeBusinessFacade.java index 1192112e36..b5aa334b0a 100644 --- a/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsEstimationModeBusinessFacade.java +++ b/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsEstimationModeBusinessFacade.java @@ -44,6 +44,8 @@ import org.neo4j.gds.modularityoptimization.ModularityOptimizationMemoryEstimateDefinition; import org.neo4j.gds.scc.SccBaseConfig; import org.neo4j.gds.scc.SccMemoryEstimateDefinition; +import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; +import org.neo4j.gds.sllpa.SpeakerListenerLPAMemoryEstimateDefinition; import org.neo4j.gds.triangle.IntersectingTriangleCountMemoryEstimateDefinition; import org.neo4j.gds.triangle.LocalClusteringCoefficientBaseConfig; import org.neo4j.gds.triangle.LocalClusteringCoefficientMemoryEstimateDefinition; @@ -259,4 +261,18 @@ public MemoryEstimateResult wcc(WccBaseConfig configuration, Object graphNameOrC memoryEstimation ); } + + public MemoryEstimation speakerListenerLPA() { + return new SpeakerListenerLPAMemoryEstimateDefinition().memoryEstimation(); + } + + public MemoryEstimateResult speakerListenerLPA(SpeakerListenerLPAConfig configuration, Object graphNameOrConfiguration) { + var memoryEstimation = speakerListenerLPA(); + + return algorithmEstimationTemplate.estimate( + configuration, + graphNameOrConfiguration, + memoryEstimation + ); + } } diff --git a/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsMutateModeBusinessFacade.java b/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsMutateModeBusinessFacade.java index 8ce4b418c3..c580f643e7 100644 --- a/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsMutateModeBusinessFacade.java +++ b/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsMutateModeBusinessFacade.java @@ -28,6 +28,7 @@ import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten; import org.neo4j.gds.approxmaxkcut.ApproxMaxKCutResult; import org.neo4j.gds.approxmaxkcut.config.ApproxMaxKCutMutateConfig; +import org.neo4j.gds.beta.pregel.PregelResult; import org.neo4j.gds.collections.ha.HugeLongArray; import org.neo4j.gds.core.utils.paged.dss.DisjointSetStruct; import org.neo4j.gds.k1coloring.K1ColoringMutateConfig; @@ -45,6 +46,7 @@ import org.neo4j.gds.modularityoptimization.ModularityOptimizationMutateConfig; import org.neo4j.gds.modularityoptimization.ModularityOptimizationResult; import org.neo4j.gds.scc.SccMutateConfig; +import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; import org.neo4j.gds.triangle.LocalClusteringCoefficientMutateConfig; import org.neo4j.gds.triangle.LocalClusteringCoefficientResult; import org.neo4j.gds.triangle.TriangleCountMutateConfig; @@ -61,6 +63,7 @@ import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.Louvain; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.ModularityOptimization; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.SCC; +import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.SLLPA; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.TriangleCount; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.WCC; @@ -297,4 +300,22 @@ public RESULT wcc( resultBuilder ); } + + public RESULT speakerListenerLPA( + GraphName graphName, + SpeakerListenerLPAConfig configuration, + ResultBuilder resultBuilder + ) { + var mutateStep = new SpeakerListenerLPAMutateStep(mutateNodeProperty, configuration); + + return algorithmProcessingTemplateConvenience.processRegularAlgorithmInMutateMode( + graphName, + configuration, + SLLPA, + estimation::speakerListenerLPA, + (graph, __) -> algorithms.speakerListenerLPA(graph, configuration), + mutateStep, + resultBuilder + ); + } } diff --git a/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsStatsModeBusinessFacade.java b/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsStatsModeBusinessFacade.java index a28025b8ec..0c146af506 100644 --- a/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsStatsModeBusinessFacade.java +++ b/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsStatsModeBusinessFacade.java @@ -22,6 +22,7 @@ import org.neo4j.gds.api.GraphName; import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTemplateConvenience; import org.neo4j.gds.applications.algorithms.machinery.StatsResultBuilder; +import org.neo4j.gds.beta.pregel.PregelResult; import org.neo4j.gds.collections.ha.HugeLongArray; import org.neo4j.gds.core.utils.paged.dss.DisjointSetStruct; import org.neo4j.gds.k1coloring.K1ColoringResult; @@ -41,6 +42,7 @@ import org.neo4j.gds.modularityoptimization.ModularityOptimizationResult; import org.neo4j.gds.modularityoptimization.ModularityOptimizationStatsConfig; import org.neo4j.gds.scc.SccStatsConfig; +import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; import org.neo4j.gds.triangle.LocalClusteringCoefficientResult; import org.neo4j.gds.triangle.LocalClusteringCoefficientStatsConfig; import org.neo4j.gds.triangle.TriangleCountResult; @@ -57,6 +59,7 @@ import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.Modularity; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.ModularityOptimization; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.SCC; +import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.SLLPA; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.TriangleCount; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.WCC; @@ -254,4 +257,19 @@ public RESULT wcc( resultBuilder ); } + + public RESULT sllpa( + GraphName graphName, + SpeakerListenerLPAConfig configuration, + StatsResultBuilder resultBuilder + ) { + return algorithmProcessingTemplateConvenience.processRegularAlgorithmInStatsMode( + graphName, + configuration, + SLLPA, + estimationFacade::speakerListenerLPA, + (graph, __) -> communityAlgorithms.speakerListenerLPA(graph, configuration), + resultBuilder + ); + } } diff --git a/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsStreamModeBusinessFacade.java b/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsStreamModeBusinessFacade.java index 7f00ce0861..8825cf4b27 100644 --- a/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsStreamModeBusinessFacade.java +++ b/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsStreamModeBusinessFacade.java @@ -24,6 +24,7 @@ import org.neo4j.gds.applications.algorithms.machinery.StreamResultBuilder; import org.neo4j.gds.approxmaxkcut.ApproxMaxKCutResult; import org.neo4j.gds.approxmaxkcut.config.ApproxMaxKCutStreamConfig; +import org.neo4j.gds.beta.pregel.PregelResult; import org.neo4j.gds.collections.ha.HugeLongArray; import org.neo4j.gds.conductance.ConductanceResult; import org.neo4j.gds.conductance.ConductanceStreamConfig; @@ -45,6 +46,7 @@ import org.neo4j.gds.modularityoptimization.ModularityOptimizationResult; import org.neo4j.gds.modularityoptimization.ModularityOptimizationStreamConfig; import org.neo4j.gds.scc.SccStreamConfig; +import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; import org.neo4j.gds.triangle.LocalClusteringCoefficientResult; import org.neo4j.gds.triangle.LocalClusteringCoefficientStreamConfig; import org.neo4j.gds.triangle.TriangleCountBaseConfig; @@ -67,6 +69,7 @@ import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.Modularity; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.ModularityOptimization; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.SCC; +import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.SLLPA; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.TriangleCount; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.Triangles; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.WCC; @@ -310,4 +313,19 @@ public Stream wcc( streamResultBuilder ); } + + public Stream sllpa( + GraphName graphName, + SpeakerListenerLPAConfig configuration, + StreamResultBuilder streamResultBuilder + ) { + return algorithmProcessingTemplateConvenience.processRegularAlgorithmInStreamMode( + graphName, + configuration, + SLLPA, + estimationFacade::speakerListenerLPA, + (graph, __) -> algorithms.speakerListenerLPA(graph, configuration), + streamResultBuilder + ); + } } diff --git a/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsWriteModeBusinessFacade.java b/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsWriteModeBusinessFacade.java index 376d6b46fe..1e2664f732 100644 --- a/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsWriteModeBusinessFacade.java +++ b/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/CommunityAlgorithmsWriteModeBusinessFacade.java @@ -28,6 +28,7 @@ import org.neo4j.gds.applications.algorithms.machinery.WriteContext; import org.neo4j.gds.applications.algorithms.machinery.WriteToDatabase; import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten; +import org.neo4j.gds.beta.pregel.PregelResult; import org.neo4j.gds.collections.ha.HugeLongArray; import org.neo4j.gds.core.utils.paged.dss.DisjointSetStruct; import org.neo4j.gds.k1coloring.K1ColoringResult; @@ -47,6 +48,7 @@ import org.neo4j.gds.modularityoptimization.ModularityOptimizationWriteConfig; import org.neo4j.gds.scc.SccAlphaWriteConfig; import org.neo4j.gds.scc.SccWriteConfig; +import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; import org.neo4j.gds.triangle.LocalClusteringCoefficientResult; import org.neo4j.gds.triangle.LocalClusteringCoefficientWriteConfig; import org.neo4j.gds.triangle.TriangleCountResult; @@ -62,6 +64,7 @@ import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.Louvain; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.ModularityOptimization; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.SCC; +import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.SLLPA; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.TriangleCount; import static org.neo4j.gds.applications.algorithms.machinery.AlgorithmLabel.WCC; @@ -316,4 +319,22 @@ public RESULT wcc( resultBuilder ); } + + public RESULT sllpa( + GraphName graphName, + SpeakerListenerLPAConfig configuration, + ResultBuilder resultBuilder + ) { + var writeStep = new SpeakerListenerLPAWriteStep(writeToDatabase, configuration, SLLPA); + + return algorithmProcessingTemplateConvenience.processRegularAlgorithmInWriteMode( + graphName, + configuration, + SLLPA, + estimationFacade::speakerListenerLPA, + (graph, __) -> algorithms.speakerListenerLPA(graph, configuration), + writeStep, + resultBuilder + ); + } } diff --git a/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/SpeakerListenerLPAMutateStep.java b/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/SpeakerListenerLPAMutateStep.java similarity index 97% rename from applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/SpeakerListenerLPAMutateStep.java rename to applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/SpeakerListenerLPAMutateStep.java index 96d751ff31..3e94e466e4 100644 --- a/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/SpeakerListenerLPAMutateStep.java +++ b/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/SpeakerListenerLPAMutateStep.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.applications.algorithms.centrality; +package org.neo4j.gds.applications.algorithms.community; import org.neo4j.gds.api.Graph; import org.neo4j.gds.api.GraphStore; diff --git a/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/SpeakerListenerLPAWriteStep.java b/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/SpeakerListenerLPAWriteStep.java similarity index 97% rename from applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/SpeakerListenerLPAWriteStep.java rename to applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/SpeakerListenerLPAWriteStep.java index 9a705e2ba1..354f6f7cad 100644 --- a/applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/SpeakerListenerLPAWriteStep.java +++ b/applications/algorithms/community/src/main/java/org/neo4j/gds/applications/algorithms/community/SpeakerListenerLPAWriteStep.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.applications.algorithms.centrality; +package org.neo4j.gds.applications.algorithms.community; import org.neo4j.gds.api.Graph; import org.neo4j.gds.api.GraphStore; diff --git a/pipeline/src/main/java/org/neo4j/gds/ml/pipeline/stubs/SpeakerListenerLPAStub.java b/pipeline/src/main/java/org/neo4j/gds/ml/pipeline/stubs/SpeakerListenerLPAStub.java index 82ee680c25..b3e57a4178 100644 --- a/pipeline/src/main/java/org/neo4j/gds/ml/pipeline/stubs/SpeakerListenerLPAStub.java +++ b/pipeline/src/main/java/org/neo4j/gds/ml/pipeline/stubs/SpeakerListenerLPAStub.java @@ -20,12 +20,12 @@ package org.neo4j.gds.ml.pipeline.stubs; import org.neo4j.gds.procedures.algorithms.AlgorithmsProcedureFacade; -import org.neo4j.gds.procedures.algorithms.centrality.SpeakerListenerLPAMutateResult; +import org.neo4j.gds.procedures.algorithms.community.SpeakerListenerLPAMutateResult; import org.neo4j.gds.procedures.algorithms.stubs.MutateStub; import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; public class SpeakerListenerLPAStub extends AbstractStub { protected MutateStub stub(AlgorithmsProcedureFacade facade) { - return facade.centrality().speakerListenerLPAMutateStub(); + return facade.community().speakerListenerLPAMutateStub(); } } diff --git a/proc/centrality/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAMutateProcTest.java b/proc/community/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAMutateProcTest.java similarity index 100% rename from proc/centrality/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAMutateProcTest.java rename to proc/community/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAMutateProcTest.java diff --git a/proc/centrality/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStatsProcTest.java b/proc/community/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStatsProcTest.java similarity index 100% rename from proc/centrality/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStatsProcTest.java rename to proc/community/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStatsProcTest.java diff --git a/proc/centrality/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStreamProcTest.java b/proc/community/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStreamProcTest.java similarity index 100% rename from proc/centrality/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStreamProcTest.java rename to proc/community/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStreamProcTest.java diff --git a/proc/centrality/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAWriteProcTest.java b/proc/community/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAWriteProcTest.java similarity index 100% rename from proc/centrality/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAWriteProcTest.java rename to proc/community/src/integrationTest/java/org/neo4j/gds/sllpa/SpeakerListenerLPAWriteProcTest.java diff --git a/proc/centrality/src/main/java/org/neo4j/gds/sllpa/Constants.java b/proc/community/src/main/java/org/neo4j/gds/sllpa/Constants.java similarity index 100% rename from proc/centrality/src/main/java/org/neo4j/gds/sllpa/Constants.java rename to proc/community/src/main/java/org/neo4j/gds/sllpa/Constants.java diff --git a/proc/centrality/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAMutateProc.java b/proc/community/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAMutateProc.java similarity index 90% rename from proc/centrality/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAMutateProc.java rename to proc/community/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAMutateProc.java index 2404482220..2af890a90a 100644 --- a/proc/centrality/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAMutateProc.java +++ b/proc/community/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAMutateProc.java @@ -21,7 +21,7 @@ import org.neo4j.gds.applications.algorithms.machinery.MemoryEstimateResult; import org.neo4j.gds.procedures.GraphDataScienceProcedures; -import org.neo4j.gds.procedures.algorithms.centrality.SpeakerListenerLPAMutateResult; +import org.neo4j.gds.procedures.algorithms.community.SpeakerListenerLPAMutateResult; import org.neo4j.procedure.Context; import org.neo4j.procedure.Description; import org.neo4j.procedure.Internal; @@ -47,7 +47,7 @@ public Stream mutate( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration ) { - return facade.algorithms().centrality().speakerListenerLPAMutateStub().execute(graphName,configuration); + return facade.algorithms().community().speakerListenerLPAMutateStub().execute(graphName,configuration); } @Procedure(value = "gds.sllpa.mutate.estimate", mode = READ) @@ -56,7 +56,7 @@ public Stream estimate( @Name(value = "graphNameOrConfiguration") Object graphNameOrConfiguration, @Name(value = "algoConfiguration") Map algoConfiguration ) { - return facade.algorithms().centrality().speakerListenerLPAMutateStub().estimate(graphNameOrConfiguration, algoConfiguration); + return facade.algorithms().community().speakerListenerLPAMutateStub().estimate(graphNameOrConfiguration, algoConfiguration); } @Internal diff --git a/proc/centrality/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStatsProc.java b/proc/community/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStatsProc.java similarity index 91% rename from proc/centrality/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStatsProc.java rename to proc/community/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStatsProc.java index c284866a78..89c885e632 100644 --- a/proc/centrality/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStatsProc.java +++ b/proc/community/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStatsProc.java @@ -21,7 +21,7 @@ import org.neo4j.gds.applications.algorithms.machinery.MemoryEstimateResult; import org.neo4j.gds.procedures.GraphDataScienceProcedures; -import org.neo4j.gds.procedures.algorithms.centrality.SpeakerListenerLPAStatsResult; +import org.neo4j.gds.procedures.algorithms.community.SpeakerListenerLPAStatsResult; import org.neo4j.procedure.Context; import org.neo4j.procedure.Description; import org.neo4j.procedure.Internal; @@ -47,7 +47,7 @@ public Stream stats( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration ) { - return facade.algorithms().centrality().sllpaStats(graphName, configuration); + return facade.algorithms().community().sllpaStats(graphName, configuration); } @Procedure(value = "gds.sllpa.stats.estimate", mode = READ) @@ -56,7 +56,7 @@ public Stream estimate( @Name(value = "graphNameOrConfiguration") Object graphNameOrConfiguration, @Name(value = "algoConfiguration") Map algoConfiguration ) { - return facade.algorithms().centrality().sllpaStatsEstimate(graphNameOrConfiguration, algoConfiguration); + return facade.algorithms().community().sllpaStatsEstimate(graphNameOrConfiguration, algoConfiguration); } @Internal diff --git a/proc/centrality/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStreamProc.java b/proc/community/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStreamProc.java similarity index 91% rename from proc/centrality/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStreamProc.java rename to proc/community/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStreamProc.java index fb90f6ed98..eb44f75655 100644 --- a/proc/centrality/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStreamProc.java +++ b/proc/community/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAStreamProc.java @@ -21,7 +21,7 @@ import org.neo4j.gds.applications.algorithms.machinery.MemoryEstimateResult; import org.neo4j.gds.procedures.GraphDataScienceProcedures; -import org.neo4j.gds.procedures.algorithms.centrality.SpeakerListenerLPAStreamResult; +import org.neo4j.gds.procedures.algorithms.community.SpeakerListenerLPAStreamResult; import org.neo4j.procedure.Context; import org.neo4j.procedure.Description; import org.neo4j.procedure.Internal; @@ -47,7 +47,7 @@ public Stream stream( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration ) { - return facade.algorithms().centrality().sllpaStream(graphName, configuration); + return facade.algorithms().community().sllpaStream(graphName, configuration); } @Procedure(value = "gds.sllpa.stream.estimate", mode = READ) @@ -56,7 +56,7 @@ public Stream estimate( @Name(value = "graphNameOrConfiguration") Object graphNameOrConfiguration, @Name(value = "algoConfiguration") Map algoConfiguration ) { - return facade.algorithms().centrality().sllpaStreamEstimate(graphNameOrConfiguration, algoConfiguration); + return facade.algorithms().community().sllpaStreamEstimate(graphNameOrConfiguration, algoConfiguration); } @Internal diff --git a/proc/centrality/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAWriteProc.java b/proc/community/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAWriteProc.java similarity index 92% rename from proc/centrality/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAWriteProc.java rename to proc/community/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAWriteProc.java index 0d68b59897..93ad147d60 100644 --- a/proc/centrality/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAWriteProc.java +++ b/proc/community/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAWriteProc.java @@ -21,7 +21,7 @@ import org.neo4j.gds.applications.algorithms.machinery.MemoryEstimateResult; import org.neo4j.gds.procedures.GraphDataScienceProcedures; -import org.neo4j.gds.procedures.algorithms.centrality.SpeakerListenerLPAWriteResult; +import org.neo4j.gds.procedures.algorithms.community.SpeakerListenerLPAWriteResult; import org.neo4j.procedure.Context; import org.neo4j.procedure.Description; import org.neo4j.procedure.Internal; @@ -48,7 +48,7 @@ public Stream write( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration ) { - return facade.algorithms().centrality().sllpaWrite(graphName, configuration); + return facade.algorithms().community().sllpaWrite(graphName, configuration); } @Procedure(value = "gds.sllpa.write.estimate", mode = READ) @@ -57,7 +57,7 @@ public Stream estimate( @Name(value = "graphNameOrConfiguration") Object graphNameOrConfiguration, @Name(value = "algoConfiguration") Map algoConfiguration ) { - return facade.algorithms().centrality().sllpaWriteEstimate(graphNameOrConfiguration, algoConfiguration); + return facade.algorithms().community().sllpaWriteEstimate(graphNameOrConfiguration, algoConfiguration); } @Internal diff --git a/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/LocalCentralityProcedureFacade.java b/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/LocalCentralityProcedureFacade.java index 4692b12243..bca4bc5888 100644 --- a/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/LocalCentralityProcedureFacade.java +++ b/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/LocalCentralityProcedureFacade.java @@ -75,12 +75,9 @@ import org.neo4j.gds.procedures.algorithms.centrality.stubs.LocalDegreeCentralityMutateStub; import org.neo4j.gds.procedures.algorithms.centrality.stubs.LocalHarmonicCentralityMutateStub; import org.neo4j.gds.procedures.algorithms.centrality.stubs.LocalPageRankMutateStub; -import org.neo4j.gds.procedures.algorithms.centrality.stubs.LocalSpeakerListenerLPAMutateStub; import org.neo4j.gds.procedures.algorithms.centrality.stubs.PageRankMutateStub; -import org.neo4j.gds.procedures.algorithms.centrality.stubs.SpeakerListenerLPAMutateStub; import org.neo4j.gds.procedures.algorithms.configuration.UserSpecificConfigurationParser; import org.neo4j.gds.procedures.algorithms.stubs.GenericStub; -import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; import java.util.Map; import java.util.stream.Stream; @@ -98,7 +95,6 @@ public final class LocalCentralityProcedureFacade implements CentralityProcedure private final PageRankMutateStub eigenVectorMutateStub; private final HarmonicCentralityMutateStub harmonicCentralityMutateStub; private final PageRankMutateStub pageRankMutateStub; - private final SpeakerListenerLPAMutateStub speakerListenerLPAMutateStub; private final CentralityAlgorithmsEstimationModeBusinessFacade estimationModeBusinessFacade; private final CentralityAlgorithmsStatsModeBusinessFacade statsModeBusinessFacade; @@ -119,7 +115,6 @@ private LocalCentralityProcedureFacade( HarmonicCentralityMutateStub harmonicCentralityMutateStub, ArticulationPointsMutateStub articulationPointsMutateStub, PageRankMutateStub pageRankMutateStub, - SpeakerListenerLPAMutateStub speakerListenerLPAMutateStub, CentralityAlgorithmsEstimationModeBusinessFacade estimationModeBusinessFacade, CentralityAlgorithmsStatsModeBusinessFacade statsModeBusinessFacade, CentralityAlgorithmsStreamModeBusinessFacade streamModeBusinessFacade, @@ -137,7 +132,6 @@ private LocalCentralityProcedureFacade( this.eigenVectorMutateStub = eigenVectorMutateStub; this.harmonicCentralityMutateStub = harmonicCentralityMutateStub; this.pageRankMutateStub = pageRankMutateStub; - this.speakerListenerLPAMutateStub = speakerListenerLPAMutateStub; this.estimationModeBusinessFacade = estimationModeBusinessFacade; this.statsModeBusinessFacade = statsModeBusinessFacade; this.streamModeBusinessFacade = streamModeBusinessFacade; @@ -227,11 +221,7 @@ public static CentralityProcedureFacade create( estimationModeBusinessFacade ); - var speakerListenerLPAMutateStub = new LocalSpeakerListenerLPAMutateStub( - genericStub, - mutateModeBusinessFacade, - estimationModeBusinessFacade - ); + return new LocalCentralityProcedureFacade( procedureReturnColumns, @@ -245,7 +235,6 @@ public static CentralityProcedureFacade create( harmonicCentralityMutateStub, articulationPointsMutateStub, pageRankMutateStub, - speakerListenerLPAMutateStub, estimationModeBusinessFacade, centralityApplications.stats(), centralityApplications.stream(), @@ -1231,97 +1220,6 @@ public Stream pageRankWriteEstimate( return Stream.of(estimationModeBusinessFacade.pageRank(parsedConfiguration, graphNameOrConfiguration)); } - @Override - public Stream sllpaStreamEstimate( - Object graphNameOrConfiguration, - Map algorithmConfiguration - ) { - var parsedConfiguration = configurationParser.parseConfiguration( - algorithmConfiguration, - SpeakerListenerLPAConfig::of - ); - return Stream.of(estimationModeBusinessFacade.speakerListenerLPA(parsedConfiguration, graphNameOrConfiguration)); - } - - @Override - public Stream sllpaStream(String graphName, Map configuration) { - var resultBuilder = new SpeakerListenerLPAResultBuilderForStreamMode(); - - var parsedConfiguration = configurationParser.parseConfiguration( - configuration, - SpeakerListenerLPAConfig::of - ); - - return streamModeBusinessFacade.sllpa( - GraphName.parse(graphName), - parsedConfiguration, - resultBuilder - ); - } - - @Override - public Stream sllpaStatsEstimate( - Object graphNameOrConfiguration, - Map algorithmConfiguration - ) { - var parsedConfiguration = configurationParser.parseConfiguration( - algorithmConfiguration, - SpeakerListenerLPAConfig::of - ); - - return Stream.of(estimationModeBusinessFacade.speakerListenerLPA(parsedConfiguration, graphNameOrConfiguration)); - } - - @Override - public Stream sllpaStats(String graphName, Map configuration) { - - var parsedConfiguration = configurationParser.parseConfiguration( - configuration, - SpeakerListenerLPAConfig::of - ); - - var resultBuilder = new SpeakerListenerLPAResultBuilderForStatsMode(parsedConfiguration); - - return statsModeBusinessFacade.sllpa( - GraphName.parse(graphName), - parsedConfiguration, - resultBuilder - ); - } - - @Override - public Stream sllpaWriteEstimate( - Object graphNameOrConfiguration, - Map algorithmConfiguration - ) { - var parsedConfiguration = configurationParser.parseConfiguration( - algorithmConfiguration, - SpeakerListenerLPAConfig::of - ); - - return Stream.of(estimationModeBusinessFacade.speakerListenerLPA(parsedConfiguration, graphNameOrConfiguration)); - } - - @Override - public Stream sllpaWrite(String graphName, Map configuration) { - var parsedConfiguration = configurationParser.parseConfiguration( - configuration, - SpeakerListenerLPAConfig::of - ); - var resultBuilder = new SpeakerListenerLPAResultBuilderForWriteMode(); - - - return writeModeBusinessFacade.sllpa( - GraphName.parse(graphName), - parsedConfiguration, - resultBuilder - ); - } - - @Override - public SpeakerListenerLPAMutateStub speakerListenerLPAMutateStub() { - return speakerListenerLPAMutateStub; - } } diff --git a/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/LocalCommunityProcedureFacade.java b/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/LocalCommunityProcedureFacade.java index 78d92179f2..f67092b0fe 100644 --- a/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/LocalCommunityProcedureFacade.java +++ b/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/LocalCommunityProcedureFacade.java @@ -70,11 +70,13 @@ import org.neo4j.gds.procedures.algorithms.community.stubs.LocalLouvainMutateStub; import org.neo4j.gds.procedures.algorithms.community.stubs.LocalModularityOptimizationMutateStub; import org.neo4j.gds.procedures.algorithms.community.stubs.LocalSccMutateStub; +import org.neo4j.gds.procedures.algorithms.community.stubs.LocalSpeakerListenerLPAMutateStub; import org.neo4j.gds.procedures.algorithms.community.stubs.LocalTriangleCountMutateStub; import org.neo4j.gds.procedures.algorithms.community.stubs.LocalWccMutateStub; import org.neo4j.gds.procedures.algorithms.community.stubs.LouvainMutateStub; import org.neo4j.gds.procedures.algorithms.community.stubs.ModularityOptimizationMutateStub; import org.neo4j.gds.procedures.algorithms.community.stubs.SccMutateStub; +import org.neo4j.gds.procedures.algorithms.community.stubs.SpeakerListenerLPAMutateStub; import org.neo4j.gds.procedures.algorithms.community.stubs.TriangleCountMutateStub; import org.neo4j.gds.procedures.algorithms.community.stubs.WccMutateStub; import org.neo4j.gds.procedures.algorithms.configuration.UserSpecificConfigurationParser; @@ -83,6 +85,7 @@ import org.neo4j.gds.scc.SccStatsConfig; import org.neo4j.gds.scc.SccStreamConfig; import org.neo4j.gds.scc.SccWriteConfig; +import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; import org.neo4j.gds.triangle.LocalClusteringCoefficientStatsConfig; import org.neo4j.gds.triangle.LocalClusteringCoefficientStreamConfig; import org.neo4j.gds.triangle.LocalClusteringCoefficientWriteConfig; @@ -120,6 +123,8 @@ public final class LocalCommunityProcedureFacade implements CommunityProcedureFa private final SccMutateStub sccMutateStub; private final TriangleCountMutateStub triangleCountMutateStub; private final WccMutateStub wccMutateStub; + private final SpeakerListenerLPAMutateStub speakerListenerLPAMutateStub; + private final UserSpecificConfigurationParser configurationParser; @@ -140,6 +145,7 @@ private LocalCommunityProcedureFacade( LeidenMutateStub leidenMutateStub, LouvainMutateStub louvainMutateStub, ModularityOptimizationMutateStub modularityOptimizationMutateStub, + SpeakerListenerLPAMutateStub speakerListenerLPAMutateStub, SccMutateStub sccMutateStub, TriangleCountMutateStub triangleCountMutateStub, WccMutateStub wccMutateStub, @@ -163,6 +169,8 @@ private LocalCommunityProcedureFacade( this.lccMutateStub = lccMutateStub; this.triangleCountMutateStub = triangleCountMutateStub; this.wccMutateStub = wccMutateStub; + this.speakerListenerLPAMutateStub = speakerListenerLPAMutateStub; + this.configurationParser = configurationParser; } @@ -253,6 +261,12 @@ public static CommunityProcedureFacade create( procedureReturnColumns ); + var speakerListenerLPAMutateStub = new LocalSpeakerListenerLPAMutateStub( + genericStub, + communityApplications.mutate(), + communityApplications.estimate() + ); + return new LocalCommunityProcedureFacade( closeableResourceRegistry, procedureReturnColumns, @@ -269,6 +283,7 @@ public static CommunityProcedureFacade create( leidenMutateStub, louvainMutateStub, modularityOptimizationMutateStub, + speakerListenerLPAMutateStub, sccMutateStub, triangleCountMutateStub, wccMutateStub, @@ -1179,4 +1194,97 @@ public Stream wccWriteEstimate( var configuration = configurationParser.parseConfiguration(algorithmConfiguration, WccWriteConfig::of); return Stream.of(estimationModeBusinessFacade.wcc(configuration, graphNameOrConfiguration)); } + + @Override + public Stream sllpaStreamEstimate( + Object graphNameOrConfiguration, + Map algorithmConfiguration + ) { + var parsedConfiguration = configurationParser.parseConfiguration( + algorithmConfiguration, + SpeakerListenerLPAConfig::of + ); + + return Stream.of(estimationModeBusinessFacade.speakerListenerLPA(parsedConfiguration, graphNameOrConfiguration)); + } + + @Override + public Stream sllpaStream(String graphName, Map configuration) { + var resultBuilder = new SpeakerListenerLPAResultBuilderForStreamMode(); + + var parsedConfiguration = configurationParser.parseConfiguration( + configuration, + SpeakerListenerLPAConfig::of + ); + + return streamModeBusinessFacade.sllpa( + GraphName.parse(graphName), + parsedConfiguration, + resultBuilder + ); + } + + @Override + public Stream sllpaStatsEstimate( + Object graphNameOrConfiguration, + Map algorithmConfiguration + ) { + var parsedConfiguration = configurationParser.parseConfiguration( + algorithmConfiguration, + SpeakerListenerLPAConfig::of + ); + + return Stream.of(estimationModeBusinessFacade.speakerListenerLPA(parsedConfiguration, graphNameOrConfiguration)); + } + + @Override + public Stream sllpaStats(String graphName, Map configuration) { + + var parsedConfiguration = configurationParser.parseConfiguration( + configuration, + SpeakerListenerLPAConfig::of + ); + + var resultBuilder = new SpeakerListenerLPAResultBuilderForStatsMode(parsedConfiguration); + + return statsModeBusinessFacade.sllpa( + GraphName.parse(graphName), + parsedConfiguration, + resultBuilder + ); + } + + @Override + public Stream sllpaWriteEstimate( + Object graphNameOrConfiguration, + Map algorithmConfiguration + ) { + var parsedConfiguration = configurationParser.parseConfiguration( + algorithmConfiguration, + SpeakerListenerLPAConfig::of + ); + + return Stream.of(estimationModeBusinessFacade.speakerListenerLPA(parsedConfiguration, graphNameOrConfiguration)); + } + + @Override + public Stream sllpaWrite(String graphName, Map configuration) { + var parsedConfiguration = configurationParser.parseConfiguration( + configuration, + SpeakerListenerLPAConfig::of + ); + var resultBuilder = new SpeakerListenerLPAResultBuilderForWriteMode(); + + + return writeModeBusinessFacade.sllpa( + GraphName.parse(graphName), + parsedConfiguration, + resultBuilder + ); + } + + @Override + public SpeakerListenerLPAMutateStub speakerListenerLPAMutateStub() { + return speakerListenerLPAMutateStub; + } } diff --git a/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAResultBuilderForStatsMode.java b/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAResultBuilderForStatsMode.java similarity index 97% rename from procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAResultBuilderForStatsMode.java rename to procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAResultBuilderForStatsMode.java index d7f0c98992..a942904190 100644 --- a/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAResultBuilderForStatsMode.java +++ b/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAResultBuilderForStatsMode.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.procedures.algorithms.centrality; +package org.neo4j.gds.procedures.algorithms.community; import org.neo4j.gds.api.Graph; import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings; diff --git a/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAResultBuilderForStreamMode.java b/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAResultBuilderForStreamMode.java similarity index 97% rename from procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAResultBuilderForStreamMode.java rename to procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAResultBuilderForStreamMode.java index 64a4320abf..027039cadf 100644 --- a/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAResultBuilderForStreamMode.java +++ b/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAResultBuilderForStreamMode.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.procedures.algorithms.centrality; +package org.neo4j.gds.procedures.algorithms.community; import org.neo4j.gds.api.Graph; import org.neo4j.gds.api.GraphStore; diff --git a/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAResultBuilderForWriteMode.java b/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAResultBuilderForWriteMode.java similarity index 97% rename from procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAResultBuilderForWriteMode.java rename to procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAResultBuilderForWriteMode.java index b2f68105dc..4ec32b764b 100644 --- a/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAResultBuilderForWriteMode.java +++ b/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAResultBuilderForWriteMode.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.procedures.algorithms.centrality; +package org.neo4j.gds.procedures.algorithms.community; import org.neo4j.gds.api.Graph; import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings; diff --git a/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/stubs/LocalSpeakerListenerLPAMutateStub.java b/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/stubs/LocalSpeakerListenerLPAMutateStub.java similarity index 79% rename from procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/stubs/LocalSpeakerListenerLPAMutateStub.java rename to procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/stubs/LocalSpeakerListenerLPAMutateStub.java index 4502e4b8cb..8716502608 100644 --- a/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/stubs/LocalSpeakerListenerLPAMutateStub.java +++ b/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/stubs/LocalSpeakerListenerLPAMutateStub.java @@ -17,13 +17,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.procedures.algorithms.centrality.stubs; +package org.neo4j.gds.procedures.algorithms.community.stubs; -import org.neo4j.gds.applications.algorithms.centrality.CentralityAlgorithmsEstimationModeBusinessFacade; -import org.neo4j.gds.applications.algorithms.centrality.CentralityAlgorithmsMutateModeBusinessFacade; +import org.neo4j.gds.applications.algorithms.community.CommunityAlgorithmsEstimationModeBusinessFacade; +import org.neo4j.gds.applications.algorithms.community.CommunityAlgorithmsMutateModeBusinessFacade; import org.neo4j.gds.applications.algorithms.machinery.MemoryEstimateResult; import org.neo4j.gds.mem.MemoryEstimation; -import org.neo4j.gds.procedures.algorithms.centrality.SpeakerListenerLPAMutateResult; +import org.neo4j.gds.procedures.algorithms.community.SpeakerListenerLPAMutateResult; import org.neo4j.gds.procedures.algorithms.stubs.GenericStub; import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; @@ -32,13 +32,13 @@ public class LocalSpeakerListenerLPAMutateStub implements SpeakerListenerLPAMutateStub { private final GenericStub genericStub; - private final CentralityAlgorithmsMutateModeBusinessFacade mutateModeBusinessFacade; - private final CentralityAlgorithmsEstimationModeBusinessFacade estimationModeBusinessFacade; + private final CommunityAlgorithmsMutateModeBusinessFacade mutateModeBusinessFacade; + private final CommunityAlgorithmsEstimationModeBusinessFacade estimationModeBusinessFacade; public LocalSpeakerListenerLPAMutateStub( GenericStub genericStub, - CentralityAlgorithmsMutateModeBusinessFacade mutateModeBusinessFacade, - CentralityAlgorithmsEstimationModeBusinessFacade estimationModeBusinessFacade + CommunityAlgorithmsMutateModeBusinessFacade mutateModeBusinessFacade, + CommunityAlgorithmsEstimationModeBusinessFacade estimationModeBusinessFacade ) { this.genericStub = genericStub; this.mutateModeBusinessFacade = mutateModeBusinessFacade; diff --git a/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/stubs/SpeakerListenerLPAResultBuilderForMutateMode.java b/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/stubs/SpeakerListenerLPAResultBuilderForMutateMode.java similarity index 93% rename from procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/stubs/SpeakerListenerLPAResultBuilderForMutateMode.java rename to procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/stubs/SpeakerListenerLPAResultBuilderForMutateMode.java index 77dde87ede..70c44ea879 100644 --- a/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/stubs/SpeakerListenerLPAResultBuilderForMutateMode.java +++ b/procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/community/stubs/SpeakerListenerLPAResultBuilderForMutateMode.java @@ -17,14 +17,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.procedures.algorithms.centrality.stubs; +package org.neo4j.gds.procedures.algorithms.community.stubs; import org.neo4j.gds.api.Graph; import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings; import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder; import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten; import org.neo4j.gds.beta.pregel.PregelResult; -import org.neo4j.gds.procedures.algorithms.centrality.SpeakerListenerLPAMutateResult; +import org.neo4j.gds.procedures.algorithms.community.SpeakerListenerLPAMutateResult; import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; import java.util.Optional; diff --git a/procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/CentralityProcedureFacade.java b/procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/CentralityProcedureFacade.java index d4809442c5..1d7431c82f 100644 --- a/procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/CentralityProcedureFacade.java +++ b/procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/CentralityProcedureFacade.java @@ -31,7 +31,6 @@ import org.neo4j.gds.procedures.algorithms.centrality.stubs.DegreeCentralityMutateStub; import org.neo4j.gds.procedures.algorithms.centrality.stubs.HarmonicCentralityMutateStub; import org.neo4j.gds.procedures.algorithms.centrality.stubs.PageRankMutateStub; -import org.neo4j.gds.procedures.algorithms.centrality.stubs.SpeakerListenerLPAMutateStub; import java.util.Map; import java.util.stream.Stream; @@ -284,37 +283,6 @@ Stream pageRankWriteEstimate( Map algorithmConfiguration ); - Stream sllpaStreamEstimate( - Object graphNameOrConfiguration, - Map algorithmConfiguration - ); - - Stream sllpaStream( - String graphName, - Map configuration - ); - - Stream sllpaStatsEstimate( - Object graphNameOrConfiguration, - Map algorithmConfiguration - ); - - Stream sllpaStats( - String graphName, - Map configuration - ); - - Stream sllpaWriteEstimate( - Object graphNameOrConfiguration, - Map algorithmConfiguration - ); - - Stream sllpaWrite( - String graphName, - Map configuration - ); - - SpeakerListenerLPAMutateStub speakerListenerLPAMutateStub(); } diff --git a/procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/CommunityProcedureFacade.java b/procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/CommunityProcedureFacade.java index 386e764658..40c0103b55 100644 --- a/procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/CommunityProcedureFacade.java +++ b/procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/CommunityProcedureFacade.java @@ -30,6 +30,7 @@ import org.neo4j.gds.procedures.algorithms.community.stubs.LouvainMutateStub; import org.neo4j.gds.procedures.algorithms.community.stubs.ModularityOptimizationMutateStub; import org.neo4j.gds.procedures.algorithms.community.stubs.SccMutateStub; +import org.neo4j.gds.procedures.algorithms.community.stubs.SpeakerListenerLPAMutateStub; import org.neo4j.gds.procedures.algorithms.community.stubs.TriangleCountMutateStub; import org.neo4j.gds.procedures.algorithms.community.stubs.WccMutateStub; @@ -404,4 +405,37 @@ Stream wccWriteEstimate( Object graphNameOrConfiguration, Map algorithmConfiguration ); + + Stream sllpaStreamEstimate( + Object graphNameOrConfiguration, + Map algorithmConfiguration + ); + + Stream sllpaStream( + String graphName, + Map configuration + ); + + Stream sllpaStatsEstimate( + Object graphNameOrConfiguration, + Map algorithmConfiguration + ); + + Stream sllpaStats( + String graphName, + Map configuration + ); + + Stream sllpaWriteEstimate( + Object graphNameOrConfiguration, + Map algorithmConfiguration + ); + + Stream sllpaWrite( + String graphName, + Map configuration + ); + + + SpeakerListenerLPAMutateStub speakerListenerLPAMutateStub(); } diff --git a/procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAMutateResult.java b/procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAMutateResult.java similarity index 96% rename from procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAMutateResult.java rename to procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAMutateResult.java index 7f5138b762..951068f657 100644 --- a/procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAMutateResult.java +++ b/procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAMutateResult.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.procedures.algorithms.centrality; +package org.neo4j.gds.procedures.algorithms.community; import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings; diff --git a/procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAStatsResult.java b/procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAStatsResult.java similarity index 95% rename from procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAStatsResult.java rename to procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAStatsResult.java index aa5cfea5f6..0be508175a 100644 --- a/procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAStatsResult.java +++ b/procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAStatsResult.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.procedures.algorithms.centrality; +package org.neo4j.gds.procedures.algorithms.community; import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings; diff --git a/procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAStreamResult.java b/procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAStreamResult.java similarity index 93% rename from procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAStreamResult.java rename to procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAStreamResult.java index ccab7744a0..b811a08baf 100644 --- a/procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAStreamResult.java +++ b/procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAStreamResult.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.procedures.algorithms.centrality; +package org.neo4j.gds.procedures.algorithms.community; import java.util.Map; diff --git a/procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAWriteResult.java b/procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAWriteResult.java similarity index 96% rename from procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAWriteResult.java rename to procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAWriteResult.java index 4c19932d27..8451080b03 100644 --- a/procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/SpeakerListenerLPAWriteResult.java +++ b/procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/SpeakerListenerLPAWriteResult.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.procedures.algorithms.centrality; +package org.neo4j.gds.procedures.algorithms.community; import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings; diff --git a/procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/stubs/SpeakerListenerLPAMutateStub.java b/procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/stubs/SpeakerListenerLPAMutateStub.java similarity index 91% rename from procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/stubs/SpeakerListenerLPAMutateStub.java rename to procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/stubs/SpeakerListenerLPAMutateStub.java index 8a2d324a8f..1f09f941b8 100644 --- a/procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/stubs/SpeakerListenerLPAMutateStub.java +++ b/procedures/facade-api/community-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/community/stubs/SpeakerListenerLPAMutateStub.java @@ -17,11 +17,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.procedures.algorithms.centrality.stubs; +package org.neo4j.gds.procedures.algorithms.community.stubs; import org.neo4j.gds.applications.algorithms.machinery.MemoryEstimateResult; import org.neo4j.gds.mem.MemoryEstimation; -import org.neo4j.gds.procedures.algorithms.centrality.SpeakerListenerLPAMutateResult; +import org.neo4j.gds.procedures.algorithms.community.SpeakerListenerLPAMutateResult; import org.neo4j.gds.procedures.algorithms.stubs.MutateStub; import org.neo4j.gds.sllpa.SpeakerListenerLPAConfig; diff --git a/procedures/facade-api/configs/centrality-configs/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAConfig.java b/procedures/facade-api/configs/community-configs/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAConfig.java similarity index 100% rename from procedures/facade-api/configs/centrality-configs/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAConfig.java rename to procedures/facade-api/configs/community-configs/src/main/java/org/neo4j/gds/sllpa/SpeakerListenerLPAConfig.java