Class BlobCheckpointStore
java.lang.Object
com.azure.messaging.eventhubs.checkpointstore.blob.BlobCheckpointStore
- All Implemented Interfaces:
CheckpointStore
Implementation of
CheckpointStore
that uses
Storage Blobs
for persisting partition ownership and checkpoint information. EventProcessors
can use
this implementation to load balance and update checkpoints.- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBlobCheckpointStore
(com.azure.storage.blob.BlobContainerAsyncClient blobContainerAsyncClient) Creates an instance of BlobCheckpointStore.BlobCheckpointStore
(com.azure.storage.blob.BlobContainerAsyncClient blobContainerAsyncClient, com.azure.core.util.ClientOptions options) Creates an instance of BlobCheckpointStore. -
Method Summary
Modifier and TypeMethodDescriptionclaimOwnership
(List<PartitionOwnership> requestedPartitionOwnerships) This method is called by theEventProcessorClient
to claim ownership of a list of partitions.listCheckpoints
(String fullyQualifiedNamespace, String eventHubName, String consumerGroup) listOwnership
(String fullyQualifiedNamespace, String eventHubName, String consumerGroup) This method is called by theEventProcessorClient
to get the list of all existing partition ownership from the Storage Blobs.updateCheckpoint
(Checkpoint checkpoint) Updates the checkpoint in Storage Blobs for a partition.
-
Field Details
-
EMPTY_STRING
An empty string.- See Also:
-
-
Constructor Details
-
BlobCheckpointStore
public BlobCheckpointStore(com.azure.storage.blob.BlobContainerAsyncClient blobContainerAsyncClient) Creates an instance of BlobCheckpointStore.- Parameters:
blobContainerAsyncClient
- TheBlobContainerAsyncClient
this instance will use to read and update blobs in the storage container.
-
BlobCheckpointStore
public BlobCheckpointStore(com.azure.storage.blob.BlobContainerAsyncClient blobContainerAsyncClient, com.azure.core.util.ClientOptions options) Creates an instance of BlobCheckpointStore.- Parameters:
blobContainerAsyncClient
- TheBlobContainerAsyncClient
this instance will use to read and updateoptions
- TheClientOptions
to configure this instance. blobs in the storage container.
-
-
Method Details
-
listOwnership
public Flux<PartitionOwnership> listOwnership(String fullyQualifiedNamespace, String eventHubName, String consumerGroup) This method is called by theEventProcessorClient
to 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:
listOwnership
in 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:
listCheckpoints
in interfaceCheckpointStore
-
claimOwnership
public Flux<PartitionOwnership> claimOwnership(List<PartitionOwnership> requestedPartitionOwnerships) This method is called by theEventProcessorClient
to claim ownership of a list of partitions. This will return the list of partitions that were owned successfully.- Specified by:
claimOwnership
in interfaceCheckpointStore
- Parameters:
requestedPartitionOwnerships
- List of partition ownerships this instance is requesting to own.- Returns:
- A flux of partitions this instance successfully claimed ownership.
-
updateCheckpoint
Updates the checkpoint in Storage Blobs for a partition.- Specified by:
updateCheckpoint
in interfaceCheckpointStore
- Parameters:
checkpoint
- Checkpoint information containing sequence number and offset to be stored for this partition.- Returns:
- The new ETag on successful update.
-