Class UndefinedVersionDelegatingStore<V>
java.lang.Object
org.apache.drill.exec.store.sys.store.UndefinedVersionDelegatingStore<V>
- Type Parameters:
V
- store value type
- All Implemented Interfaces:
AutoCloseable
,Store<V>
,VersionedPersistentStore<V>
public class UndefinedVersionDelegatingStore<V>
extends Object
implements VersionedPersistentStore<V>
Wrapper store that delegates operations to PersistentStore.
Does not keep versioning and returns
DataChangeVersion.UNDEFINED
when version is required.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
boolean
contains
(String key, DataChangeVersion version) Checks if lookup key is present in store.void
Removes the value corresponding to the given key if exists, nothing happens otherwise.get
(String key, DataChangeVersion version) Returns the value for the given key if exists, null otherwise.getMode()
Returns storagemode
of this store.getRange
(int skip, int take) Returns an iterator of desired number of entries offsetting by the skip value.void
put
(String key, V value, DataChangeVersion version) Stores the (key, value) tuple in the store.boolean
putIfAbsent
(String key, V value) Stores the (key, value) tuple in the store only if it does not exists.
-
Constructor Details
-
UndefinedVersionDelegatingStore
-
-
Method Details
-
contains
Description copied from interface:VersionedPersistentStore
Checks if lookup key is present in store. Sets data change version number.- Specified by:
contains
in interfaceVersionedPersistentStore<V>
- Parameters:
key
- lookup keyversion
- version holder- Returns:
- true if store contains lookup key, false otherwise
-
get
Description copied from interface:VersionedPersistentStore
Returns the value for the given key if exists, null otherwise. Sets data change version number.- Specified by:
get
in interfaceVersionedPersistentStore<V>
- Parameters:
key
- lookup keyversion
- version holder
-
put
Description copied from interface:VersionedPersistentStore
Stores the (key, value) tuple in the store. If tuple already exits, stores it only if versions match, otherwise throwsVersionMismatchException
Lifetime of the tuple depends upon storemode
.- Specified by:
put
in interfaceVersionedPersistentStore<V>
- Parameters:
key
- lookup keyvalue
- value to storeversion
- version holder
-
getMode
Description copied from interface:Store
Returns storagemode
of this store. -
delete
Description copied from interface:Store
Removes the value corresponding to the given key if exists, nothing happens otherwise. -
putIfAbsent
Description copied from interface:Store
Stores the (key, value) tuple in the store only if it does not exists.- Specified by:
putIfAbsent
in interfaceStore<V>
- Parameters:
key
- lookup keyvalue
- value to store- Returns:
- true if put takes place, false otherwise.
-
getRange
Description copied from interface:Store
Returns an iterator of desired number of entries offsetting by the skip value. -
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-