Package io.permazen.kv
Interface KVDatabase
- All Known Implementing Classes:
ArrayKVDatabase,BerkeleyKVDatabase,ByteArrayLMDBKVDatabase,CachingKVDatabase,CockroachKVDatabase,FallbackKVDatabase,FoundationKVDatabase,LevelDBKVDatabase,LMDBKVDatabase,MemoryKVDatabase,MSSQLKVDatabase,MVStoreKVDatabase,MySQLKVDatabase,PrefixKVDatabase,RaftKVDatabase,SimpleKVDatabase,SnapshotKVDatabase,SpannerKVDatabase,SpringXMLKVDatabase,SQLiteKVDatabase,SQLKVDatabase,XMLKVDatabase,XodusKVDatabase
public interface KVDatabase
A transactional database with a simple key/value API.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionCreate a new transaction.createTransaction(Map<String, ?> options) Create a new transaction with the specified options.voidstart()Start this instance.voidstop()Stop this instance.
-
Method Details
-
start
void start()Start this instance. This method must be called prior to creating any transactions.This method is idempotent: if this instance is already started, nothing happens.
Whether an instance that has been started and stopped can be restarted is implementation-dependent.
- Throws:
IllegalStateException- if this instance is not properly configured
-
stop
void stop()Stop this instance.This method is idempotent: if this instance has not been started, or is already stopped, nothing happens.
-
createTransaction
KVTransaction createTransaction()Create a new transaction.- Returns:
- newly created transaction
- Throws:
KVDatabaseException- if an unexpected error occursIllegalStateException- if this instance is notstart()ed
-
createTransaction
Create a new transaction with the specified options.- Parameters:
options- optional transaction options; may be null- Returns:
- newly created transaction
- Throws:
KVDatabaseException- if an unexpected error occursIllegalStateException- if this instance is notstart()ed
-