Interface BucketSnapshotStorage

All Known Implementing Classes:
BookkeeperBucketSnapshotStorage

public interface BucketSnapshotStorage
  • 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 snapshot
      bucketSnapshotSegments - the list of snapshot segments
      bucketKey - the key of bucket is used to generate custom storage metadata
      topicName - the name of topic is used to generate custom storage metadata
      cursorName - the name of cursor is used to generate custom storage metadata
      Returns:
      the future with bucketId(ledgerId).
    • getBucketSnapshotMetadata

      CompletableFuture<SnapshotMetadata> getBucketSnapshotMetadata(long bucketId)
      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 snapshot
      firstSegmentEntryId - entryId of first segment of sequence (include)
      lastSegmentEntryId - entryId of last segment of sequence (include)
      Returns:
      the future with snapshot segment
    • getBucketSnapshotLength

      CompletableFuture<Long> getBucketSnapshotLength(long bucketId)
      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

      CompletableFuture<Void> deleteBucketSnapshot(long bucketId)
      Delete delayed message index bucket snapshot by bucketId.
      Parameters:
      bucketId - the bucketId of snapshot
    • start

      void start() throws Exception
      Start the bucket snapshot storage service.
      Throws:
      Exception
    • close

      void close() throws Exception
      Close the bucket snapshot storage service.
      Throws:
      Exception