-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[PIP-150][improve][broker] Support read the message of startMessageId position on the broker side #15568
Conversation
216b7a7
to
dacd590
Compare
/pulsarbot rerun-failure-checks |
3 similar comments
/pulsarbot rerun-failure-checks |
/pulsarbot rerun-failure-checks |
/pulsarbot rerun-failure-checks |
Blocked by #15761 |
/pulsarbot rerun-failure-checks |
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.
Left some comments.
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Show resolved
Hide resolved
@@ -48,39 +46,46 @@ public class NonDurableCursorImpl extends ManagedCursorImpl { | |||
// Start from last entry | |||
switch (initialPosition) { | |||
case Latest: | |||
initializeCursorPosition(ledger.getLastPositionAndCounter()); | |||
initializeCursorPosition(ledger.getLastPositionAndCounter(), inclusive); |
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.
According to the PIP. Just when startMessageId == latest, need judge inclusive. We can keep the initializeCursorPosition method unchanged and add inclusive param to the getLastPositionAndCounter method.
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.
initializeCursorPosition will read the next valid position from this position, so I think to handle this is better in initializeCursorPosition.
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/NonDurableCursorImpl.java
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
Outdated
Show resolved
Hide resolved
/pulsarbot rerun-failure-checks |
Then blocked by |
@@ -242,11 +242,13 @@ ManagedCursor openCursor(String name, InitialPosition initialPosition) throws In | |||
* operation will trigger the creation of the cursor. | |||
* @param cursorProperties | |||
* the properties for the Cursor | |||
* @param inclusive | |||
* whether to read from the specified position | |||
* @return the ManagedCursor | |||
* @throws ManagedLedgerException | |||
*/ | |||
ManagedCursor openCursor(String name, InitialPosition initialPosition, Map<String, Long> properties, |
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.
Could you add default override methods for compatibility? Because they are common APIs that can be used by other components like protocol handler.
e.g.
default void asyncOpenCursor(String name, InitialPosition initialPosition, Map<String, Long> properties,
Map<String, String> cursorProperties, OpenCursorCallback callback, Object ctx) {
asyncOpenCursor(name, initialPosition, properties, cursorProperties, false, callback, ctx);
}
This PR has been blocked by #16171. |
a895a59
to
c372120
Compare
… position on the broker side Signed-off-by: Zixuan Liu <nodeces@gmail.com>
The pr had no activity for 30 days, mark with Stale label. |
No reviewer, so close this PR. |
Fixes #14883
Motivation
See #14883
Modifications
start_message_id_inclusive
field toCommandSubscribe
messagestart_message_id_inclusive
value ofCommandSubscribe
messageNonDurableCursorImpl.java
andManagedCursorImpl.java
supports reading the message of startMessageId positionVerifying this change
Documentation
Need to update docs?
no-need-doc
doc-not-needed