public final class TemporaryDb extends AbstractCloseableNativeProxy implements Database
The corresponding database is deleted when TemporaryDb is closed.
NodeFakenativeHandle| Modifier and Type | Method and Description |
|---|---|
Fork |
createFork(Cleaner cleaner)
Creates a new database fork.
|
Snapshot |
createSnapshot(Cleaner cleaner)
Creates a new snapshot of the database state.
|
protected void |
disposeInternal()
Releases any resources owned by this proxy (e.g., the corresponding native object).
|
void |
merge(Fork fork)
Applies the changes from the given fork to the database state.
|
static TemporaryDb |
newInstance()
Creates a new empty TemporaryDb.
|
close, getNativeHandleisValidHandleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclosepublic static TemporaryDb newInstance()
public Snapshot createSnapshot(Cleaner cleaner)
DatabasecreateSnapshot in interface Databasecleaner - a cleaner to register the snapshotpublic Fork createFork(Cleaner cleaner)
DatabaseA fork allows to perform a transaction: a number of independent writes to a database, which then may be atomically applied to the database.
createFork in interface Databasecleaner - a cleaner to register the forkpublic void merge(Fork fork)
Once this method completes, any indexes created with the fork and the fork itself
are closed and cannot be used anymore. Any subsequent operations on these objects will result
in IllegalStateException.
fork - a fork to get changes fromRuntimeException - if the fork cannot be applied to the database state.
The provided fork will be closedprotected void disposeInternal()
AbstractCloseableNativeProxyThis method is only called once from AbstractCloseableNativeProxy.close() for a valid
proxy and shall not be called directly.
disposeInternal in class AbstractCloseableNativeProxyCopyright © 2019 Exonum. All rights reserved.