Class ZookeeperPersistentStore<V>

java.lang.Object
org.apache.drill.exec.store.sys.BasePersistentStore<V>
org.apache.drill.exec.store.sys.store.ZookeeperPersistentStore<V>
All Implemented Interfaces:
AutoCloseable, PersistentStore<V>, Store<V>, VersionedPersistentStore<V>

public class ZookeeperPersistentStore<V> extends BasePersistentStore<V> implements VersionedPersistentStore<V>
Zookeeper based implementation of PersistentStore.
  • Constructor Details

  • Method Details

    • start

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

      public PersistentStoreMode getMode()
      Description copied from interface: Store
      Returns storage mode of this store.
      Specified by:
      getMode in interface Store<V>
    • contains

      public boolean contains(String key)
      Description copied from interface: PersistentStore
      Checks if lookup key is present in store.
      Specified by:
      contains in interface PersistentStore<V>
      Parameters:
      key - lookup key
      Returns:
      true if store contains lookup key, false otherwise
    • contains

      public boolean contains(String key, DataChangeVersion version)
      Description copied from interface: VersionedPersistentStore
      Checks if lookup key is present in store. Sets data change version number.
      Specified by:
      contains in interface VersionedPersistentStore<V>
      Parameters:
      key - lookup key
      version - version holder
      Returns:
      true if store contains lookup key, false otherwise
    • get

      public V get(String key)
      Description copied from interface: PersistentStore
      Returns the value for the given key if exists, null otherwise.
      Specified by:
      get in interface PersistentStore<V>
      Parameters:
      key - lookup key
    • get

      public V get(String key, DataChangeVersion version)
      Description copied from interface: VersionedPersistentStore
      Returns the value for the given key if exists, null otherwise. Sets data change version number.
      Specified by:
      get in interface VersionedPersistentStore<V>
      Parameters:
      key - lookup key
      version - version holder
    • get

      public V get(String key, boolean consistencyFlag, DataChangeVersion version)
    • put

      public void put(String key, V value)
      Description copied from interface: PersistentStore
      Stores the (key, value) tuple in the store. Lifetime of the tuple depends upon store mode.
      Specified by:
      put in interface PersistentStore<V>
      Parameters:
      key - lookup key
      value - value to store
    • put

      public void put(String key, V value, DataChangeVersion version)
      Description copied from interface: VersionedPersistentStore
      Stores the (key, value) tuple in the store. If tuple already exits, stores it only if versions match, otherwise throws VersionMismatchException Lifetime of the tuple depends upon store mode.
      Specified by:
      put in interface VersionedPersistentStore<V>
      Parameters:
      key - lookup key
      value - value to store
      version - version holder
    • putIfAbsent

      public boolean putIfAbsent(String key, V value)
      Description copied from interface: Store
      Stores the (key, value) tuple in the store only if it does not exists.
      Specified by:
      putIfAbsent in interface Store<V>
      Parameters:
      key - lookup key
      value - value to store
      Returns:
      true if put takes place, false otherwise.
    • delete

      public void delete(String key)
      Description copied from interface: Store
      Removes the value corresponding to the given key if exists, nothing happens otherwise.
      Specified by:
      delete in interface Store<V>
      Parameters:
      key - lookup key
    • getRange

      public Iterator<Map.Entry<String,V>> getRange(int skip, int take)
      Description copied from interface: Store
      Returns an iterator of desired number of entries offsetting by the skip value.
      Specified by:
      getRange in interface Store<V>
      Parameters:
      skip - number of records to skip from beginning
      take - max number of records to return
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable