Class MongoPersistentStore<V>

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

public class MongoPersistentStore<V> extends BasePersistentStore<V>
  • Constructor Details

    • MongoPersistentStore

      public MongoPersistentStore(PersistentStoreConfig<V> config, com.mongodb.client.MongoCollection<org.bson.Document> collection)
  • Method Details

    • getMode

      public PersistentStoreMode getMode()
      Description copied from interface: Store
      Returns storage mode of this store.
    • contains

      public boolean contains(String key)
      Description copied from interface: PersistentStore
      Checks if lookup key is present in store.
      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.
      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.
      Parameters:
      key - lookup key
      value - value to store
    • 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.
      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.
      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.
      Parameters:
      skip - number of records to skip from beginning
      take - max number of records to return
    • close

      public void close()