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