public interface LeaseRenewer
| Modifier and Type | Method and Description |
|---|---|
void |
addLeasesToRenew(Collection<Lease> newLeases)
Adds leases to this LeaseRenewer's set of currently held leases.
|
void |
clearCurrentlyHeldLeases()
Clears this LeaseRenewer's set of currently held leases.
|
void |
dropLease(Lease lease)
Stops the lease renewer from continunig to maintain the given lease.
|
Lease |
getCurrentlyHeldLease(String leaseKey) |
Map<String,Lease> |
getCurrentlyHeldLeases() |
void |
initialize()
Bootstrap initial set of leases from the
LeaseRefresher (e.g. |
void |
renewLeases()
Attempt to renew all currently held leases.
|
boolean |
updateLease(Lease lease,
UUID concurrencyToken,
String operation,
String shardId)
Update application-specific fields in a currently held lease.
|
void initialize()
throws DependencyException,
InvalidStateException,
ProvisionedThroughputException
LeaseRefresher (e.g. upon process restart, pick up leases we own)DependencyException - on unexpected DynamoDB failuresInvalidStateException - if lease table doesn't existProvisionedThroughputException - if DynamoDB reads fail due to insufficient capacityvoid renewLeases()
throws DependencyException,
InvalidStateException
DependencyException - on unexpected DynamoDB failuresInvalidStateException - if lease table does not existMap<String,Lease> getCurrentlyHeldLeases()
Lease getCurrentlyHeldLease(String leaseKey)
leaseKey - key of the lease to retrievevoid addLeasesToRenew(Collection<Lease> newLeases)
newLeases - new leases.void clearCurrentlyHeldLeases()
void dropLease(Lease lease)
lease - the lease to drop.boolean updateLease(Lease lease, UUID concurrencyToken, String operation, String shardId) throws DependencyException, InvalidStateException, ProvisionedThroughputException
lease - lease object containing updated dataconcurrencyToken - obtained by calling Lease.concurrencyToken for a currently held leaseInvalidStateException - if lease table does not existProvisionedThroughputException - if DynamoDB update fails due to lack of capacityDependencyException - if DynamoDB update fails in an unexpected wayCopyright © 2019. All rights reserved.