Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cleanup][broker] remove unnecessary parameters(reusefuture) and related logic #17378

Merged

Conversation

Pomelongan
Copy link
Contributor

@Pomelongan Pomelongan commented Aug 31, 2022

Motivation

When the org.apache.pulsar.broker.admin.AdminResource#tryCreatePartitionAsync method is called, the value of reusefuture passed in is null, which is a bit redundant and can be directly removed

Modifications

The input parameter reusefuture and the judgment that the parameter is null are removed

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

Check the box below or label this PR directly.

Need to update docs?

  • doc-not-needed

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Aug 31, 2022
@AnonHxy
Copy link
Contributor

AnonHxy commented Aug 31, 2022

LGTM

}
return FutureUtil.waitForAll(futures);
}

private CompletableFuture<Void> tryCreatePartitionAsync(final int partition, CompletableFuture<Void> reuseFuture) {
CompletableFuture<Void> result = reuseFuture == null ? new CompletableFuture<>() : reuseFuture;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't suggest we change signature of method for the might extension in the future

Copy link
Contributor Author

@Pomelongan Pomelongan Sep 1, 2022

Choose a reason for hiding this comment

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

@gaozhangmin
IMHO:
The parameter reusefuture was added for a function in the PR #6478, but it was later removed in the PR #9485, so it is reasonable to restore the parameter to its original state.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't suggest we change signature of method for the might extension in the future

@gaozhangmin
I don't see any necessary to keep this, at least in the near future. Let's make the code cleaner.

@Pomelongan
Copy link
Contributor Author

/pulsarbot run-failure-checks

@Pomelongan Pomelongan force-pushed the opt_logic_of_trycreatepartionasync branch from 2d26c83 to 551bd3b Compare September 1, 2022 15:23
@Pomelongan
Copy link
Contributor Author

/pulsarbot run-failure-checks

@Jason918 Jason918 changed the title [improve][broker] remove unnecessary parameters(reusefuture) and related logic [cleanup][broker] remove unnecessary parameters(reusefuture) and related logic Sep 4, 2022
@Jason918 Jason918 added this to the 2.12.0 milestone Sep 4, 2022
@Jason918 Jason918 added type/cleanup Code or doc cleanups e.g. remove the outdated documentation or remove the code no longer in use area/broker labels Sep 4, 2022
@Jason918
Copy link
Contributor

Jason918 commented Sep 4, 2022

/pulsarbot run-failure-checks

1 similar comment
@Pomelongan
Copy link
Contributor Author

/pulsarbot run-failure-checks

@gaozhangmin gaozhangmin merged commit f453e0a into apache:master Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker doc-not-needed Your PR changes do not impact docs type/cleanup Code or doc cleanups e.g. remove the outdated documentation or remove the code no longer in use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants