Skip to content

Commit

Permalink
Get rid of Graphstore from ResultBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
IoannisPanagiotas committed Sep 5, 2024
1 parent 2170dce commit 052de7f
Show file tree
Hide file tree
Showing 80 changed files with 8 additions and 210 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public <CONFIGURATION extends AlgoBaseConfig, RESULT_TO_CALLER, RESULT_FROM_ALGO
// inject dependencies to render results
return resultBuilder.build(
graphResources.graph(),
graphResources.graphStore(),
configuration,
result,
timingsBuilder.build(),
Expand Down Expand Up @@ -158,7 +157,6 @@ public <CONFIGURATION extends AlgoBaseConfig, RESULT_TO_CALLER, RESULT_FROM_ALGO
// inject dependencies to render results
return resultBuilder.build(
graphResources.graph(),
graphResources.graphStore(),
configuration,
result,
timingsBuilder.build(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.neo4j.gds.applications.algorithms.machinery;

import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;

import java.util.Optional;

Expand All @@ -42,7 +41,6 @@ public interface ResultBuilder<CONFIGURATION, RESULT_FROM_ALGORITHM, RESULT_TO_C
*/
RESULT_TO_CALLER build(
Graph graph,
GraphStore graphStore,
CONFIGURATION configuration,
Optional<RESULT_FROM_ALGORITHM> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,12 @@ void shouldProcessWriteAlgorithm() {
@Override
public String build(
Graph actualGraph,
GraphStore actualGraphStore,
ExampleConfiguration configuration,
Optional<ExampleResult> actualResult,
AlgorithmProcessingTimings timings,
Optional<Long> metadata
) {
assertThat(actualGraph).isEqualTo(graph);
assertThat(actualGraphStore).isEqualTo(graphStore);
assertThat(actualResult).hasValue(pathFindingResult);

assertThat(metadata.orElseThrow()).isEqualTo(42L);
Expand Down Expand Up @@ -268,7 +266,6 @@ <RESULT_FROM_ALGORITHM, MUTATE_OR_WRITE_METADATA> Optional<MUTATE_OR_WRITE_METAD
@Override
public Map<String, Long> build(
Graph graph,
GraphStore graphStore,
ExampleConfiguration configuration,
Optional<Void> unused,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.neo4j.gds.procedures.algorithms.centrality;

import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -42,7 +41,6 @@ class AlphaHarmonicCentralityResultBuilderForWriteMode implements ResultBuilder<
@Override
public Stream<AlphaHarmonicWriteResult> build(
Graph graph,
GraphStore graphStore,
DeprecatedTieredHarmonicCentralityWriteConfig configuration,
Optional<HarmonicResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import com.carrotsearch.hppc.BitSet;
import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -35,7 +34,6 @@ class ArticulationPointsResultBuilderForWriteMode implements ResultBuilder<Artic
@Override
public Stream<ArticulationPointsWriteResult> build(
Graph graph,
GraphStore graphStore,
ArticulationPointsWriteConfig configuration,
Optional<BitSet> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import org.neo4j.gds.algorithms.centrality.CentralityAlgorithmResult;
import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -42,7 +41,6 @@ class BetaClosenessCentralityResultBuilderForWriteMode implements ResultBuilder<
@Override
public Stream<BetaClosenessCentralityWriteResult> build(
Graph graph,
GraphStore graphStore,
ClosenessCentralityWriteConfig configuration,
Optional<CentralityAlgorithmResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import org.neo4j.gds.algorithms.centrality.CentralityAlgorithmResult;
import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -42,7 +41,6 @@ class BetweennessCentralityResultBuilderForWriteMode implements ResultBuilder<Be
@Override
public Stream<CentralityWriteResult> build(
Graph graph,
GraphStore graphStore,
BetweennessCentralityWriteConfig configuration,
Optional<CentralityAlgorithmResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.neo4j.gds.procedures.algorithms.centrality;

import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -34,7 +33,6 @@ class CelfResultBuilderForWriteMode implements ResultBuilder<InfluenceMaximizati
@Override
public Stream<CELFWriteResult> build(
Graph graph,
GraphStore graphStore,
InfluenceMaximizationWriteConfig configuration,
Optional<CELFResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import org.neo4j.gds.algorithms.centrality.CentralityAlgorithmResult;
import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -42,7 +41,6 @@ class ClosenessCentralityResultBuilderForWriteMode implements ResultBuilder<Clos
@Override
public Stream<CentralityWriteResult> build(
Graph graph,
GraphStore graphStore,
ClosenessCentralityWriteConfig configuration,
Optional<CentralityAlgorithmResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import org.neo4j.gds.algorithms.centrality.CentralityAlgorithmResult;
import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -42,7 +41,6 @@ class DegreeCentralityResultBuilderForWriteMode implements ResultBuilder<DegreeC
@Override
public Stream<CentralityWriteResult> build(
Graph graph,
GraphStore graphStore,
DegreeCentralityWriteConfig configuration,
Optional<CentralityAlgorithmResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.neo4j.gds.procedures.algorithms.centrality;

import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -42,7 +41,6 @@ class HarmonicCentralityResultBuilderForWriteMode implements ResultBuilder<Harmo
@Override
public Stream<CentralityWriteResult> build(
Graph graph,
GraphStore graphStore,
HarmonicCentralityWriteConfig configuration,
Optional<HarmonicResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import org.neo4j.gds.algorithms.centrality.PageRankDistributionComputer;
import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -41,7 +40,6 @@ class PageRankResultBuilderForWriteMode implements ResultBuilder<PageRankWriteCo
@Override
public Stream<PageRankWriteResult> build(
Graph graph,
GraphStore graphStore,
PageRankWriteConfig configuration,
Optional<PageRankResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import com.carrotsearch.hppc.BitSet;
import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -35,7 +34,6 @@ public class ArticulationPointsResultBuilderForMutateMode implements ResultBuild
@Override
public ArticulationPointsMutateResult build(
Graph graph,
GraphStore graphStore,
ArticulationPointsMutateConfig configuration,
Optional<BitSet> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.neo4j.gds.procedures.algorithms.centrality.stubs;

import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -42,7 +41,6 @@ class BetaClosenessCentralityResultBuilderForMutateMode implements ResultBuilder
@Override
public BetaClosenessCentralityMutateResult build(
Graph graph,
GraphStore graphStore,
ClosenessCentralityMutateConfig configuration,
Optional<ClosenessCentralityResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.neo4j.gds.procedures.algorithms.centrality.stubs;

import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -42,7 +41,6 @@ public BetweennessCentralityResultBuilderForMutateMode(boolean shouldComputeCent
@Override
public CentralityMutateResult build(
Graph graph,
GraphStore graphStore,
BetweennessCentralityMutateConfig configuration,
Optional<BetwennessCentralityResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.neo4j.gds.procedures.algorithms.centrality.stubs;

import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -34,7 +33,6 @@ public class CelfResultBuilderForMutateMode implements ResultBuilder<InfluenceMa
@Override
public CELFMutateResult build(
Graph graph,
GraphStore graphStore,
InfluenceMaximizationMutateConfig configuration,
Optional<CELFResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.neo4j.gds.procedures.algorithms.centrality.stubs;

import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -42,7 +41,6 @@ public ClosenessCentralityResultBuilderForMutateMode(boolean shouldComputeCent
@Override
public CentralityMutateResult build(
Graph graph,
GraphStore graphStore,
ClosenessCentralityMutateConfig configuration,
Optional<ClosenessCentralityResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.neo4j.gds.procedures.algorithms.centrality.stubs;

import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -42,7 +41,6 @@ public DegreeCentralityResultBuilderForMutateMode(boolean shouldComputeCentralit
@Override
public CentralityMutateResult build(
Graph graph,
GraphStore graphStore,
DegreeCentralityMutateConfig configuration,
Optional<DegreeCentralityResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.neo4j.gds.procedures.algorithms.centrality.stubs;

import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -42,7 +41,6 @@ public HarmonicCentralityResultBuilderForMutateMode(boolean shouldComputeCentra
@Override
public CentralityMutateResult build(
Graph graph,
GraphStore graphStore,
HarmonicCentralityMutateConfig configuration,
Optional<HarmonicResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import org.neo4j.gds.algorithms.centrality.PageRankDistributionComputer;
import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -41,7 +40,6 @@ public PageRankResultBuilderForMutateMode(boolean shouldComputeCentralityDistrib
@Override
public PageRankMutateResult build(
Graph graph,
GraphStore graphStore,
PageRankMutateConfig configuration,
Optional<PageRankResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.neo4j.gds.procedures.algorithms.community;

import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.k1coloring.K1ColoringResult;
Expand All @@ -37,7 +36,6 @@ class K1ColoringResultBuilderForWriteMode implements ResultBuilder<K1ColoringWri
@Override
public Stream<K1ColoringWriteResult> build(
Graph graph,
GraphStore graphStore,
K1ColoringWriteConfig configuration,
Optional<K1ColoringResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.neo4j.gds.procedures.algorithms.community;

import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
import org.neo4j.gds.applications.algorithms.metadata.NodePropertiesWritten;
Expand All @@ -34,7 +33,6 @@ class KCoreResultBuilderForWriteMode implements ResultBuilder<KCoreDecomposition
@Override
public Stream<KCoreDecompositionWriteResult> build(
Graph graph,
GraphStore graphStore,
KCoreDecompositionWriteConfig configuration,
Optional<KCoreDecompositionResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.neo4j.gds.procedures.algorithms.community;

import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.api.properties.nodes.NodePropertyValuesAdapter;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
Expand Down Expand Up @@ -49,7 +48,6 @@ class KMeansResultBuilderForWriteMode implements ResultBuilder<KmeansWriteConfig
@Override
public Stream<KmeansWriteResult> build(
Graph graph,
GraphStore graphStore,
KmeansWriteConfig configuration,
Optional<KmeansResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import org.apache.commons.lang3.tuple.Pair;
import org.neo4j.gds.api.Graph;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.api.properties.nodes.NodePropertyValues;
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
import org.neo4j.gds.applications.algorithms.machinery.ResultBuilder;
Expand All @@ -45,7 +44,6 @@ class LabelPropagationResultBuilderForWriteMode implements ResultBuilder<LabelPr
@Override
public Stream<LabelPropagationWriteResult> build(
Graph graph,
GraphStore graphStore,
LabelPropagationWriteConfig configuration,
Optional<LabelPropagationResult> result,
AlgorithmProcessingTimings timings,
Expand Down
Loading

0 comments on commit 052de7f

Please sign in to comment.