public class DynamoDBCheckpointer extends Object implements Checkpointer
Constructor and Description |
---|
DynamoDBCheckpointer() |
Modifier and Type | Method and Description |
---|---|
ExtendedSequenceNumber |
getCheckpoint(String leaseKey)
Get the current checkpoint stored for the specified shard.
|
Checkpoint |
getCheckpointObject(String leaseKey)
Get the current checkpoint stored for the specified shard, which holds the sequence numbers for the checkpoint
and pending checkpoint.
|
String |
operation() |
void |
operation(String operation) |
void |
prepareCheckpoint(String leaseKey,
ExtendedSequenceNumber pendingCheckpoint,
String concurrencyToken)
Record intent to checkpoint for a shard.
|
void |
prepareCheckpoint(String leaseKey,
ExtendedSequenceNumber pendingCheckpoint,
String concurrencyToken,
byte[] pendingCheckpointState)
Record intent to checkpoint for a shard.
|
void |
setCheckpoint(String leaseKey,
ExtendedSequenceNumber checkpointValue,
String concurrencyToken)
Record a checkpoint for a shard (e.g.
|
boolean |
setCheckpoint(String leaseKey,
ExtendedSequenceNumber checkpoint,
UUID concurrencyToken) |
public void setCheckpoint(String leaseKey, ExtendedSequenceNumber checkpointValue, String concurrencyToken) throws KinesisClientLibException
Checkpointer
setCheckpoint
in interface Checkpointer
leaseKey
- Checkpoint is specified for this shard.checkpointValue
- Value of the checkpoint (e.g. Kinesis sequence number and subsequence number)concurrencyToken
- Used with conditional writes to prevent stale updates
(e.g. if there was a fail over to a different record processor, we don't want to
overwrite it's checkpoint)KinesisClientLibException
- Thrown if we were unable to save the checkpointpublic ExtendedSequenceNumber getCheckpoint(String leaseKey) throws KinesisClientLibException
Checkpointer
getCheckpoint
in interface Checkpointer
leaseKey
- Current checkpoint for this shard is fetchedKinesisClientLibException
- Thrown if we are unable to fetch the checkpointpublic Checkpoint getCheckpointObject(String leaseKey) throws KinesisClientLibException
Checkpointer
getCheckpointObject
in interface Checkpointer
leaseKey
- Current checkpoint for this shard is fetchedKinesisClientLibException
- Thrown if we are unable to fetch the checkpointpublic void prepareCheckpoint(String leaseKey, ExtendedSequenceNumber pendingCheckpoint, String concurrencyToken) throws KinesisClientLibException
Checkpointer
prepareCheckpoint
in interface Checkpointer
leaseKey
- Checkpoint is specified for this shard.pendingCheckpoint
- Value of the pending checkpoint (e.g. Kinesis sequence number and subsequence number)concurrencyToken
- Used with conditional writes to prevent stale updates
(e.g. if there was a fail over to a different record processor, we don't want to
overwrite it's checkpoint)KinesisClientLibException
- Thrown if we were unable to save the checkpointpublic void prepareCheckpoint(String leaseKey, ExtendedSequenceNumber pendingCheckpoint, String concurrencyToken, byte[] pendingCheckpointState) throws KinesisClientLibException
Checkpointer
prepareCheckpoint
in interface Checkpointer
leaseKey
- Checkpoint is specified for this shard.pendingCheckpoint
- Value of the pending checkpoint (e.g. Kinesis sequence number and subsequence number)concurrencyToken
- Used with conditional writes to prevent stale updates
(e.g. if there was a fail over to a different record processor, we don't want to
overwrite it's checkpoint)pendingCheckpointState
- Serialized application state at the pending checkpoint.KinesisClientLibException
- Thrown if we were unable to save the checkpointpublic boolean setCheckpoint(String leaseKey, ExtendedSequenceNumber checkpoint, UUID concurrencyToken) throws DependencyException, InvalidStateException, ProvisionedThroughputException
public void operation(@NonNull String operation)
operation
in interface Checkpointer
public String operation()
operation
in interface Checkpointer
Copyright © 2021. All rights reserved.