| Constructor and Description |
|---|
ExtRegion(java.nio.file.Path saveDirectory,
java.util.List<IHeaderDataEntryProvider<?,K>> headerData,
IKeyProvider<K> keyProvider,
RegionKey regionKey) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
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
|
public ExtRegion(java.nio.file.Path saveDirectory,
java.util.List<IHeaderDataEntryProvider<?,K>> headerData,
IKeyProvider<K> keyProvider,
RegionKey regionKey)
throws java.io.IOException
java.io.IOExceptionpublic void writeValue(K key, java.nio.ByteBuffer value) throws java.io.IOException
IRegionwriteValue in interface IRegion<K extends IKey<K>>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.IOExceptionpublic void writeSpecial(K key, java.lang.Object marker) throws java.io.IOException
writeSpecial in interface IRegion<K extends IKey<K>>java.io.IOExceptionpublic java.util.Optional<java.nio.ByteBuffer> readValue(K key) throws java.io.IOException
IRegionpublic boolean hasValue(K key)
IRegionpublic void forEachKey(CheckedConsumer<? super K,java.io.IOException> cons) throws java.io.IOException
IRegionforEachKey in interface IRegion<K extends IKey<K>>java.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushablejava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException