Interface PresenceKvLeaseHandler

All Superinterfaces:
LeaseHandler
All Known Implementing Classes:
PresenceKvLeaseHandlerEtcd

public interface PresenceKvLeaseHandler extends LeaseHandler
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.
  • Field Details

  • 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:
      putKv in interface LeaseHandler
      Parameters:
      logWhat - a string to include in logging with any additional useful information regarding the KV
      key - the etcd key for the KV to be written
      value - the String value to write to the KV
      Returns:
      true if the write succeeded, false otherwise.
      Throws:
      IllegalStateException - if the object's close() 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:
      putKvConditional in interface LeaseHandler
      Parameters:
      logWhat - a string to include in logging with any additional useful information regarding the KV
      conditionalKey - the key that have to exist for the put to proceed.
      key - the etcd key for the KV to be written
      value - the String value to write to the KV
      Returns:
      true if the write succeeded, false otherwise.
      Throws:
      IllegalStateException - if the object's close() method has been called.
    • setLeaseRecreationListener