Package io.permazen.kv.array
Class ArrayKVDatabase
java.lang.Object
io.permazen.kv.mvcc.SnapshotKVDatabase
io.permazen.kv.array.ArrayKVDatabase
- All Implemented Interfaces:
KVDatabase
KVDatabase
implementation based on a AtomicArrayKVStore
, providing concurrent transactions
and linearizable ACID semantics.
Key watches, snapshots, and hot backups are supported.
- See Also:
-
Field Summary
Fields inherited from class io.permazen.kv.mvcc.SnapshotKVDatabase
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ArrayKVTransaction
createSnapshotKVTransaction
(MutableView view, long baseVersion) Instantiate a newSnapshotKVTransaction
instance.Create a new transaction.Get the underlyingAtomicArrayKVStore
used by this instance.void
setKVStore
(AtomicArrayKVStore kvstore) Configure the underlyingAtomicArrayKVStore
used by this instance.protected RuntimeException
Wrap aRuntimeException
as needed.Methods inherited from class io.permazen.kv.mvcc.SnapshotKVDatabase
closeTransactions, createTransaction, getCurrentVersion, logException, setKVStore, start, stop, toString
-
Constructor Details
-
ArrayKVDatabase
public ArrayKVDatabase()
-
-
Method Details
-
getKVStore
Get the underlyingAtomicArrayKVStore
used by this instance.- Overrides:
getKVStore
in classSnapshotKVDatabase
- Returns:
- underlying key/value store
-
setKVStore
Configure the underlyingAtomicArrayKVStore
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
-
wrapException
Description copied from class:SnapshotKVDatabase
Wrap aRuntimeException
as needed.The implementation in
SnapshotKVDatabase
just returnse
.- Overrides:
wrapException
in classSnapshotKVDatabase
- Parameters:
tx
- transaction in which the exception occurrede
- original exception- Returns:
- wrapped exception, or just
e
-