Class CaseInsensitivePersistentStore<V>

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

public class CaseInsensitivePersistentStore<V> extends Object implements PersistentStore<V>
Wrapper around PersistentStore to ensure all passed keys are converted to lower case and stored this way. This will ensure case-insensitivity during insert, update, deletion or search.
  • Constructor Details

    • CaseInsensitivePersistentStore

      public CaseInsensitivePersistentStore(PersistentStore<V> underlyingStore)
  • Method Details

    • 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
    • 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
    • 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
    • getAll

      public Iterator<Map.Entry<String,V>> getAll()
      Description copied from interface: PersistentStore
      Returns an iterator of entries.
      Specified by:
      getAll in interface PersistentStore<V>
    • 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