public final class MemoryDb extends AbstractCloseableNativeProxy implements Database
nativeHandle
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 MemoryDb |
newInstance()
Creates a new empty MemoryDb.
|
close, getNativeHandle
isValidHandle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
public static MemoryDb newInstance()
public Snapshot createSnapshot(Cleaner cleaner)
Database
createSnapshot
in interface Database
cleaner
- a cleaner to register the snapshotpublic Fork createFork(Cleaner cleaner)
Database
A 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 Database
cleaner
- a cleaner to register the forkpublic void merge(Fork fork)
fork
- a fork to get changes fromprotected void disposeInternal()
AbstractCloseableNativeProxy
This method is only called once from AbstractCloseableNativeProxy.close()
for a valid
proxy and shall not be called directly.
disposeInternal
in class AbstractCloseableNativeProxy
Copyright © 2018 Exonum. All rights reserved.