Class ZkEphemeralStore<V>

java.lang.Object
org.apache.drill.exec.coord.store.BaseTransientStore<V>
org.apache.drill.exec.coord.zk.ZkEphemeralStore<V>
All Implemented Interfaces:
AutoCloseable, TransientStore<V>

public class ZkEphemeralStore<V> extends BaseTransientStore<V>
  • Field Details

    • dispatcher

      protected final org.apache.curator.framework.recipes.cache.PathChildrenCacheListener dispatcher
  • Constructor Details

    • ZkEphemeralStore

      public ZkEphemeralStore(TransientStoreConfig<V> config, org.apache.curator.framework.CuratorFramework curator)
  • Method Details

    • start

      public void start() throws Exception
      Throws:
      Exception
    • getClient

      protected ZookeeperClient getClient()
    • get

      public V get(String key)
      Description copied from interface: TransientStore
      Returns a value corresponding to the given look-up key if exists, null otherwise.
      Parameters:
      key - look-up key
    • put

      public V put(String key, V value)
      Description copied from interface: TransientStore
      Stores the given (key, value) in this store overriding the existing value.
      Parameters:
      key - look-up key
      value - value to store
      Returns:
      the old value if the key exists, null otherwise
    • putIfAbsent

      public V putIfAbsent(String key, V value)
      Description copied from interface: TransientStore
      Stores the given (key, value) tuple in this store only if it does not exists.
      Parameters:
      key - look-up key
      value - value to store
      Returns:
      the old value if the key exists, null otherwise
    • remove

      public V remove(String key)
      Description copied from interface: TransientStore
      Removes the (key, value) tuple from this store if the key exists.
      Parameters:
      key - look-up key
      Returns:
      the removed value if key exists, null otherwise
    • entries

      public Iterator<Map.Entry<String,V>> entries()
      Description copied from interface: TransientStore
      Returns an iterator of (key, value) tuples.
    • size

      public int size()
      Description copied from interface: TransientStore
      Returns number of entries.
    • close

      public void close() throws Exception
      Throws:
      Exception
    • fireListeners

      protected void fireListeners(TransientStoreEvent event)
      This method override ensures package level method visibility.
      Overrides:
      fireListeners in class BaseTransientStore<V>