public final class NitriteMVStore extends java.lang.Object implements NitriteStore
A MVStore backed NitriteStore implementation.
| Constructor and Description |
|---|
NitriteMVStore(org.h2.mvstore.MVStore store)
Instantiates a new
NitriteMVStore. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the file and the store.
|
void |
closeImmediately()
Closes the file and the store, without writing anything.
|
void |
commit()
Commits the changes.
|
void |
compactMoveChunks()
Compacts the store by moving all chunks next to each other.
|
java.util.Set<java.lang.String> |
getMapNames()
Gets the set of all map names.
|
boolean |
hasMap(java.lang.String mapName)
Checks whether a given map exists in the store.
|
boolean |
hasUnsavedChanges()
Checks whether there are any unsaved changes.
|
boolean |
isClosed()
Checks whether this store is closed for further modification.
|
NitriteMap<java.lang.String,Attributes> |
metaMap()
Gets the metadata of all
NitriteMaps. |
<Key,Value> |
openMap(java.lang.String mapName)
Opens a
NitriteMap with the default settings. |
<Key,Value> |
removeMap(NitriteMap<Key,Value> map)
Removes a map from the store.
|
public NitriteMVStore(org.h2.mvstore.MVStore store)
Instantiates a new NitriteMVStore.
store - the storepublic java.util.Set<java.lang.String> getMapNames()
NitriteStoreGets the set of all map names.
getMapNames in interface NitriteStorepublic boolean hasUnsavedChanges()
NitriteStoreChecks whether there are any unsaved changes.
hasUnsavedChanges in interface NitriteStoretrue if there are any changes; false otherwise.public boolean isClosed()
NitriteStoreChecks whether this store is closed for further modification.
isClosed in interface NitriteStoretrue if closed; false otherwise.public void compactMoveChunks()
NitriteStoreCompacts the store by moving all chunks next to each other.
compactMoveChunks in interface NitriteStorepublic void commit()
NitriteStoreCommits the changes. For persistent stores, it also writes changes to disk. It does nothing if there are no unsaved changes.
commit in interface NitriteStorepublic void close()
NitriteStoreCloses the file and the store. Unsaved changes are written to disk first.
close in interface NitriteStorepublic void closeImmediately()
NitriteStoreCloses the file and the store, without writing anything. This method ignores all errors.
closeImmediately in interface NitriteStorepublic boolean hasMap(java.lang.String mapName)
NitriteStoreChecks whether a given map exists in the store.
hasMap in interface NitriteStoremapName - the map nametrue if it exists; false otherwise.public <Key,Value> NitriteMap<Key,Value> openMap(java.lang.String mapName)
NitriteStoreOpens a NitriteMap with the default settings. The map is
automatically create if it does not yet exist. If a map with this
name is already open, this map is returned.
openMap in interface NitriteStoreKey - the key typeValue - the value typemapName - the map namepublic <Key,Value> void removeMap(NitriteMap<Key,Value> map)
NitriteStoreRemoves a map from the store.
removeMap in interface NitriteStoreKey - the key typeValue - the value typemap - the map to remove.public NitriteMap<java.lang.String,Attributes> metaMap()
NitriteStoreGets the metadata of all NitriteMaps.
metaMap in interface NitriteStore