CheckpointStore Interface

public interface CheckpointStore

An interface that defines the operations for storing and retrieving partition ownership information and checkpoint details for each partition.

Method Summary

Modifier and Type Method and Description
abstract Flux<PartitionOwnership> claimOwnership(List<PartitionOwnership> requestedPartitionOwnerships)

Called to claim ownership of a list of partitions.

abstract Flux<Checkpoint> listCheckpoints(String fullyQualifiedNamespace, String eventHubName, String consumerGroup)

Called to get the list of checkpoints from the underlying data store.

abstract Flux<PartitionOwnership> listOwnership(String fullyQualifiedNamespace, String eventHubName, String consumerGroup)

Called to get the list of all existing partition ownership from the underlying data store.

abstract Mono<Void> updateCheckpoint(Checkpoint checkpoint)

Updates the checkpoint in the data store for a partition.

Method Details

claimOwnership

public abstract Flux claimOwnership(List requestedPartitionOwnerships)

Called to claim ownership of a list of partitions. This will return the list of partitions that were owned successfully.

Parameters:

requestedPartitionOwnerships - List of partition ownerships this instance is requesting to own.

Returns:

A Flux of partitions this instance successfully claimed ownership.

listCheckpoints

public abstract Flux listCheckpoints(String fullyQualifiedNamespace, String eventHubName, String consumerGroup)

Called to get the list of checkpoints from the underlying data store. This method could return empty results if there are no checkpoints available in the data store.

Parameters:

fullyQualifiedNamespace - The fully qualified namespace of the Event Hub.
eventHubName - The Event Hub name to get checkpoint information.
consumerGroup - The consumer group name associated with the checkpoint.

Returns:

A Flux of checkpoints associated with the partitions of the Event Hub.

listOwnership

public abstract Flux listOwnership(String fullyQualifiedNamespace, String eventHubName, String consumerGroup)

Called to get the list of all existing partition ownership from the underlying data store. Could return empty results if there are is no existing ownership information.

Parameters:

fullyQualifiedNamespace - The fully qualified namespace of the Event Hub. This is likely to be similar to "{your-namespace}.servicebus.windows.net".
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.

updateCheckpoint

public abstract Mono updateCheckpoint(Checkpoint checkpoint)

Updates the checkpoint in the data store for a partition.

Parameters:

checkpoint - Checkpoint information containing sequence number and offset to be stored for this partition.

Returns:

A Mono that completes when the checkpoint is updated.

Applies to