public class AsyncBatchingCubeIO extends java.lang.Object implements ICubeIO
ICubeIO which internally batches cubes/columns together, and forwards them along to a ICubicStorage on the I/O thread.ICubeIO.PartialData<T>| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.locks.ReadWriteLock |
lock |
protected boolean |
open |
protected java.util.Map<net.minecraft.util.math.ChunkPos,net.minecraft.nbt.NBTTagCompound> |
pendingColumns |
protected java.util.Map<CubePos,net.minecraft.nbt.NBTTagCompound> |
pendingCubes |
protected ICubicStorage |
storage |
protected net.minecraft.world.World |
world |
| Constructor and Description |
|---|
AsyncBatchingCubeIO(net.minecraft.world.World world,
ICubicStorage storage) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
columnExists(int columnX,
int columnZ) |
boolean |
cubeExists(int cubeX,
int cubeY,
int cubeZ) |
protected void |
drainQueueBlocking()
Blocks the calling thread until the write queues have been completely drained.
|
protected void |
ensureOpen() |
void |
flush() |
int |
getPendingColumnCount() |
int |
getPendingCubeCount() |
ICubicStorage |
getStorage() |
void |
loadColumnAsyncPart(ICubeIO.PartialData<net.minecraft.world.chunk.Chunk> info,
int chunkX,
int chunkZ) |
ICubeIO.PartialData<net.minecraft.world.chunk.Chunk> |
loadColumnNbt(int chunkX,
int chunkZ) |
void |
loadColumnSyncPart(ICubeIO.PartialData<net.minecraft.world.chunk.Chunk> info) |
void |
loadCubeAsyncPart(ICubeIO.PartialData<ICube> info,
net.minecraft.world.chunk.Chunk column,
int cubeY) |
ICubeIO.PartialData<ICube> |
loadCubeNbt(net.minecraft.world.chunk.Chunk column,
int cubeY) |
void |
loadCubeSyncPart(ICubeIO.PartialData<ICube> info) |
void |
saveColumn(net.minecraft.world.chunk.Chunk column) |
void |
saveCube(Cube cube) |
boolean |
writeNextIO() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitloadColumnAsyncPart, loadCubeAsyncPartprotected final java.util.concurrent.locks.ReadWriteLock lock
protected final net.minecraft.world.World world
protected final ICubicStorage storage
protected final java.util.Map<net.minecraft.util.math.ChunkPos,net.minecraft.nbt.NBTTagCompound> pendingColumns
protected final java.util.Map<CubePos,net.minecraft.nbt.NBTTagCompound> pendingCubes
protected volatile boolean open
public AsyncBatchingCubeIO(net.minecraft.world.World world,
ICubicStorage storage)
throws java.io.IOException
java.io.IOExceptionprotected void ensureOpen()
public ICubicStorage getStorage()
public boolean columnExists(int columnX,
int columnZ)
columnExists in interface ICubeIOpublic boolean cubeExists(int cubeX,
int cubeY,
int cubeZ)
cubeExists in interface ICubeIOpublic ICubeIO.PartialData<net.minecraft.world.chunk.Chunk> loadColumnNbt(int chunkX, int chunkZ) throws java.io.IOException
loadColumnNbt in interface ICubeIOjava.io.IOExceptionpublic ICubeIO.PartialData<ICube> loadCubeNbt(net.minecraft.world.chunk.Chunk column, int cubeY) throws java.io.IOException
loadCubeNbt in interface ICubeIOjava.io.IOExceptionpublic void saveColumn(net.minecraft.world.chunk.Chunk column)
saveColumn in interface ICubeIOpublic int getPendingColumnCount()
getPendingColumnCount in interface ICubeIOpublic int getPendingCubeCount()
getPendingCubeCount in interface ICubeIOpublic void flush()
throws java.io.IOException
public void close()
throws java.io.IOException
protected void drainQueueBlocking()
throws java.lang.InterruptedException
java.lang.InterruptedException - if the thread has been interruptedpublic boolean writeNextIO()
writeNextIO in interface net.minecraft.world.storage.IThreadedFileIOpublic void loadColumnAsyncPart(ICubeIO.PartialData<net.minecraft.world.chunk.Chunk> info, int chunkX, int chunkZ)
loadColumnAsyncPart in interface ICubeIOpublic void loadColumnSyncPart(ICubeIO.PartialData<net.minecraft.world.chunk.Chunk> info)
loadColumnSyncPart in interface ICubeIOpublic void loadCubeAsyncPart(ICubeIO.PartialData<ICube> info, net.minecraft.world.chunk.Chunk column, int cubeY)
loadCubeAsyncPart in interface ICubeIOpublic void loadCubeSyncPart(ICubeIO.PartialData<ICube> info)
loadCubeSyncPart in interface ICubeIO