Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CheckpointManager

Package version

interface

CheckpointManager If you wish to have EventProcessorHost store checkpoints somewhere other than Azure Storage, you can write your own checkpoint manager using this interface.

The Azure Storage managers use the same storage for both lease and checkpoints, so both the interfaces are implemented by the same class. You are free to do the same thing if you have a unified store for both types of data.

This interface does not specify initialization methods because we have no way of knowing what information your implementation will require.

Hierarchy

  • CheckpointManager

Index

Methods

checkpointStoreExists

  • checkpointStoreExists(): Promise<boolean>
  • Does the checkpoint store exist?

    Returns Promise<boolean>

    Promise true if it exists, false if it does not exist.

createAllCheckpointsIfNotExists

  • createAllCheckpointsIfNotExists(partitionIds: string[]): Promise<void>
  • Creates the checkpoint HOLDERs for the given partitions. Does nothing for any checkpoint HOLDERs that already exist.

    The semantics of this are complicated because it is possible to use the same store for both leases and checkpoints (the Azure Storage implementation does so) and it is required to have a lease for every partition but it is not required to have a checkpoint for a partition. It is a valid scenario to never use checkpoints at all, so it is important for the store to distinguish between creating the structure(s) that will hold a checkpoint and actually creating a checkpoint (storing an offset/sequence number pair in the structure).

    Parameters

    • partitionIds: string[]

      List of partitions to create checkpoint HOLDERs for.

    Returns Promise<void>

    Promise resolves with undefined; rejects with an Error.

createCheckpointStoreIfNotExists

  • createCheckpointStoreIfNotExists(): Promise<void>
  • Create the checkpoint store if it doesn't exist. Does nothing if it exists.

    Returns Promise<void>

    Promise resolves with undefined; rejects with an Error.

deleteCheckpoint

  • deleteCheckpoint(partitionId: string): Promise<void>
  • Delete the stored checkpoint for the given partition. If there is no stored checkpoint for the given partition, that is treated as success. Deleting the checkpoint HOLDER is allowed but not required; your implementation is free to do whichever is more convenient.

    Parameters

    • partitionId: string

      The partitionId to delete the checkpoint from the store.

    Returns Promise<void>

    Promise resolves with undefined; rejects with an Error.

deleteCheckpointStore

  • deleteCheckpointStore(): Promise<void>
  • Deletes the checkpoint store.

    Returns Promise<void>

    Promise resolves with undefined; rejects with an Error.

getCheckpoint

  • getCheckpoint(partitionId: string): Promise<CheckpointInfo | undefined>
  • Gets the checkpoint info associated with the given partition. Could return undefined if no checkpoint has been created for that partition.

    Parameters

    • partitionId: string

      The partitionId to get the checkpoint info for.

    Returns Promise<CheckpointInfo | undefined>

    Promise<CheckpointInfo | undefined> Checkpoint info for the given partition, or undefined if none has been previously stored.

updateCheckpoint

  • Update the checkpoint in the store with the offset/sequenceNumber in the provided checkpoint.

    Parameters

    • lease: CompleteLease

      Partition information against which to perform a checkpoint.

    • checkpoint: CheckpointInfo

      offset/sequeceNumber to update the store with

    Returns Promise<void>

    Promise resolves with undefined; rejects with an Error.

Generated using TypeDoc