public class CoordinatorStateDAO extends Object
CoordinatorState from
the CoordinatorState DDB table.| Constructor and Description |
|---|
CoordinatorStateDAO(software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient dynamoDbAsyncClient,
CoordinatorConfig.CoordinatorStateTableConfig config) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
createCoordinatorStateIfNotExists(CoordinatorState state)
Create a new
CoordinatorState if it does not exist. |
CoordinatorState |
getCoordinatorState(@NonNull String key) |
com.amazonaws.services.dynamodbv2.AmazonDynamoDBLockClientOptions.AmazonDynamoDBLockClientOptionsBuilder |
getDDBLockClientOptionsBuilder() |
void |
initialize() |
List<CoordinatorState> |
listCoordinatorState()
List all the
CoordinatorState from the DDB table synchronously |
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 CoordinatorStateDAO(software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient dynamoDbAsyncClient,
CoordinatorConfig.CoordinatorStateTableConfig config)
public 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 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 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 wayCopyright © 2024. All rights reserved.