public abstract class CoordinatorStateDAODelegate extends Object
CoordinatorState from
the DDB table it is stored in.| Constructor and Description |
|---|
CoordinatorStateDAODelegate(software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient dynamoDbAsyncClient,
String tableName,
String partitionKeyAttributeName) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
createCoordinatorStateIfNotExists(CoordinatorState state)
Create a new
CoordinatorState if it does not exist. |
software.amazon.awssdk.services.dynamodb.model.TransactWriteItem |
createTransactDelete(@NonNull String key)
Creates a
TransactWriteItem that deletes the entry with the given key
from this delegate's table. |
software.amazon.awssdk.services.dynamodb.model.TransactWriteItem |
createTransactPut(CoordinatorState state)
Creates a
TransactWriteItem that performs a conditional Put (item must not exist)
for the given coordinator state into this delegate's table. |
boolean |
deleteCoordinatorState(@NonNull String key)
Create a new
CoordinatorState if it does not exist. |
CoordinatorState |
fromDynamoRecord(Map<String,software.amazon.awssdk.services.dynamodb.model.AttributeValue> dynamoRecord) |
CoordinatorState |
getCoordinatorState(@NonNull String key) |
com.amazonaws.services.dynamodbv2.AmazonDynamoDBLockClientOptions.AmazonDynamoDBLockClientOptionsBuilder |
getDDBLockClientOptionsBuilder() |
String |
getPartitionKeyAttributeName() |
String |
getTableName() |
abstract void |
initialize() |
List<CoordinatorState> |
listCoordinatorState()
List all the
CoordinatorState from the DDB table synchronously |
List<CoordinatorState> |
listCoordinatorStateByEntityType(EntityType.CoordinatorStateType entityType)
List all the
CoordinatorState from the DDB table synchronously |
Map<String,software.amazon.awssdk.services.dynamodb.model.AttributeValue> |
toTransactRecord(CoordinatorState state)
Converts a
CoordinatorState to its full DDB item representation including the
partition key. |
boolean |
updateCoordinatorStateWithExpectation(@NonNull CoordinatorState state,
Map<String,software.amazon.awssdk.services.dynamodb.model.ExpectedAttributeValue> expectations)
Update fields of the given coordinator state in DynamoDB.
|
public String getTableName()
public String getPartitionKeyAttributeName()
public abstract void initialize()
throws DependencyException
DependencyExceptionpublic com.amazonaws.services.dynamodbv2.AmazonDynamoDBLockClientOptions.AmazonDynamoDBLockClientOptionsBuilder getDDBLockClientOptionsBuilder()
public List<CoordinatorState> listCoordinatorState() throws ProvisionedThroughputException, DependencyException, InvalidStateException
CoordinatorState from the DDB table synchronouslyDependencyException - if DynamoDB scan fails in an unexpected wayInvalidStateException - if ddb table does not existProvisionedThroughputException - if DynamoDB scan fails due to lack of capacitypublic List<CoordinatorState> listCoordinatorStateByEntityType(EntityType.CoordinatorStateType entityType) throws ProvisionedThroughputException, DependencyException, InvalidStateException
CoordinatorState from the DDB table synchronouslyDependencyException - if DynamoDB scan fails in an unexpected wayInvalidStateException - if ddb table does not existProvisionedThroughputException - if DynamoDB scan fails due to lack of capacitypublic boolean createCoordinatorStateIfNotExists(CoordinatorState state) throws DependencyException, InvalidStateException, ProvisionedThroughputException
CoordinatorState if it does not exist.state - the state to createDependencyException - if DynamoDB put fails in an unexpected wayInvalidStateException - if lease table does not existProvisionedThroughputException - if DynamoDB put fails due to lack of capacitypublic CoordinatorState getCoordinatorState(@NonNull @NonNull String key) throws DependencyException, InvalidStateException, ProvisionedThroughputException
key - Get the CoordinatorState for this keyInvalidStateException - if ddb table does not existProvisionedThroughputException - if DynamoDB get fails due to lack of capacityDependencyException - if DynamoDB get fails in an unexpected waypublic boolean deleteCoordinatorState(@NonNull
@NonNull String key)
throws ProvisionedThroughputException,
InvalidStateException,
DependencyException
CoordinatorState if it does not exist.key - the key to deleteDependencyException - if DynamoDB delete fails in an unexpected wayInvalidStateException - if lease table does not existProvisionedThroughputException - if DynamoDB delete fails due to lack of capacitypublic boolean updateCoordinatorStateWithExpectation(@NonNull
@NonNull CoordinatorState state,
Map<String,software.amazon.awssdk.services.dynamodb.model.ExpectedAttributeValue> expectations)
throws DependencyException,
InvalidStateException,
ProvisionedThroughputException
InvalidStateException - if table does not existProvisionedThroughputException - if DynamoDB update fails due to lack of capacityDependencyException - if DynamoDB update fails in an unexpected waypublic CoordinatorState fromDynamoRecord(Map<String,software.amazon.awssdk.services.dynamodb.model.AttributeValue> dynamoRecord)
public Map<String,software.amazon.awssdk.services.dynamodb.model.AttributeValue> toTransactRecord(CoordinatorState state)
CoordinatorState to its full DDB item representation including the
partition key. Public variant of toDynamoRecord(software.amazon.kinesis.coordinator.CoordinatorState) for use in transactional writes
built externally (e.g., conditional Puts with custom condition expressions).public software.amazon.awssdk.services.dynamodb.model.TransactWriteItem createTransactPut(CoordinatorState state)
TransactWriteItem that performs a conditional Put (item must not exist)
for the given coordinator state into this delegate's table.state - the coordinator state to putpublic software.amazon.awssdk.services.dynamodb.model.TransactWriteItem createTransactDelete(@NonNull
@NonNull String key)
TransactWriteItem that deletes the entry with the given key
from this delegate's table.key - the partition key of the entry to deleteCopyright © 2026. All rights reserved.