Package io.permazen.kv.simple
Class MemoryKVDatabase
java.lang.Object
io.permazen.kv.simple.SimpleKVDatabase
io.permazen.kv.simple.MemoryKVDatabase
- All Implemented Interfaces:
KVDatabase,Serializable
- Direct Known Subclasses:
XMLKVDatabase
A simple in-memory implementation of the
KVDatabase interface.
This is just a SimpleKVDatabase with a MemoryAtomicKVStore as its underlying key/value store.
See SimpleKVDatabase for further details.
-
Field Summary
Fields inherited from class io.permazen.kv.simple.SimpleKVDatabase
DEFAULT_HOLD_TIMEOUT, DEFAULT_WAIT_TIMEOUT, kv, log -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.MemoryKVDatabase(long waitTimeout, long holdTimeout) Primary constructor. -
Method Summary
Methods inherited from class io.permazen.kv.simple.SimpleKVDatabase
checkState, createTransaction, createTransaction, getHoldTimeout, getWaitTimeout, postCommit, preCommit, setHoldTimeout, setWaitTimeout, start, stop
-
Constructor Details
-
MemoryKVDatabase
public MemoryKVDatabase()Constructor.Uses the default wait and hold timeouts.
-
MemoryKVDatabase
public MemoryKVDatabase(long waitTimeout, long holdTimeout) Primary constructor.- Parameters:
waitTimeout- how long a thread will wait for a lock before throwingRetryKVTransactionExceptionin milliseconds, or zero for unlimitedholdTimeout- how long a thread may hold a contestested lock before throwingRetryKVTransactionExceptionin milliseconds, or zero for unlimited- Throws:
IllegalArgumentException- ifwaitTimeoutorholdTimeoutis negative
-