You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/12/19 07:29:28 UTC

[GitHub] [pulsar] coderzc commented on a diff in pull request #18420: [feat][broker][PIP-195] Implement delayed message bucket snapshot recover - part5

coderzc commented on code in PR #18420:
URL: https://github.com/apache/pulsar/pull/18420#discussion_r1051882749


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/BucketDelayedDeliveryTracker.java:
##########
@@ -91,9 +98,66 @@ public BucketDelayedDeliveryTracker(PersistentDispatcherMultipleConsumers dispat
         this.sharedBucketPriorityQueue = new TripleLongPriorityQueue();
         this.immutableBuckets = TreeRangeMap.create();
         this.snapshotSegmentLastIndexTable = HashBasedTable.create();
-        this.numberDelayedMessages = 0L;
         ManagedCursor cursor = dispatcher.getCursor();
         this.lastMutableBucket = new MutableBucket(cursor, bucketSnapshotStorage);
+        this.numberDelayedMessages = recoverBucketSnapshot();
+    }
+
+    private long recoverBucketSnapshot() throws RuntimeException {

Review Comment:
   It seems that he needs to block `initialize` method, when using `DelayedDeliveryTrackerFactory` to create `DelayedEdeliverytracker`



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org