Skip to content

Commit 7592236

Browse files
committed
tidying up unused dependency
1 parent c640893 commit 7592236

File tree

3 files changed

+18
-22
lines changed

3 files changed

+18
-22
lines changed

algo/src/test/java/org/neo4j/gds/pagerank/PageRankTest.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void withoutTolerance() {
112112
.tolerance(0)
113113
.build();
114114

115-
var centralityAlgorithms = new CentralityAlgorithms(null, TerminationFlag.RUNNING_TRUE);
115+
var centralityAlgorithms = new CentralityAlgorithms(TerminationFlag.RUNNING_TRUE);
116116
var result = centralityAlgorithms.pageRank(graph, config, ProgressTracker.NULL_TRACKER);
117117
var rankProvider = result.centralityScoreProvider();
118118

@@ -135,7 +135,7 @@ void withTolerance(double tolerance, int expectedIterations) {
135135
.tolerance(tolerance)
136136
.build();
137137

138-
var centralityAlgorithms = new CentralityAlgorithms(null, TerminationFlag.RUNNING_TRUE);
138+
var centralityAlgorithms = new CentralityAlgorithms(TerminationFlag.RUNNING_TRUE);
139139

140140
var pregelResult = centralityAlgorithms.pageRank(graph, config, ProgressTracker.NULL_TRACKER);
141141

@@ -161,7 +161,7 @@ void withSourceNodes(String sourceNodesString, String expectedPropertyKey) {
161161
.sourceNodes(sourceNodeIds)
162162
.build();
163163

164-
var centralityAlgorithms = new CentralityAlgorithms(null, TerminationFlag.RUNNING_TRUE);
164+
var centralityAlgorithms = new CentralityAlgorithms(TerminationFlag.RUNNING_TRUE);
165165
var result = centralityAlgorithms.pageRank(graph, config, ProgressTracker.NULL_TRACKER);
166166
var rankProvider = result.centralityScoreProvider();
167167

@@ -192,7 +192,7 @@ void withBiasedSourceNodes() {
192192
.sourceNodes(sourceNodesMap)
193193
.build();
194194

195-
var centralityAlgorithms = new CentralityAlgorithms(null, TerminationFlag.RUNNING_TRUE);
195+
var centralityAlgorithms = new CentralityAlgorithms(TerminationFlag.RUNNING_TRUE);
196196
var result = centralityAlgorithms.pageRank(graph, config, ProgressTracker.NULL_TRACKER);
197197
var rankProvider = result.centralityScoreProvider();
198198

@@ -214,7 +214,7 @@ void shouldLogProgress() {
214214
.userLogRegistryFactory(EmptyUserLogRegistryFactory.INSTANCE)
215215
.build();
216216
var progressTrackerCreator = new ProgressTrackerCreator(new LoggerForProgressTrackingAdapter(log), requestScopedDependencies);
217-
var centralityAlgorithms = new CentralityAlgorithms(progressTrackerCreator, TerminationFlag.RUNNING_TRUE);
217+
var centralityAlgorithms = new CentralityAlgorithms(TerminationFlag.RUNNING_TRUE);
218218
var businessAlgorithms = new CentralityBusinessAlgorithms(
219219
centralityAlgorithms,
220220
progressTrackerCreator
@@ -294,7 +294,7 @@ void shouldLogProgress() {
294294

295295
@Test
296296
void checkTerminationFlag() {
297-
var centralityAlgorithms = new CentralityAlgorithms(null, TerminationFlag.STOP_RUNNING);
297+
var centralityAlgorithms = new CentralityAlgorithms(TerminationFlag.STOP_RUNNING);
298298

299299
var config = PageRankStreamConfigImpl.builder()
300300
.maxIterations(40)
@@ -380,7 +380,7 @@ void withWeights(String relationshipWeight) {
380380
.concurrency(1)
381381
.build();
382382

383-
var centralityAlgorithms = new CentralityAlgorithms(null, TerminationFlag.RUNNING_TRUE);
383+
var centralityAlgorithms = new CentralityAlgorithms(TerminationFlag.RUNNING_TRUE);
384384
var result = centralityAlgorithms.pageRank(graph, config, ProgressTracker.NULL_TRACKER);
385385
var rankProvider = result.centralityScoreProvider();
386386

@@ -403,7 +403,7 @@ void withZeroWeights() {
403403
.concurrency(1)
404404
.build();
405405

406-
var centralityAlgorithms = new CentralityAlgorithms(null, TerminationFlag.RUNNING_TRUE);
406+
var centralityAlgorithms = new CentralityAlgorithms(TerminationFlag.RUNNING_TRUE);
407407
var result = centralityAlgorithms.pageRank(zeroWeightsGraph, config, ProgressTracker.NULL_TRACKER);
408408
var rankProvider = result.centralityScoreProvider();
409409

@@ -434,7 +434,7 @@ void withWeightsAndBiasedSourceNodes() {
434434
.sourceNodes(sourceNodesMap)
435435
.build();
436436

437-
var centralityAlgorithms = new CentralityAlgorithms(null, TerminationFlag.RUNNING_TRUE);
437+
var centralityAlgorithms = new CentralityAlgorithms(TerminationFlag.RUNNING_TRUE);
438438
var result = centralityAlgorithms.pageRank(graph, config, ProgressTracker.NULL_TRACKER);
439439
var rankProvider = result.centralityScoreProvider();
440440

@@ -516,7 +516,7 @@ void articleRank(SoftAssertions softly) {
516516
.concurrency(1)
517517
.build();
518518

519-
var centralityAlgorithms = new CentralityAlgorithms(null, TerminationFlag.RUNNING_TRUE);
519+
var centralityAlgorithms = new CentralityAlgorithms(TerminationFlag.RUNNING_TRUE);
520520

521521
var result = centralityAlgorithms.articleRank(graph, config, ProgressTracker.NULL_TRACKER);
522522

@@ -540,7 +540,7 @@ void articleRankOnPaperGraphTest(SoftAssertions softly) {
540540
.concurrency(1)
541541
.build();
542542

543-
var centralityAlgorithms = new CentralityAlgorithms(null, TerminationFlag.RUNNING_TRUE);
543+
var centralityAlgorithms = new CentralityAlgorithms(TerminationFlag.RUNNING_TRUE);
544544

545545
var result = centralityAlgorithms.articleRank(paperGraph, config, ProgressTracker.NULL_TRACKER);
546546

@@ -568,7 +568,7 @@ void withBiasedSourceNodes() {
568568
.sourceNodes(sourceNodesMap)
569569
.build();
570570

571-
var centralityAlgorithms = new CentralityAlgorithms(null, TerminationFlag.RUNNING_TRUE);
571+
var centralityAlgorithms = new CentralityAlgorithms(TerminationFlag.RUNNING_TRUE);
572572

573573
var result = centralityAlgorithms.articleRank(graph, config, ProgressTracker.NULL_TRACKER);
574574

@@ -627,7 +627,7 @@ void eigenvector() {
627627
.concurrency(1)
628628
.build();
629629

630-
var centralityAlgorithms = new CentralityAlgorithms(null, TerminationFlag.RUNNING_TRUE);
630+
var centralityAlgorithms = new CentralityAlgorithms(TerminationFlag.RUNNING_TRUE);
631631

632632
var result = centralityAlgorithms.eigenVector(graph, config, ProgressTracker.NULL_TRACKER);
633633

@@ -653,7 +653,7 @@ void weighted() {
653653
.concurrency(1)
654654
.build();
655655

656-
var centralityAlgorithms = new CentralityAlgorithms(null, TerminationFlag.RUNNING_TRUE);
656+
var centralityAlgorithms = new CentralityAlgorithms(TerminationFlag.RUNNING_TRUE);
657657

658658
var result = centralityAlgorithms.eigenVector(graph, config, ProgressTracker.NULL_TRACKER);
659659

@@ -679,7 +679,7 @@ void withSourceNodes() {
679679
.sourceNodes(List.of(idFunction.of("d")))
680680
.build();
681681

682-
var centralityAlgorithms = new CentralityAlgorithms(null, TerminationFlag.RUNNING_TRUE);
682+
var centralityAlgorithms = new CentralityAlgorithms(TerminationFlag.RUNNING_TRUE);
683683

684684
var result = centralityAlgorithms.eigenVector(graph, config, ProgressTracker.NULL_TRACKER);
685685

@@ -736,7 +736,7 @@ void test(String scalerName, String expectedPropertyKey) {
736736
.scaler(ScalerFactory.parse(scalerName))
737737
.build();
738738

739-
var centralityAlgorithms = new CentralityAlgorithms(null, TerminationFlag.RUNNING_TRUE);
739+
var centralityAlgorithms = new CentralityAlgorithms(TerminationFlag.RUNNING_TRUE);
740740

741741
var result = centralityAlgorithms.pageRank(graph, config, ProgressTracker.NULL_TRACKER);
742742
var rankProvider = result.centralityScoreProvider();
@@ -764,7 +764,7 @@ void parallelExecution() {
764764
var configBuilder = PageRankConfigImpl.builder();
765765

766766
PageRankConfig config1 = configBuilder.concurrency(1).build();
767-
var centralityAlgorithms = new CentralityAlgorithms(null, TerminationFlag.RUNNING_TRUE);
767+
var centralityAlgorithms = new CentralityAlgorithms(TerminationFlag.RUNNING_TRUE);
768768
var result = centralityAlgorithms.pageRank(graph, config1, ProgressTracker.NULL_TRACKER);
769769
var singleThreaded = result.centralityScoreProvider();
770770

applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityAlgorithms.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
import com.carrotsearch.hppc.LongScatterSet;
2323
import org.neo4j.gds.api.Graph;
24-
import org.neo4j.gds.applications.algorithms.machinery.ProgressTrackerCreator;
2524
import org.neo4j.gds.articulationPoints.ArticulationPointsParameters;
2625
import org.neo4j.gds.articulationpoints.ArticulationPoints;
2726
import org.neo4j.gds.articulationpoints.ArticulationPointsResult;
@@ -71,11 +70,9 @@
7170

7271
public class CentralityAlgorithms {
7372

74-
private final ProgressTrackerCreator progressTrackerCreator;
7573
private final TerminationFlag terminationFlag;
7674

77-
public CentralityAlgorithms(ProgressTrackerCreator progressTrackerCreator, TerminationFlag terminationFlag) {
78-
this.progressTrackerCreator = progressTrackerCreator;
75+
public CentralityAlgorithms(TerminationFlag terminationFlag) {
7976
this.terminationFlag = terminationFlag;
8077
}
8178

applications/algorithms/centrality/src/main/java/org/neo4j/gds/applications/algorithms/centrality/CentralityApplications.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public static CentralityApplications create(
5959
) {
6060
var estimation = new CentralityAlgorithmsEstimationModeBusinessFacade(estimationTemplate);
6161
var algorithms = new CentralityAlgorithms(
62-
progressTrackerCreator,
6362
requestScopedDependencies.terminationFlag()
6463
);
6564

0 commit comments

Comments
 (0)