public class ArrayKVDatabase extends SnapshotKVDatabase
KVDatabase
implementation based on a AtomicArrayKVStore
, providing concurrent transactions
and linearizable ACID semantics.
Key watches, mutable snapshots, and hot backups are supported.
AtomicArrayKVStore
log
Constructor and Description |
---|
ArrayKVDatabase() |
Modifier and Type | Method and Description |
---|---|
protected ArrayKVTransaction |
createSnapshotKVTransaction(MutableView view,
long baseVersion)
Instantiate a new
SnapshotKVTransaction instance. |
ArrayKVTransaction |
createTransaction()
Create a new transaction.
|
AtomicArrayKVStore |
getKVStore()
Get the underlying
AtomicArrayKVStore used by this instance. |
void |
setKVStore(AtomicArrayKVStore kvstore)
Configure the underlying
AtomicArrayKVStore used by this instance. |
protected RuntimeException |
wrapException(SnapshotKVTransaction tx,
RuntimeException e)
Wrap a
RuntimeException as needed. |
closeTransactions, createTransaction, getCurrentVersion, logException, setKVStore, start, stop, toString
public AtomicArrayKVStore getKVStore()
AtomicArrayKVStore
used by this instance.getKVStore
in class SnapshotKVDatabase
public void setKVStore(AtomicArrayKVStore kvstore)
AtomicArrayKVStore
used by this instance. Required property.kvstore
- underlying key/value storeIllegalStateException
- if this instance is already SnapshotKVDatabase.start()
edpublic ArrayKVTransaction createTransaction()
SnapshotKVDatabase
createTransaction
in interface KVDatabase
createTransaction
in class SnapshotKVDatabase
protected ArrayKVTransaction createSnapshotKVTransaction(MutableView view, long baseVersion)
SnapshotKVDatabase
SnapshotKVTransaction
instance.
The implementation in SnapshotKVDatabase
just invokes the SnapshotKVTransaction
constructor using this
. Subclasses may want to override this method to create a more specific subclass.
createSnapshotKVTransaction
in class SnapshotKVDatabase
view
- mutable view to be used for this transactionbaseVersion
- the database version associated with base
protected RuntimeException wrapException(SnapshotKVTransaction tx, RuntimeException e)
SnapshotKVDatabase
RuntimeException
as needed.
The implementation in SnapshotKVDatabase
just returns e
.
wrapException
in class SnapshotKVDatabase
tx
- transaction in which the exception occurrede
- original exceptione
Copyright © 2022. All rights reserved.