Class VersionedDelegatingStore<V>
java.lang.Object
org.apache.drill.exec.store.sys.store.VersionedDelegatingStore<V>
- Type Parameters:
V- store value type
- All Implemented Interfaces:
AutoCloseable,Store<V>,VersionedPersistentStore<V>
Versioned store that delegates operations to PersistentStore and keeps versioning,
incrementing version each time write / delete operation is triggered.
Once created initial version is 0. Can be used only for local versioning, not distributed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleancontains(String key, DataChangeVersion dataChangeVersion) Checks if lookup key is present in store.voidRemoves the value corresponding to the given key if exists, nothing happens otherwise.get(String key, DataChangeVersion dataChangeVersion) Returns the value for the given key if exists, null otherwise.getMode()Returns storagemodeof this store.getRange(int skip, int take) Returns an iterator of desired number of entries offsetting by the skip value.voidput(String key, V value, DataChangeVersion dataChangeVersion) Stores 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.
-
Constructor Details
-
VersionedDelegatingStore
-
-
Method Details
-
getMode
Description copied from interface:StoreReturns storagemodeof this store. -
delete
Description copied from interface:StoreRemoves the value corresponding to the given key if exists, nothing happens otherwise. -
contains
Description copied from interface:VersionedPersistentStoreChecks if lookup key is present in store. Sets data change version number.- Specified by:
containsin interfaceVersionedPersistentStore<V>- Parameters:
key- lookup keydataChangeVersion- version holder- Returns:
- true if store contains lookup key, false otherwise
-
get
Description copied from interface:VersionedPersistentStoreReturns the value for the given key if exists, null otherwise. Sets data change version number.- Specified by:
getin interfaceVersionedPersistentStore<V>- Parameters:
key- lookup keydataChangeVersion- version holder
-
put
Description copied from interface:VersionedPersistentStoreStores the (key, value) tuple in the store. If tuple already exits, stores it only if versions match, otherwise throwsVersionMismatchExceptionLifetime of the tuple depends upon storemode.- Specified by:
putin interfaceVersionedPersistentStore<V>- Parameters:
key- lookup keyvalue- value to storedataChangeVersion- version holder
-
putIfAbsent
Description copied from interface:StoreStores the (key, value) tuple in the store only if it does not exists.- Specified by:
putIfAbsentin interfaceStore<V>- Parameters:
key- lookup keyvalue- value to store- Returns:
- true if put takes place, false otherwise.
-
getRange
Description copied from interface:StoreReturns an iterator of desired number of entries offsetting by the skip value. -
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-