-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Issue 10896] add get message id by timestamp #11139
Conversation
/pulsarbot run-failure-checks |
@codelipenghui Hi, can you please take a look? |
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.
Good job! Just left some minor comments
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/PersistentTopicsTest.java
Show resolved
Hide resolved
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.
Many thanks for adding docs! I've left some comments, PTAL.
pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Topics.java
Outdated
Show resolved
Hide resolved
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.
Overall LGTM
how does this feature play with batched messages?
It looks to me that the MessageIdImpl that we are returning is not compatible with batched messages.
Can you please add a unit test?
Co-authored-by: Anonymitaet <50226895+Anonymitaet@users.noreply.github.com>
@eolivelli Hi, Thank you for the reminding, I have added testGetBatchMessageIdByTimestamp for batch message case. |
Thanks for the new test |
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
### Motivation #11014 introduced `getEntryTimestamp` and removed `deserializeBrokerEntryMetaDataFirst`, but #11139 is still using `deserializeBrokerEntryMetaDataFirst`, and it breaks master branch. ### Modifications use `entryTimestamp` for expiry checking in `internalGetMessageIdByTimestamp` ### Verifying this change - [x] Make sure that the change passes the CI checks.
Fixes apache#10896 Add getMessageIdByTimestamp in pulsar admin apis The core searching implementation reuses `org.apache.bookkeeper.mledger.ManagedLedger#asyncFindPosition`. Add client tool for cmd `pulsar-admin topics get-message-id`
Fixes apache#10896 ### Motivation Add getMessageIdByTimestamp in pulsar admin apis ### Modifications The core searching implementation reuses `org.apache.bookkeeper.mledger.ManagedLedger#asyncFindPosition`. Add client tool for cmd `pulsar-admin topics get-message-id`
### Motivation apache#11014 introduced `getEntryTimestamp` and removed `deserializeBrokerEntryMetaDataFirst`, but apache#11139 is still using `deserializeBrokerEntryMetaDataFirst`, and it breaks master branch. ### Modifications use `entryTimestamp` for expiry checking in `internalGetMessageIdByTimestamp` ### Verifying this change - [x] Make sure that the change passes the CI checks.
Fixes #10896
Motivation
Add getMessageIdByTimestamp in pulsar admin apis
Modifications
The core searching implementation reuses
org.apache.bookkeeper.mledger.ManagedLedger#asyncFindPosition
.Add client tool for cmd
pulsar-admin topics get-message-id
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation