Package io.deephaven.kv.etcd.lease
Class DeephavenLeaseImpl
java.lang.Object
io.deephaven.kv.etcd.lease.DeephavenLeaseImpl
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable,DeephavenLease
Basic implementation of DeephavenLease interface
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDeephavenLeaseImpl(long leaseId, @NotNull String dataIdentifier) protectedDeephavenLeaseImpl(long leaseId, @NotNull String dataIdentifier, int leaseTtlSeconds, int leaseRenewSeconds, int leaseRenewRetryDelaySeconds) -
Method Summary
Modifier and TypeMethodDescriptioncom.fishlib.base.log.LogOutputappend(@NotNull com.fishlib.base.log.LogOutput logOutput) @NotNull StringReturns the identifier used to store data.longReturns a long value identifying the granted lease.intReturns the maximum frequency in seconds should be used to renew a lease.intReturns how often, in seconds, should the lease be renewed This must be less thanDeephavenLease.getLeaseTtlSeconds(); for safety it should be no more than 50% of the TTL value.intReturns the Time to live of the lease in seconds.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.deephaven.kv.etcd.lease.DeephavenLease
renew, revoke
-
Constructor Details
-
DeephavenLeaseImpl
-
DeephavenLeaseImpl
protected DeephavenLeaseImpl(long leaseId, @NotNull @NotNull String dataIdentifier, int leaseTtlSeconds, int leaseRenewSeconds, int leaseRenewRetryDelaySeconds)
-
-
Method Details
-
getLeaseId
public long getLeaseId()Description copied from interface:DeephavenLeaseReturns a long value identifying the granted lease.- Specified by:
getLeaseIdin interfaceDeephavenLease
-
getDataIdentifier
Description copied from interface:DeephavenLeaseReturns the identifier used to store data.- Specified by:
getDataIdentifierin interfaceDeephavenLease
-
getLeaseTtlSeconds
public int getLeaseTtlSeconds()Description copied from interface:DeephavenLeaseReturns the Time to live of the lease in seconds. This is the time the lease will be active from the start or from the time it was last renewed. If not renewed within this timeframe backing store will automatically revoke the lease.- Specified by:
getLeaseTtlSecondsin interfaceDeephavenLease
-
getLeaseRenewSeconds
public int getLeaseRenewSeconds()Description copied from interface:DeephavenLeaseReturns how often, in seconds, should the lease be renewed This must be less thanDeephavenLease.getLeaseTtlSeconds(); for safety it should be no more than 50% of the TTL value.- Specified by:
getLeaseRenewSecondsin interfaceDeephavenLease
-
getLeaseRenewRetryDelaySeconds
public int getLeaseRenewRetryDelaySeconds()Description copied from interface:DeephavenLeaseReturns the maximum frequency in seconds should be used to renew a lease. If a lease renewal times out, then try again more quickly than the standardDeephavenLease.getLeaseRenewSeconds();.- Specified by:
getLeaseRenewRetryDelaySecondsin interfaceDeephavenLease
-
toString
-
append
public com.fishlib.base.log.LogOutput append(@NotNull @NotNull com.fishlib.base.log.LogOutput logOutput) - Specified by:
appendin interfacecom.fishlib.base.log.LogOutputAppendable
-