This is an automated email from the ASF dual-hosted git repository.
daojun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new fba91264b55 [improve] Change PersistentMessageFinder's fields modifier
to reuse in plugins (#24308)
fba91264b55 is described below
commit fba91264b5505bc31b4b3c6bb0706adf7bfe3cef
Author: 道君- Tao Jiuming <[email protected]>
AuthorDate: Fri May 16 14:54:25 2025 +0800
[improve] Change PersistentMessageFinder's fields modifier to reuse in
plugins (#24308)
---
.../service/persistent/PersistentMessageFinder.java | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentMessageFinder.java
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentMessageFinder.java
index 74a9d713e77..e8bc9fdc3ea 100644
---
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentMessageFinder.java
+++
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentMessageFinder.java
@@ -39,17 +39,17 @@ import org.slf4j.LoggerFactory;
* given a timestamp find the first message (position) (published) at or
before the timestamp.
*/
public class PersistentMessageFinder implements
AsyncCallbacks.FindEntryCallback {
- private final ManagedCursor cursor;
- private final String subName;
- private final int ledgerCloseTimestampMaxClockSkewMillis;
- private final String topicName;
- private long timestamp = 0;
+ protected final ManagedCursor cursor;
+ protected final String subName;
+ protected final int ledgerCloseTimestampMaxClockSkewMillis;
+ protected final String topicName;
+ protected long timestamp = 0;
- private static final int FALSE = 0;
- private static final int TRUE = 1;
+ protected static final int FALSE = 0;
+ protected static final int TRUE = 1;
@SuppressWarnings("unused")
- private volatile int messageFindInProgress = FALSE;
- private static final AtomicIntegerFieldUpdater<PersistentMessageFinder>
messageFindInProgressUpdater =
+ protected volatile int messageFindInProgress = FALSE;
+ protected static final AtomicIntegerFieldUpdater<PersistentMessageFinder>
MESSAGE_FIND_IN_PROGRESS =
AtomicIntegerFieldUpdater
.newUpdater(PersistentMessageFinder.class,
"messageFindInProgress");
@@ -61,7 +61,7 @@ public class PersistentMessageFinder implements
AsyncCallbacks.FindEntryCallback
}
public void findMessages(final long timestamp,
AsyncCallbacks.FindEntryCallback callback) {
- if (messageFindInProgressUpdater.compareAndSet(this, FALSE, TRUE)) {
+ if (MESSAGE_FIND_IN_PROGRESS.compareAndSet(this, FALSE, TRUE)) {
this.timestamp = timestamp;
if (log.isDebugEnabled()) {
log.debug("[{}] Starting message position find at timestamp
{}", subName, timestamp);