Skip to content

Conversation

@ArafatKhan2198
Copy link
Contributor

What changes were proposed in this pull request?

We can parallelize the process() method in NSSummaryTask similarly to how reprocess() was parallelized. Instead of running processWithFSO(), processWithLegacy(), and processWithOBS() sequentially, we can execute them concurrently using an ExecutorService.

We will :-

  1. Use a thread pool to execute processWithFSO(), processWithLegacy(), and processWithOBS() concurrently.
  2. Use Future objects to collect the results from each task.
  3. Wait for all tasks to complete and check their success/failure.
  4. Shutdown the executor service properly.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-12184

How was this patch tested?

Manually Tested

@ArafatKhan2198 ArafatKhan2198 marked this pull request as ready for review February 3, 2025 08:32
LOG.error("processWithOBS failed.");

// Thread pool to execute tasks concurrently
ExecutorService executorService = Executors.newFixedThreadPool(3);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a thread pool is heavy-weight, it should be reused.

for (Future<Boolean> result : results) {
if (!result.get()) {
LOG.error("One or more process tasks failed.");
return new ImmutablePair<>(getTaskName(), false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait for all results before returning.

@adoroszlai
Copy link
Contributor

/pending

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking this issue as un-mergeable as requested.

Please use /ready comment when it's resolved.

Please note that the PR will be closed after 21 days of inactivity from now. (But can be re-opened anytime later...)

/pending

@github-actions
Copy link

Thank you very much for the patch. I am closing this PR temporarily as there was no activity recently and it is waiting for response from its author.

It doesn't mean that this PR is not important or ignored: feel free to reopen the PR at any time.

It only means that attention of committers is not required. We prefer to keep the review queue clean. This ensures PRs in need of review are more visible, which results in faster feedback for all PRs.

If you need ANY help to finish this PR, please contact the community on the mailing list or the slack channel."

@github-actions github-actions bot closed this Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants