Class ZookeeperStore

java.lang.Object
me.ahoo.cosid.store.zookeeper.ZookeeperStore
All Implemented Interfaces:
AutoCloseable, me.ahoo.cosid.store.Store

public final class ZookeeperStore extends Object implements 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

    Constructors
    Constructor
    Description
    ZookeeperStore(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

    Modifier and Type
    Method
    Description
    void
     
    me.ahoo.cosid.segment.RangeStore
    The range store; closing it does nothing, close the store instead.
    me.ahoo.cosid.lease.SlotLeaseStore
    The slot lease store; closing it does nothing, close the store instead.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ZookeeperStore

      public ZookeeperStore(org.apache.curator.framework.CuratorFramework client, Duration timeout)
      A store on a client the caller owns and closes; the client must be started.
      Parameters:
      client - the Curator client
      timeout - 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:
      ranges in interface me.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:
      slots in interface me.ahoo.cosid.store.Store
      Returns:
      the slot lease store
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface me.ahoo.cosid.store.Store