Class UndefinedVersionDelegatingStore<V>

java.lang.Object
org.apache.drill.exec.store.sys.store.UndefinedVersionDelegatingStore<V>
Type Parameters:
V - store value type
All Implemented Interfaces:
AutoCloseable, Store<V>, VersionedPersistentStore<V>

public class UndefinedVersionDelegatingStore<V> extends Object implements VersionedPersistentStore<V>
Wrapper store that delegates operations to PersistentStore. Does not keep versioning and returns DataChangeVersion.UNDEFINED when version is required.
  • Constructor Details

    • UndefinedVersionDelegatingStore

      public UndefinedVersionDelegatingStore(PersistentStore<V> store)
  • Method Details

    • 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, 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
    • 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
    • getMode

      public PersistentStoreMode getMode()
      Description copied from interface: Store
      Returns storage mode of this store.
      Specified by:
      getMode in interface Store<V>
    • 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
    • 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.
    • 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() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception