Class BookkeeperBucketSnapshotStorage
java.lang.Object
org.apache.pulsar.broker.delayed.bucket.BookkeeperBucketSnapshotStorage
- All Implemented Interfaces:
BucketSnapshotStorage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the bucket snapshot storage service.createBucketSnapshot(SnapshotMetadata snapshotMetadata, List<SnapshotSegment> bucketSnapshotSegments, String bucketKey, String topicName, String cursorName) Create a delayed message index bucket snapshot with metadata and bucketSnapshotSegments.deleteBucketSnapshot(long bucketId) Delete delayed message index bucket snapshot by bucketId.getBucketSnapshotLength(long bucketId) Get total byte length of delayed message index bucket snapshot.getBucketSnapshotMetadata(long bucketId) Get delayed message index bucket snapshot metadata.getBucketSnapshotSegment(long bucketId, long firstSegmentEntryId, long lastSegmentEntryId) Get a sequence of delayed message index bucket snapshot segments.voidstart()Start the bucket snapshot storage service.
-
Constructor Details
-
BookkeeperBucketSnapshotStorage
-
-
Method Details
-
createBucketSnapshot
public CompletableFuture<Long> createBucketSnapshot(SnapshotMetadata snapshotMetadata, List<SnapshotSegment> bucketSnapshotSegments, String bucketKey, String topicName, String cursorName) Description copied from interface:BucketSnapshotStorageCreate a delayed message index bucket snapshot with metadata and bucketSnapshotSegments.- Specified by:
createBucketSnapshotin interfaceBucketSnapshotStorage- Parameters:
snapshotMetadata- the metadata of snapshotbucketSnapshotSegments- the list of snapshot segmentsbucketKey- the key of bucket is used to generate custom storage metadatatopicName- the name of topic is used to generate custom storage metadatacursorName- the name of cursor is used to generate custom storage metadata- Returns:
- the future with bucketId(ledgerId).
-
getBucketSnapshotMetadata
Description copied from interface:BucketSnapshotStorageGet delayed message index bucket snapshot metadata.- Specified by:
getBucketSnapshotMetadatain interfaceBucketSnapshotStorage- Parameters:
bucketId- the bucketId of snapshot- Returns:
- the future with snapshot expanded metadata
-
getBucketSnapshotSegment
public CompletableFuture<List<SnapshotSegment>> getBucketSnapshotSegment(long bucketId, long firstSegmentEntryId, long lastSegmentEntryId) Description copied from interface:BucketSnapshotStorageGet a sequence of delayed message index bucket snapshot segments.- Specified by:
getBucketSnapshotSegmentin interfaceBucketSnapshotStorage- Parameters:
bucketId- the bucketId of snapshotfirstSegmentEntryId- entryId of first segment of sequence (include)lastSegmentEntryId- entryId of last segment of sequence (include)- Returns:
- the future with snapshot segment
-
getBucketSnapshotLength
Description copied from interface:BucketSnapshotStorageGet total byte length of delayed message index bucket snapshot.- Specified by:
getBucketSnapshotLengthin interfaceBucketSnapshotStorage- Parameters:
bucketId- the bucketId of snapshot- Returns:
- the future with byte length of snapshot
-
deleteBucketSnapshot
Description copied from interface:BucketSnapshotStorageDelete delayed message index bucket snapshot by bucketId.- Specified by:
deleteBucketSnapshotin interfaceBucketSnapshotStorage- Parameters:
bucketId- the bucketId of snapshot
-
start
Description copied from interface:BucketSnapshotStorageStart the bucket snapshot storage service.- Specified by:
startin interfaceBucketSnapshotStorage- Throws:
Exception
-
close
Description copied from interface:BucketSnapshotStorageClose the bucket snapshot storage service.- Specified by:
closein interfaceBucketSnapshotStorage- Throws:
Exception
-