public class LocalPersistentStore<V> extends BasePersistentStore<V>
| Constructor and Description |
|---|
LocalPersistentStore(DrillFileSystem fs,
org.apache.hadoop.fs.Path base,
PersistentStoreConfig<V> config) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
contains(String key)
Checks if lookup key is present in store.
|
boolean |
contains(String key,
DataChangeVersion dataChangeVersion)
By default contains with version will behave the same way as without version.
|
void |
delete(String key)
Removes the value corresponding to the given key if exists, nothing happens otherwise.
|
V |
get(String key)
Returns the value for the given key if exists, null otherwise.
|
V |
get(String key,
DataChangeVersion dataChangeVersion)
By default get with version will behave the same way as without version.
|
static DrillFileSystem |
getFileSystem(DrillConfig config,
org.apache.hadoop.fs.Path root) |
static org.apache.hadoop.fs.Path |
getLogDir() |
PersistentStoreMode |
getMode()
Returns storage
mode of this store. |
Iterator<Map.Entry<String,V>> |
getRange(int skip,
int take)
Returns an iterator of desired number of entries offsetting by the skip value.
|
void |
put(String key,
V value)
Stores the (key, value) tuple in the store.
|
void |
put(String key,
V value,
DataChangeVersion dataChangeVersion)
By default put with version will behave the same way as without version.
|
boolean |
putIfAbsent(String key,
V value)
Stores the (key, value) tuple in the store only if it does not exists.
|
getAllpublic LocalPersistentStore(DrillFileSystem fs, org.apache.hadoop.fs.Path base, PersistentStoreConfig<V> config)
public PersistentStoreMode getMode()
PersistentStoremode of this store.public static org.apache.hadoop.fs.Path getLogDir()
public static DrillFileSystem getFileSystem(DrillConfig config, org.apache.hadoop.fs.Path root) throws IOException
IOExceptionpublic Iterator<Map.Entry<String,V>> getRange(int skip, int take)
PersistentStoreskip - number of records to skip from beginningtake - max number of records to returnpublic boolean contains(String key)
PersistentStorekey - lookup keypublic boolean contains(String key, DataChangeVersion dataChangeVersion)
BasePersistentStorecontains in interface PersistentStore<V>contains in class BasePersistentStore<V>key - lookup keydataChangeVersion - version holderpublic V get(String key)
PersistentStorekey - lookup keypublic V get(String key, DataChangeVersion dataChangeVersion)
BasePersistentStoreget in interface PersistentStore<V>get in class BasePersistentStore<V>key - lookup keydataChangeVersion - version holderpublic void put(String key, V value)
PersistentStoremode.key - lookup keyvalue - value to storepublic void put(String key, V value, DataChangeVersion dataChangeVersion)
BasePersistentStoreput in interface PersistentStore<V>put in class BasePersistentStore<V>key - lookup keyvalue - value to storedataChangeVersion - version holderpublic boolean putIfAbsent(String key, V value)
PersistentStorekey - lookup keyvalue - value to storepublic void delete(String key)
PersistentStorekey - lookup keypublic void close()
Copyright © 2017 The Apache Software Foundation. All rights reserved.