[improve][broker] Improve managed ledger factory async delete method parametres. - #21531
Closed
mattisonchao wants to merge 4 commits into
Closed
[improve][broker] Improve managed ledger factory async delete method parametres.#21531mattisonchao wants to merge 4 commits into
mattisonchao wants to merge 4 commits into
Conversation
| import java.util.Map; | ||
| import java.util.TreeMap; | ||
| import java.util.UUID; | ||
| import java.util.*; |
Member
There was a problem hiding this comment.
nit: Please fix the code format
heesung-sohn
reviewed
Nov 7, 2023
| DeleteLedgerCallback callback, Object ctx) { | ||
| CompletableFuture<ManagedLedgerImpl> future = ledgers.get(name); | ||
| mlConfigFuture.thenAccept(managedLedgerConfig -> { | ||
| asyncDelete(name, managedLedgerConfig, new DeleteLedgerCallback() { |
Contributor
There was a problem hiding this comment.
can we just pass the input callback?
| @Nonnull DeleteLedgerCallback callback, @Nullable Object ctx) { | ||
| Objects.requireNonNull(name); | ||
| Objects.requireNonNull(managedLedgerConfig); | ||
| Objects.requireNonNull(callback); |
Contributor
There was a problem hiding this comment.
Do we have any coding guidelines for these null checks and @Nonnull annotation?
| if (future == null) { | ||
| // Managed ledger does not exist and we're not currently trying to open it | ||
| deleteManagedLedger(name, mlConfigFuture, callback, ctx); | ||
| deleteManagedLedger(name, managedLedgerConfig, callback, ctx); |
Contributor
There was a problem hiding this comment.
Why not keep using mlConfig var name?
| * @throws ManagedLedgerException | ||
| */ | ||
| @Deprecated | ||
| void asyncDelete(String name, CompletableFuture<ManagedLedgerConfig> mlConfigFuture, |
Contributor
There was a problem hiding this comment.
What's our plan to remove this deprecated code? Can we clean the code to make the caller use the new one?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
#17915 added a new public API for the managed ledger factory interface. it's not a good approach to let the user pass a future instead of the managed configuration.
Modifications
Improve the method parameters and keep the compatibility.
Verifying this change
Documentation
docdoc-requireddoc-not-neededdoc-complete