public class Lease extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
Lease(Lease lease)
Copy constructor, used by clone().
|
|
Lease(String leaseKey,
String leaseOwner,
Long leaseCounter,
UUID concurrencyToken,
Long lastCounterIncrementNanos,
ExtendedSequenceNumber checkpoint,
ExtendedSequenceNumber pendingCheckpoint,
Long ownerSwitchesSinceCheckpoint,
Set<String> parentShardIds)
Deprecated.
|
|
Lease(String leaseKey,
String leaseOwner,
Long leaseCounter,
UUID concurrencyToken,
Long lastCounterIncrementNanos,
ExtendedSequenceNumber checkpoint,
ExtendedSequenceNumber pendingCheckpoint,
Long ownerSwitchesSinceCheckpoint,
Set<String> parentShardIds,
Set<String> childShardIds,
byte[] pendingCheckpointState,
HashKeyRangeForLease hashKeyRangeForLease) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkpoint(ExtendedSequenceNumber checkpoint)
Sets checkpoint.
|
void |
childShardIds(Collection<String> childShardIds)
Sets childShardIds.
|
void |
concurrencyToken(UUID concurrencyToken)
Sets concurrencyToken.
|
Lease |
copy()
Returns a deep copy of this object.
|
void |
hashKeyRange(HashKeyRangeForLease hashKeyRangeForLease)
Set the hash range key for this shard.
|
boolean |
isExpired(long leaseDurationNanos,
long asOfNanos) |
void |
lastCounterIncrementNanos(Long lastCounterIncrementNanos)
Sets lastCounterIncrementNanos
|
void |
leaseCounter(Long leaseCounter)
Sets leaseCounter.
|
void |
leaseKey(String leaseKey)
Sets leaseKey.
|
void |
leaseOwner(String leaseOwner)
Sets leaseOwner.
|
void |
ownerSwitchesSinceCheckpoint(Long ownerSwitchesSinceCheckpoint)
Sets ownerSwitchesSinceCheckpoint.
|
Set<String> |
parentShardIds() |
void |
parentShardIds(Collection<String> parentShardIds)
Sets parentShardIds.
|
void |
pendingCheckpoint(ExtendedSequenceNumber pendingCheckpoint)
Sets pending checkpoint.
|
void |
pendingCheckpointState(byte[] pendingCheckpointState)
Sets pending checkpoint state.
|
void |
update(Lease lease)
Updates this Lease's mutable, application-specific fields based on the passed-in lease object.
|
protected Lease(Lease lease)
lease - lease to copy@Deprecated public Lease(String leaseKey, String leaseOwner, Long leaseCounter, UUID concurrencyToken, Long lastCounterIncrementNanos, ExtendedSequenceNumber checkpoint, ExtendedSequenceNumber pendingCheckpoint, Long ownerSwitchesSinceCheckpoint, Set<String> parentShardIds)
public Lease(String leaseKey, String leaseOwner, Long leaseCounter, UUID concurrencyToken, Long lastCounterIncrementNanos, ExtendedSequenceNumber checkpoint, ExtendedSequenceNumber pendingCheckpoint, Long ownerSwitchesSinceCheckpoint, Set<String> parentShardIds, Set<String> childShardIds, byte[] pendingCheckpointState, HashKeyRangeForLease hashKeyRangeForLease)
public Set<String> parentShardIds()
public void update(Lease lease)
lease - public boolean isExpired(long leaseDurationNanos,
long asOfNanos)
leaseDurationNanos - duration of lease in nanosecondsasOfNanos - time in nanoseconds to check expiration as-ofpublic void lastCounterIncrementNanos(Long lastCounterIncrementNanos)
lastCounterIncrementNanos - last renewal in nanoseconds since the epochpublic void concurrencyToken(@NonNull
UUID concurrencyToken)
concurrencyToken - may not be nullpublic void leaseKey(@NonNull
String leaseKey)
leaseKey - may not be null.public void leaseCounter(@NonNull
Long leaseCounter)
leaseCounter - may not be nullpublic void checkpoint(@NonNull
ExtendedSequenceNumber checkpoint)
checkpoint - may not be nullpublic void pendingCheckpoint(ExtendedSequenceNumber pendingCheckpoint)
pendingCheckpoint - can be nullpublic void pendingCheckpointState(byte[] pendingCheckpointState)
pendingCheckpointState - can be nullpublic void ownerSwitchesSinceCheckpoint(@NonNull
Long ownerSwitchesSinceCheckpoint)
ownerSwitchesSinceCheckpoint - may not be nullpublic void parentShardIds(@NonNull
Collection<String> parentShardIds)
parentShardIds - may not be nullpublic void childShardIds(@NonNull
Collection<String> childShardIds)
childShardIds - may not be nullpublic void hashKeyRange(HashKeyRangeForLease hashKeyRangeForLease)
hashKeyRangeForLease - public void leaseOwner(String leaseOwner)
leaseOwner - may be null.public Lease copy()
Copyright © 2021. All rights reserved.