Skip to content

Commit 84ea16a

Browse files
Set requested concurrency separately in ProgressTracker
Co-authored-by: Ioannis Panagiotas <ioannis.panagiotas@neotechnology.com>
1 parent f53debf commit 84ea16a

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

executor/src/main/java/org/neo4j/gds/executor/ProcedureExecutor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ public RESULT compute(
113113

114114
ALGO algo = newAlgorithm(graph, graphStore, config);
115115

116-
algo.getProgressTracker().setEstimatedResourceFootprint(memoryEstimationInBytes, config.concurrency());
117-
116+
algo.getProgressTracker().setEstimatedResourceFootprint(memoryEstimationInBytes);
117+
algo.getProgressTracker().requestedConcurrency(config.concurrency());
118118

119119
ALGO_RESULT result = executeAlgorithm(builder, algo, executionContext.metrics().algorithmMetrics());
120120

progress-tracking/src/main/java/org/neo4j/gds/core/utils/progress/tasks/ProgressTracker.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ public interface ProgressTracker {
2828

2929
ProgressTracker NULL_TRACKER = new EmptyProgressTracker();
3030

31-
void setEstimatedResourceFootprint(MemoryRange memoryEstimationInBytes, Concurrency concurrency);
31+
void setEstimatedResourceFootprint(MemoryRange memoryEstimationInBytes);
32+
33+
void requestedConcurrency(Concurrency concurrency);
3234

3335
void beginSubTask();
3436

@@ -89,7 +91,12 @@ default void logInfo(String message) {
8991
class EmptyProgressTracker implements ProgressTracker {
9092

9193
@Override
92-
public void setEstimatedResourceFootprint(MemoryRange memoryRangeInBytes, Concurrency concurrency) {
94+
public void setEstimatedResourceFootprint(MemoryRange memoryRangeInBytes) {
95+
}
96+
97+
@Override
98+
public void requestedConcurrency(Concurrency concurrency) {
99+
93100
}
94101

95102
@Override

progress-tracking/src/main/java/org/neo4j/gds/core/utils/progress/tasks/ProgressTrackerAdapter.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@ public ProgressTrackerAdapter(ProgressTracker delegate) {
3333
}
3434

3535
@Override
36-
public void setEstimatedResourceFootprint(MemoryRange memoryEstimationInBytes, Concurrency concurrency) {
37-
delegate.setEstimatedResourceFootprint(memoryEstimationInBytes, concurrency);
36+
public void setEstimatedResourceFootprint(MemoryRange memoryEstimationInBytes) {
37+
delegate.setEstimatedResourceFootprint(memoryEstimationInBytes);
38+
}
39+
40+
@Override
41+
public void requestedConcurrency(Concurrency concurrency) {
42+
delegate.requestedConcurrency(concurrency);
3843
}
3944

4045
@Override

progress-tracking/src/main/java/org/neo4j/gds/core/utils/progress/tasks/TaskProgressTracker.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,13 @@ protected TaskProgressTracker(
103103
}
104104

105105
@Override
106-
public void setEstimatedResourceFootprint(MemoryRange memoryRangeInBytes, Concurrency maxConcurrency) {
106+
public void setEstimatedResourceFootprint(MemoryRange memoryRangeInBytes) {
107107
this.baseTask.setEstimatedMemoryRangeInBytes(memoryRangeInBytes);
108-
this.baseTask.setMaxConcurrency(maxConcurrency);
108+
}
109+
110+
@Override
111+
public void requestedConcurrency(Concurrency concurrency) {
112+
this.baseTask.setMaxConcurrency(concurrency);
109113
}
110114

111115
@Override

0 commit comments

Comments
 (0)