Class MapBackedStore<V>
java.lang.Object
org.apache.drill.exec.coord.store.BaseTransientStore<V>
org.apache.drill.exec.coord.local.MapBackedStore<V>
- All Implemented Interfaces:
AutoCloseable
,TransientStore<V>
-
Field Summary
Fields inherited from class org.apache.drill.exec.coord.store.BaseTransientStore
config
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
entries()
Returns an iterator of (key, value) tuples.Returns a value corresponding to the given look-up key if exists, null otherwise.Stores the given (key, value) in this store overriding the existing value.putIfAbsent
(String key, V value) Stores the given (key, value) tuple in this store only if it does not exists.Removes the (key, value) tuple from this store if the key exists.int
size()
Returns number of entries.Methods inherited from class org.apache.drill.exec.coord.store.BaseTransientStore
addListener, fireListeners, getConfig, keys, removeListener, values
-
Constructor Details
-
MapBackedStore
-
-
Method Details
-
get
Description copied from interface:TransientStore
Returns a value corresponding to the given look-up key if exists, null otherwise.- Parameters:
key
- look-up key
-
put
Description copied from interface:TransientStore
Stores the given (key, value) in this store overriding the existing value.- Parameters:
key
- look-up keyvalue
- value to store- Returns:
- the old value if the key exists, null otherwise
-
putIfAbsent
Description copied from interface:TransientStore
Stores the given (key, value) tuple in this store only if it does not exists.- Parameters:
key
- look-up keyvalue
- value to store- Returns:
- the old value if the key exists, null otherwise
-
remove
Description copied from interface:TransientStore
Removes the (key, value) tuple from this store if the key exists.- Parameters:
key
- look-up key- Returns:
- the removed value if key exists, null otherwise
-
entries
Description copied from interface:TransientStore
Returns an iterator of (key, value) tuples. -
size
public int size()Description copied from interface:TransientStore
Returns number of entries. -
close
- Throws:
Exception
-