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 |
compact()
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
NitriteMap s. |
<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()
NitriteStore
Gets the set of all map names.
getMapNames
in interface NitriteStore
public boolean hasUnsavedChanges()
NitriteStore
Checks whether there are any unsaved changes.
hasUnsavedChanges
in interface NitriteStore
true
if there are any changes; false
otherwise.public boolean isClosed()
NitriteStore
Checks whether this store is closed for further modification.
isClosed
in interface NitriteStore
true
if closed; false
otherwise.public void compact()
NitriteStore
Compacts the store by moving all chunks next to each other.
compact
in interface NitriteStore
public void commit()
NitriteStore
Commits the changes. For persistent stores, it also writes changes to disk. It does nothing if there are no unsaved changes.
commit
in interface NitriteStore
public void close()
NitriteStore
Closes the file and the store. Unsaved changes are written to disk first.
close
in interface NitriteStore
public void closeImmediately()
NitriteStore
Closes the file and the store, without writing anything. This method ignores all errors.
closeImmediately
in interface NitriteStore
public boolean hasMap(java.lang.String mapName)
NitriteStore
Checks whether a given map exists in the store.
hasMap
in interface NitriteStore
mapName
- the map nametrue
if it exists; false
otherwise.public <Key,Value> NitriteMap<Key,Value> openMap(java.lang.String mapName)
NitriteStore
Opens 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 NitriteStore
Key
- the key typeValue
- the value typemapName
- the map namepublic <Key,Value> void removeMap(NitriteMap<Key,Value> map)
NitriteStore
Removes a map from the store.
removeMap
in interface NitriteStore
Key
- the key typeValue
- the value typemap
- the map to remove.public NitriteMap<java.lang.String,Attributes> metaMap()
NitriteStore
Gets the metadata of all NitriteMap
s.
metaMap
in interface NitriteStore