Skip to content

Commit

Permalink
Set requested concurrency separately in ProgressTracker
Browse files Browse the repository at this point in the history
Co-authored-by: Ioannis Panagiotas <[email protected]>
  • Loading branch information
vnickolov and IoannisPanagiotas committed Nov 27, 2024
1 parent f53debf commit 84ea16a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ public RESULT compute(

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

algo.getProgressTracker().setEstimatedResourceFootprint(memoryEstimationInBytes, config.concurrency());

algo.getProgressTracker().setEstimatedResourceFootprint(memoryEstimationInBytes);
algo.getProgressTracker().requestedConcurrency(config.concurrency());

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ public interface ProgressTracker {

ProgressTracker NULL_TRACKER = new EmptyProgressTracker();

void setEstimatedResourceFootprint(MemoryRange memoryEstimationInBytes, Concurrency concurrency);
void setEstimatedResourceFootprint(MemoryRange memoryEstimationInBytes);

void requestedConcurrency(Concurrency concurrency);

void beginSubTask();

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

@Override
public void setEstimatedResourceFootprint(MemoryRange memoryRangeInBytes, Concurrency concurrency) {
public void setEstimatedResourceFootprint(MemoryRange memoryRangeInBytes) {
}

@Override
public void requestedConcurrency(Concurrency concurrency) {

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ public ProgressTrackerAdapter(ProgressTracker delegate) {
}

@Override
public void setEstimatedResourceFootprint(MemoryRange memoryEstimationInBytes, Concurrency concurrency) {
delegate.setEstimatedResourceFootprint(memoryEstimationInBytes, concurrency);
public void setEstimatedResourceFootprint(MemoryRange memoryEstimationInBytes) {
delegate.setEstimatedResourceFootprint(memoryEstimationInBytes);
}

@Override
public void requestedConcurrency(Concurrency concurrency) {
delegate.requestedConcurrency(concurrency);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,13 @@ protected TaskProgressTracker(
}

@Override
public void setEstimatedResourceFootprint(MemoryRange memoryRangeInBytes, Concurrency maxConcurrency) {
public void setEstimatedResourceFootprint(MemoryRange memoryRangeInBytes) {
this.baseTask.setEstimatedMemoryRangeInBytes(memoryRangeInBytes);
this.baseTask.setMaxConcurrency(maxConcurrency);
}

@Override
public void requestedConcurrency(Concurrency concurrency) {
this.baseTask.setMaxConcurrency(concurrency);
}

@Override
Expand Down

0 comments on commit 84ea16a

Please sign in to comment.