Interface PresenceKvLeaseHandler
- All Superinterfaces:
LeaseHandler
- All Known Implementing Classes:
PresenceKvLeaseHandlerEtcd
A PresenceLeaseHandler handles a single etcd lease and one or more "presence" KVs created with and associated to that
lease, for the purposes of proving presence to one or more client processes; typically one presence KV is associated
with one client process.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interfaceCallbacks invoked when the lease handler must recreate lease and KVs, if our existing lease is lost. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PresenceKvLeaseHandlerstatic final PresenceKvLeaseHandler.Factory -
Method Summary
Modifier and TypeMethodDescriptionbooleanWrite a string value to the presence KV associated to our lease.booleanputKvConditional(String logWhat, io.deephaven.shadow.jetcd.io.etcd.jetcd.ByteSequence conditionalKey, io.deephaven.shadow.jetcd.io.etcd.jetcd.ByteSequence key, String value) Write a string value to the presence KV associated to our lease, conditional to a given key already existing.Methods inherited from interface io.deephaven.enterprise.etcdclient.lease.LeaseHandler
close, closeWithoutRevokingLease, deleteKv, isClosed
-
Field Details
-
NULL
-
NULL_FACTORY
-
-
Method Details
-
putKv
boolean putKv(String logWhat, io.deephaven.shadow.jetcd.io.etcd.jetcd.ByteSequence key, String value) Write a string value to the presence KV associated to our lease.
If the write attempt in etcd results in a failure indicating our lease is lost, this method may try to re-create the lease and the associated KVs with cooperation from the callback registered in this object.
- Specified by:
putKvin interfaceLeaseHandler- Parameters:
logWhat- a string to include in logging with any additional useful information regarding the KVkey- the etcd key for the KV to be writtenvalue- the String value to write to the KV- Returns:
- true if the write succeeded, false otherwise.
- Throws:
IllegalStateException- if the object'sclose()method has been called.
-
putKvConditional
boolean putKvConditional(String logWhat, io.deephaven.shadow.jetcd.io.etcd.jetcd.ByteSequence conditionalKey, io.deephaven.shadow.jetcd.io.etcd.jetcd.ByteSequence key, String value) Write a string value to the presence KV associated to our lease, conditional to a given key already existing.
If the write attempt in etcd results in a failure indicating our lease is lost, this method may try to re-create the lease and the associated KVs with cooperation from the callback registered in this object.
- Specified by:
putKvConditionalin interfaceLeaseHandler- Parameters:
logWhat- a string to include in logging with any additional useful information regarding the KVconditionalKey- the key that have to exist for the put to proceed.key- the etcd key for the KV to be writtenvalue- the String value to write to the KV- Returns:
- true if the write succeeded, false otherwise.
- Throws:
IllegalStateException- if the object'sclose()method has been called.
-
setLeaseRecreationListener
PresenceKvLeaseHandler.LeaseRecreationListener setLeaseRecreationListener(PresenceKvLeaseHandler.LeaseRecreationListener listener)
-