dao-jun commented on code in PR #21739:
URL: https://github.com/apache/pulsar/pull/21739#discussion_r1429898348
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpReadEntry.java:
##########
@@ -60,7 +61,18 @@ public static OpReadEntry create(ManagedCursorImpl cursor,
PositionImpl readPosi
maxPosition = PositionImpl.LATEST;
}
op.maxPosition = maxPosition;
- op.skipCondition = skipCondition;
+
+ Predicate<PositionImpl> skipCondition0 = cursor instanceof
ReadOnlyCursor ? null : cursor::isMessageDeleted;
+ if (skipCondition == null) {
+ op.skipCondition = skipCondition0;
+ } else {
+ if (skipCondition0 == null) {
+ op.skipCondition = skipCondition;
+ } else {
+ op.skipCondition = skipCondition.or(skipCondition0);
+ }
+ }
Review Comment:
> I think it's better to pass a parameter to specify whether to skip deleted
messages or pass in skipCondition instead of changing the behavior of read
directly.
For `OpReadEntry` it will filter-out deleted messages in
`readEntriesComplete`, so I think add `skipCondition` directly is makes sense,
It should be consistent with the original semantics
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]