Class BlobCheckpointStore
- java.lang.Object
-
- com.azure.messaging.eventhubs.checkpointstore.blob.BlobCheckpointStore
-
- All Implemented Interfaces:
CheckpointStore
public class BlobCheckpointStore extends Object implements CheckpointStore
Implementation ofCheckpointStorethat uses Storage Blobs for persisting partition ownership and checkpoint information.EventProcessorscan use this implementation to load balance and update checkpoints.- See Also:
EventProcessorClient
-
-
Field Summary
Fields Modifier and Type Field Description static StringEMPTY_STRINGAn empty string.
-
Constructor Summary
Constructors Constructor Description BlobCheckpointStore(com.azure.storage.blob.BlobContainerAsyncClient blobContainerAsyncClient)Creates an instance of BlobCheckpointStore.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Flux<PartitionOwnership>claimOwnership(List<PartitionOwnership> requestedPartitionOwnerships)This method is called by theEventProcessorClientto claim ownership of a list of partitions.Flux<Checkpoint>listCheckpoints(String fullyQualifiedNamespace, String eventHubName, String consumerGroup)Flux<PartitionOwnership>listOwnership(String fullyQualifiedNamespace, String eventHubName, String consumerGroup)This method is called by theEventProcessorClientto get the list of all existing partition ownership from the Storage Blobs.Mono<Void>updateCheckpoint(Checkpoint checkpoint)Updates the checkpoint in Storage Blobs for a partition.
-
-
-
Field Detail
-
EMPTY_STRING
public static final String EMPTY_STRING
An empty string.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BlobCheckpointStore
public BlobCheckpointStore(com.azure.storage.blob.BlobContainerAsyncClient blobContainerAsyncClient)
Creates an instance of BlobCheckpointStore.- Parameters:
blobContainerAsyncClient- TheBlobContainerAsyncClientthis instance will use to read and update blobs in the storage container.
-
-
Method Detail
-
listOwnership
public Flux<PartitionOwnership> listOwnership(String fullyQualifiedNamespace, String eventHubName, String consumerGroup)
This method is called by theEventProcessorClientto get the list of all existing partition ownership from the Storage Blobs. Could return empty results if there are is no existing ownership information.- Specified by:
listOwnershipin interfaceCheckpointStore- Parameters:
eventHubName- The Event Hub name to get ownership information.consumerGroup- The consumer group name.- Returns:
- A flux of partition ownership details of all the partitions that have/had an owner.
-
listCheckpoints
public Flux<Checkpoint> listCheckpoints(String fullyQualifiedNamespace, String eventHubName, String consumerGroup)
- Specified by:
listCheckpointsin interfaceCheckpointStore
-
claimOwnership
public Flux<PartitionOwnership> claimOwnership(List<PartitionOwnership> requestedPartitionOwnerships)
This method is called by theEventProcessorClientto claim ownership of a list of partitions. This will return the list of partitions that were owned successfully.- Specified by:
claimOwnershipin interfaceCheckpointStore- Parameters:
requestedPartitionOwnerships- List of partition ownerships this instance is requesting to own.- Returns:
- A flux of partitions this instance successfully claimed ownership.
-
updateCheckpoint
public Mono<Void> updateCheckpoint(Checkpoint checkpoint)
Updates the checkpoint in Storage Blobs for a partition.- Specified by:
updateCheckpointin interfaceCheckpointStore- Parameters:
checkpoint- Checkpoint information containing sequence number and offset to be stored for this partition.- Returns:
- The new ETag on successful update.
-
-