Class LocalPersistentStore<V>
java.lang.Object
org.apache.drill.exec.store.sys.BasePersistentStore<V>
org.apache.drill.exec.store.sys.store.LocalPersistentStore<V>
- Type Parameters:
V- store data type
- All Implemented Interfaces:
AutoCloseable,PersistentStore<V>,Store<V>
Local persistent store stores its data on the given file system.
Data is stored in the files with key name as a base and
ExecConstants.DRILL_SYS_FILE_SUFFIX suffix.-
Constructor Summary
ConstructorsConstructorDescriptionLocalPersistentStore(DrillFileSystem fs, org.apache.hadoop.fs.Path base, PersistentStoreConfig<V> config) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanChecks if lookup key is present in store.voidRemoves the value corresponding to the given key if exists, nothing happens otherwise.Returns the value for the given key if exists, null otherwise.static DrillFileSystemgetFileSystem(DrillConfig config, org.apache.hadoop.fs.Path root) static org.apache.hadoop.fs.PathgetMode()Returns storagemodeof this store.getRange(int skip, int take) Returns an iterator of desired number of entries offsetting by the skip value.voidStores the (key, value) tuple in the store.booleanputIfAbsent(String key, V value) Stores the (key, value) tuple in the store only if it does not exists.Methods inherited from class org.apache.drill.exec.store.sys.BasePersistentStore
getAll
-
Constructor Details
-
LocalPersistentStore
public LocalPersistentStore(DrillFileSystem fs, org.apache.hadoop.fs.Path base, PersistentStoreConfig<V> config)
-
-
Method Details
-
getMode
Description copied from interface:StoreReturns storagemodeof this store. -
getLogDir
public static org.apache.hadoop.fs.Path getLogDir() -
getFileSystem
public static DrillFileSystem getFileSystem(DrillConfig config, org.apache.hadoop.fs.Path root) throws IOException - Throws:
IOException
-
getRange
Description copied from interface:StoreReturns an iterator of desired number of entries offsetting by the skip value.- Parameters:
skip- number of records to skip from beginningtake- max number of records to return
-
contains
Description copied from interface:PersistentStoreChecks if lookup key is present in store.- Parameters:
key- lookup key- Returns:
- true if store contains lookup key, false otherwise
-
get
Description copied from interface:PersistentStoreReturns the value for the given key if exists, null otherwise.- Parameters:
key- lookup key
-
put
Description copied from interface:PersistentStoreStores the (key, value) tuple in the store. Lifetime of the tuple depends upon storemode.- Parameters:
key- lookup keyvalue- value to store
-
putIfAbsent
Description copied from interface:StoreStores the (key, value) tuple in the store only if it does not exists.- Parameters:
key- lookup keyvalue- value to store- Returns:
- true if put takes place, false otherwise.
-
delete
Description copied from interface:StoreRemoves the value corresponding to the given key if exists, nothing happens otherwise.- Parameters:
key- lookup key
-
close
public void close()
-