Interface BucketSnapshotStorage
- All Known Implementing Classes:
BookkeeperBucketSnapshotStorage
public interface BucketSnapshotStorage
-
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.
-
Method Details
-
createBucketSnapshot
CompletableFuture<Long> createBucketSnapshot(SnapshotMetadata snapshotMetadata, List<SnapshotSegment> bucketSnapshotSegments, String bucketKey, String topicName, String cursorName) Create a delayed message index bucket snapshot with metadata and bucketSnapshotSegments.- 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
Get delayed message index bucket snapshot metadata.- Parameters:
bucketId- the bucketId of snapshot- Returns:
- the future with snapshot expanded metadata
-
getBucketSnapshotSegment
CompletableFuture<List<SnapshotSegment>> getBucketSnapshotSegment(long bucketId, long firstSegmentEntryId, long lastSegmentEntryId) Get a sequence of delayed message index bucket snapshot segments.- 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
Get total byte length of delayed message index bucket snapshot.- Parameters:
bucketId- the bucketId of snapshot- Returns:
- the future with byte length of snapshot
-
deleteBucketSnapshot
Delete delayed message index bucket snapshot by bucketId.- Parameters:
bucketId- the bucketId of snapshot
-
start
Start the bucket snapshot storage service.- Throws:
Exception
-
close
Close the bucket snapshot storage service.- Throws:
Exception
-