-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Added REST and CLI tool to expose ManagedLedger metadata #292
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
Conversation
This PR is the last piece missing to complete #281 |
Ping @saandrews @rdhabalia |
yes, I will review it soon. |
|
||
@Override | ||
void run() throws PulsarAdminException { | ||
String persistentTopic = validatePersistentTopic(params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it needed here? Seems to be done inside getInternalInfo as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params
is a list of string arguments. validatePersistentTopic()
is being used for all the commands to extract the topic name and ensure there are no other trailing arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM just minor comments.
@@ -110,4 +110,10 @@ | |||
public void resetFailed(ManagedLedgerException exception, Object ctx); | |||
} | |||
|
|||
public interface ManagedLedgerInfoCallback { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be as we have OpenLedgerCallback
, should have GetLedgerInfoCallback
with getLedgerInfoComplete()
?
DestinationName ds = validateTopic(destination); | ||
final CompletableFuture<JsonObject> future = new CompletableFuture<>(); | ||
asyncGetRequest(persistentTopics.path(ds.getNamespace()).path(ds.getEncodedLocalName()).path("internal-info"), | ||
new InvocationCallback<String>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if server serialize ManagedLedgerInfo
into json then if pass InvocationCallback<ManagedLedgerInfo>
here : is JAXB not able to parse it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for passing a JSONObject rather than a POJO is to avoid having the client depending on managed-ledger
which is where the POJO is defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
fix apache#289 upgrade pulsar dependency from `2.8.0-rc-202012200040` to `2.8.0-rc-202012242230`
Motivation
After enabling binary format for ManagedLedger metadata, we need a way to inspect
the metadata, parsing the binary protobuf format.
Modifications
Added REST, Java and CLI API to get the metadata dump. Any broker can answer the request, even if the ManagedLedger is not loaded at all.
New added command is:
Output: