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/20 02:24:18 UTC

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

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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/ImmutableBucket.java:
##########
@@ -52,11 +63,29 @@ CompletableFuture<List<DelayedIndex>> asyncLoadNextBucketSnapshotEntry(boolean i
 
         return snapshotCreateFuture.thenCompose(__ -> {
             final long bucketId = getAndUpdateBucketId();
-            CompletableFuture<Integer> loadMetaDataFuture = new CompletableFuture<>();
+            final CompletableFuture<Integer> loadMetaDataFuture;
             if (isRecover) {
-                // TODO Recover bucket snapshot
+                final long cutoffTime = cutoffTimeSupplier.get();
+                // Load Metadata of bucket snapshot
+                loadMetaDataFuture = bucketSnapshotStorage.getBucketSnapshotMetadata(bucketId)
+                        .thenApply(snapshotMetadata -> {
+                    List<DelayedMessageIndexBucketSnapshotFormat.SnapshotSegmentMetadata> metadataList =
+                            snapshotMetadata.getMetadataListList();
+
+                    // Skip all already reach schedule time snapshot segments

Review Comment:
   Does this mean entries before the cutoff time are all delivered?



-- 
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