Package io.permazen.kv.mvstore
Class MVStoreKVDatabase
java.lang.Object
io.permazen.kv.mvcc.SnapshotKVDatabase
io.permazen.kv.mvstore.MVStoreKVDatabase
- All Implemented Interfaces:
KVDatabase
KVDatabase
implementation based on a MVStoreAtomicKVStore
, providing concurrent transactions
and linearizable ACID semantics.
Note that this implementation does not use MVStore
's built-in transaction managagement. Instead,
MVStoreKVDatabase
derives all of its transaction handling behavior from its SnapshotKVDatabase
superclass.
Key watches are supported.
-
Field Summary
Fields inherited from class io.permazen.kv.mvcc.SnapshotKVDatabase
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected MVStoreKVTransaction
createSnapshotKVTransaction
(MutableView view, long baseVersion) Instantiate a newSnapshotKVTransaction
instance.Create a new transaction.Get the underlyingMVStoreAtomicKVStore
used by this instance.void
setKVStore
(MVStoreAtomicKVStore kvstore) Configure the underlyingMVStoreAtomicKVStore
used by this instance.Methods inherited from class io.permazen.kv.mvcc.SnapshotKVDatabase
closeTransactions, createTransaction, getCurrentVersion, logException, setKVStore, start, stop, toString, wrapException
-
Constructor Details
-
MVStoreKVDatabase
public MVStoreKVDatabase()
-
-
Method Details
-
getKVStore
Get the underlyingMVStoreAtomicKVStore
used by this instance.- Overrides:
getKVStore
in classSnapshotKVDatabase
- Returns:
- underlying key/value store
-
setKVStore
Configure the underlyingMVStoreAtomicKVStore
used by this instance. Required property.- Parameters:
kvstore
- underlying key/value store- Throws:
IllegalStateException
- if this instance is alreadySnapshotKVDatabase.start()
ed
-
createTransaction
Description copied from class:SnapshotKVDatabase
Create a new transaction.- Specified by:
createTransaction
in interfaceKVDatabase
- Overrides:
createTransaction
in classSnapshotKVDatabase
- Returns:
- newly created transaction
-
createSnapshotKVTransaction
Description copied from class:SnapshotKVDatabase
Instantiate a newSnapshotKVTransaction
instance.The implementation in
SnapshotKVDatabase
just invokes theSnapshotKVTransaction
constructor usingthis
. Subclasses may want to override this method to create a more specific subclass.- Overrides:
createSnapshotKVTransaction
in classSnapshotKVDatabase
- Parameters:
view
- mutable view to be used for this transactionbaseVersion
- the database version associated withbase
- Returns:
- new transaction instance
-