public class ShadowPagingRegion<K extends cubicchunks.regionlib.api.region.key.IKey<K>>
extends java.lang.Object
implements cubicchunks.regionlib.api.region.IRegion<K>
Region class implementing shadow paging by using custom sector tracker
that doesn't reallocate entries in place.| Modifier and Type | Class and Description |
|---|---|
static class |
ShadowPagingRegion.Builder<K extends cubicchunks.regionlib.api.region.key.IKey<K>> |
| Modifier and Type | Method and Description |
|---|---|
static <L extends cubicchunks.regionlib.api.region.key.IKey<L>> |
builder() |
void |
close() |
void |
flush() |
void |
forEachKey(cubicchunks.regionlib.util.CheckedConsumer<? super K,java.io.IOException> cons) |
boolean |
hasValue(K key)
Returns true if something was stored there before within this region.
|
static void |
readFully(java.nio.channels.FileChannel src,
java.nio.ByteBuffer data,
long position) |
java.util.Optional<java.nio.ByteBuffer> |
readValue(K key) |
void |
writeSpecial(K key,
java.lang.Object marker) |
void |
writeValue(K key,
java.nio.ByteBuffer value) |
void |
writeValues(java.util.Map<K,java.nio.ByteBuffer> entries) |
public void writeValue(K key, java.nio.ByteBuffer value) throws java.io.IOException
public void writeValues(java.util.Map<K,java.nio.ByteBuffer> entries) throws java.io.IOException
public void writeSpecial(K key, java.lang.Object marker) throws java.io.IOException
public java.util.Optional<java.nio.ByteBuffer> readValue(K key) throws java.io.IOException
public boolean hasValue(K key)
public void forEachKey(cubicchunks.regionlib.util.CheckedConsumer<? super K,java.io.IOException> cons) throws java.io.IOException
public 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.IOExceptionpublic static <L extends cubicchunks.regionlib.api.region.key.IKey<L>> ShadowPagingRegion.Builder<L> builder()
public static void readFully(java.nio.channels.FileChannel src,
java.nio.ByteBuffer data,
long position)
throws java.io.IOException
java.io.IOException