public class KinesisClientLeaseManager extends LeaseManager<KinesisClientLease> implements IKinesisClientLeaseManager
consistentReads, dynamoDBClient, serializer, table| Constructor and Description |
|---|
KinesisClientLeaseManager(java.lang.String table,
AmazonDynamoDB dynamoDBClient)
Constructor.
|
KinesisClientLeaseManager(java.lang.String table,
AmazonDynamoDB dynamoDBClient,
boolean consistentReads)
Constructor for integration tests - see comment on superclass for documentation on setting the consistentReads
flag.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCheckpoint(java.lang.String shardId)
Gets the current checkpoint of the shard.
|
boolean |
takeLease(KinesisClientLease lease,
java.lang.String newOwner)
Take a lease for the given owner by incrementing its leaseCounter and setting its owner field.
|
convertAndRethrowExceptions, createLeaseIfNotExists, createLeaseTableIfNotExists, deleteAll, deleteLease, evictLease, getLease, leaseTableExists, listLeases, renewLease, updateLease, waitUntilLeaseTableExistsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateLeaseIfNotExists, createLeaseTableIfNotExists, deleteAll, deleteLease, evictLease, getLease, leaseTableExists, listLeases, renewLease, updateLease, waitUntilLeaseTableExistspublic KinesisClientLeaseManager(java.lang.String table,
AmazonDynamoDB dynamoDBClient)
table - Leases tabledynamoDBClient - DynamoDB client to usepublic KinesisClientLeaseManager(java.lang.String table,
AmazonDynamoDB dynamoDBClient,
boolean consistentReads)
table - leases tabledynamoDBClient - DynamoDB client to useconsistentReads - true if we want consistent reads for testing purposes.public boolean takeLease(KinesisClientLease lease, java.lang.String newOwner) throws DependencyException, InvalidStateException, ProvisionedThroughputException
takeLease in interface ILeaseManager<KinesisClientLease>takeLease in class LeaseManager<KinesisClientLease>lease - the lease to takenewOwner - the new ownerDependencyException - if DynamoDB update fails in an unexpected wayInvalidStateException - if lease table does not existProvisionedThroughputException - if DynamoDB update fails due to lack of capacitypublic java.lang.String getCheckpoint(java.lang.String shardId)
throws ProvisionedThroughputException,
InvalidStateException,
DependencyException
getCheckpoint in interface IKinesisClientLeaseManagershardId - Checkpoint of this shard will be returnedProvisionedThroughputException - if DynamoDB update fails due to lack of capacityInvalidStateException - if lease table does not existDependencyException - if DynamoDB update fails in an unexpected way