Included in the com.ibm.etcd.client.utils
package.
RangeCache
PersistentLeaseKey
EtcdLeaderElection
Auto-updated write-through lock-free cache for etcd3, supporting atomic compare-and-set updates. Provides local sequential consistency between writes and reads, similar to the happens-before guarantee of a java ConcurrentHashMap
.
Etcd key-value bound to a PersistentLease. If the key already exists its value won't be changed but it will be associated with the provided lease. If it doesn't already exist or is deleted by someone else, it will be (re)-created with a provided default value. Closing the PersistentLeaseKey will always delete the associated key-value.
Etcd-based leader election pattern. Supports attachment of listeners for notification of leadership change, and an "observer" mode where leadership can be monitored without participating in the election.
PersistentLeaseKey
and RangeCache
can be used together for service registration and discovery.