Package me.ahoo.cosid.store.zookeeper
Class ZookeeperStore
java.lang.Object
me.ahoo.cosid.store.zookeeper.ZookeeperStore
- All Implemented Interfaces:
AutoCloseable,me.ahoo.cosid.store.Store
The ZooKeeper store (06-stores.md ยง2.4): ranges under
/cosid/range, slot leases under /cosid/slot, on a
started CuratorFramework. Every operation is bounded by the timeout as a whole, since Curator has no
per-operation timeout. Closing it closes the client only when the store owns it.
Requires ZooKeeper 3.8 or later on the server (D27); 3.9 is the primary target, the version Curator is aligned
with. Acquire relies on read-only multi (ZooKeeper 3.6+).
-
Constructor Summary
ConstructorsConstructorDescriptionZookeeperStore(org.apache.curator.framework.CuratorFramework client, Duration timeout) A store on a client the caller owns and closes; the client must be started. -
Method Summary
-
Constructor Details
-
ZookeeperStore
A store on a client the caller owns and closes; the client must be started.- Parameters:
client- the Curator clienttimeout- the bound of every store operation
-
-
Method Details
-
ranges
public me.ahoo.cosid.segment.RangeStore ranges()The range store; closing it does nothing, close the store instead.- Specified by:
rangesin interfaceme.ahoo.cosid.store.Store- Returns:
- the range store
-
slots
public me.ahoo.cosid.lease.SlotLeaseStore slots()The slot lease store; closing it does nothing, close the store instead.- Specified by:
slotsin interfaceme.ahoo.cosid.store.Store- Returns:
- the slot lease store
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceme.ahoo.cosid.store.Store
-