K - The IKey typepublic interface IRegion<K extends IKey<K>>
extends java.io.Flushable, java.io.Closeable
IKeyProvider.
Stores all values within a fixed measure (usually area or volume) of keys (locations).
Regions are used as a way of *chunking* the database.| Modifier and Type | Method and Description |
|---|---|
void |
forEachKey(CheckedConsumer<? super K,java.io.IOException> cons)
Applies the consumer to all existing region keys
|
boolean |
hasValue(K key)
Returns true if something was stored there before within this region.
|
java.util.Optional<java.nio.ByteBuffer> |
readValue(K key)
Loads a value at a key if there was something stored there before, within this region
|
void |
writeSpecial(K key,
java.lang.Object marker) |
void |
writeValue(K key,
java.nio.ByteBuffer value)
Stores a value at a key within this region
|
default void |
writeValues(java.util.Map<K,java.nio.ByteBuffer> entries)
Stores multiple values at their corresponding keys within this region
|
void writeValue(K key, java.nio.ByteBuffer value) throws java.io.IOException
key - A key within this regionvalue - The value to store. Null to remove existing value.UnsupportedDataException - if the data cannot be written due to internal constraints of the storage format. The stored data must remain
unchanged after this exception is thrownjava.io.IOExceptiondefault void writeValues(java.util.Map<K,java.nio.ByteBuffer> entries) throws java.io.IOException
entries - the key-value pairs to store. A value of null will remove an existing valueMultiUnsupportedDataException - if the data cannot be written due to internal constraints of the storage format. The exception contains
all of the keys whose values failed to be written, and stored data for failed key-value pairs must remain unchangedjava.io.IOExceptionvoid writeSpecial(K key, java.lang.Object marker) throws java.io.IOException
java.io.IOExceptionjava.util.Optional<java.nio.ByteBuffer> readValue(K key) throws java.io.IOException
key - The key within this regionkey if it existsjava.io.IOExceptionboolean hasValue(K key)
void forEachKey(CheckedConsumer<? super K,java.io.IOException> cons) throws java.io.IOException
java.io.IOException