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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected MVStoreKVTransactioncreateSnapshotKVTransaction(MutableView view, long baseVersion) Instantiate a newSnapshotKVTransactioninstance.Create a new transaction.Get the underlyingMVStoreAtomicKVStoreused by this instance.voidsetKVStore(MVStoreAtomicKVStore kvstore) Configure the underlyingMVStoreAtomicKVStoreused 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 underlyingMVStoreAtomicKVStoreused by this instance.- Overrides:
getKVStorein classSnapshotKVDatabase- Returns:
- underlying key/value store
-
setKVStore
Configure the underlyingMVStoreAtomicKVStoreused 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:SnapshotKVDatabaseCreate a new transaction.- Specified by:
createTransactionin interfaceKVDatabase- Overrides:
createTransactionin classSnapshotKVDatabase- Returns:
- newly created transaction
-
createSnapshotKVTransaction
Description copied from class:SnapshotKVDatabaseInstantiate a newSnapshotKVTransactioninstance.The implementation in
SnapshotKVDatabasejust invokes theSnapshotKVTransactionconstructor usingthis. Subclasses may want to override this method to create a more specific subclass.- Overrides:
createSnapshotKVTransactionin classSnapshotKVDatabase- Parameters:
view- mutable view to be used for this transactionbaseVersion- the database version associated withbase- Returns:
- new transaction instance
-