public static class AmazonDynamoDBLockClientOptions.AmazonDynamoDBLockClientOptionsBuilder extends Object
public AmazonDynamoDBLockClientOptions.AmazonDynamoDBLockClientOptionsBuilder withPartitionKeyName(String partitionKeyName)
partitionKeyName - The partition key name. If not specified, the default partition key name of "key" is used.public AmazonDynamoDBLockClientOptions.AmazonDynamoDBLockClientOptionsBuilder withSortKeyName(String sortKeyName)
sortKeyName - The sort key name. If not specified, we assume that the table does not have a sort key defined.public AmazonDynamoDBLockClientOptions.AmazonDynamoDBLockClientOptionsBuilder withOwnerName(String ownerName)
ownerName - The person that is acquiring the lock (for example, box.amazon.com)public AmazonDynamoDBLockClientOptions.AmazonDynamoDBLockClientOptionsBuilder withLeaseDuration(Long leaseDuration)
leaseDuration - The length of time that the lease for the lock will be
granted for. If this is set to, for example, 30 seconds,
then the lock will expire if the heartbeat is not sent for
at least 30 seconds (which would happen if the box or the
heartbeat thread dies, for example.)public AmazonDynamoDBLockClientOptions.AmazonDynamoDBLockClientOptionsBuilder withHeartbeatPeriod(Long heartbeatPeriod)
heartbeatPeriod - How often to update DynamoDB to note that the instance is
still running (recommendation is to make this at least 3
times smaller than the leaseDuration -- for example
heartBeatPeriod=1 second, leaseDuration=10 seconds could
be a reasonable configuration, make sure to include a
buffer for network latency.)public AmazonDynamoDBLockClientOptions.AmazonDynamoDBLockClientOptionsBuilder withTimeUnit(TimeUnit timeUnit)
timeUnit - What time unit to use for all times in this object, including
heartbeatPeriod and leaseDuration.public AmazonDynamoDBLockClientOptions.AmazonDynamoDBLockClientOptionsBuilder withCreateHeartbeatBackgroundThread(Boolean createHeartbeatBackgroundThread)
createHeartbeatBackgroundThread - Whether or not to create a thread to automatically
heartbeat (if false, you must call sendHeartbeat manually)public AmazonDynamoDBLockClientOptions.AmazonDynamoDBLockClientOptionsBuilder withHoldLockOnServiceUnavailable(Boolean holdLockOnServiceUnavailable)
holdLockOnServiceUnavailable - Whether or not to hold the lock if DynamoDB Service is unavailablepublic AmazonDynamoDBLockClientOptions build()
Copyright © 2013–2023. All rights reserved.