public class DynamoDBCheckpointer extends Object implements Checkpointer
Constructor and Description |
---|
DynamoDBCheckpointer() |
Modifier and Type | Method and Description |
---|---|
ExtendedSequenceNumber |
getCheckpoint(String shardId)
Get the current checkpoint stored for the specified shard.
|
Checkpoint |
getCheckpointObject(String shardId)
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 shardId,
ExtendedSequenceNumber pendingCheckpoint,
String concurrencyToken)
Record intent to checkpoint for a shard.
|
void |
setCheckpoint(String shardId,
ExtendedSequenceNumber checkpointValue,
String concurrencyToken)
Record a checkpoint for a shard (e.g.
|
boolean |
setCheckpoint(String shardId,
ExtendedSequenceNumber checkpoint,
UUID concurrencyToken) |
public void setCheckpoint(String shardId, ExtendedSequenceNumber checkpointValue, String concurrencyToken) throws KinesisClientLibException
Checkpointer
setCheckpoint
in interface Checkpointer
shardId
- 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 shardId) throws KinesisClientLibException
Checkpointer
getCheckpoint
in interface Checkpointer
shardId
- Current checkpoint for this shard is fetchedKinesisClientLibException
- Thrown if we are unable to fetch the checkpointpublic Checkpoint getCheckpointObject(String shardId) throws KinesisClientLibException
Checkpointer
getCheckpointObject
in interface Checkpointer
shardId
- Current checkpoint for this shard is fetchedKinesisClientLibException
- Thrown if we are unable to fetch the checkpointpublic void prepareCheckpoint(String shardId, ExtendedSequenceNumber pendingCheckpoint, String concurrencyToken) throws KinesisClientLibException
Checkpointer
prepareCheckpoint
in interface Checkpointer
shardId
- 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 boolean setCheckpoint(String shardId, 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 © 2019. All rights reserved.