public abstract class Volume extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Volume.ByteBufferVol
Abstract Volume over bunch of ByteBuffers
It leaves ByteBufferVol details (allocation, disposal) on subclasses.
|
static interface |
Volume.Factory
Factory which creates two/three volumes used by each MapDB Storage Engine
|
static class |
Volume.FileChannelVol
Volume which uses FileChannel.
|
static class |
Volume.MappedFileVol |
static class |
Volume.MemoryVol |
Constructor and Description |
---|
Volume() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close() |
abstract void |
deleteFile() |
void |
ensureAvailable(long offset)
Check space allocated by Volume is bigger or equal to given offset.
|
static Volume.Factory |
fileFactory(File indexFile,
int rafMode,
boolean readOnly,
long sizeLimit,
int chunkShift,
int sizeIncrement) |
static Volume.Factory |
fileFactory(File indexFile,
int rafMode,
boolean readOnly,
long sizeLimit,
int chunkShift,
int sizeIncrement,
File physFile,
File transLogFile) |
abstract byte |
getByte(long offset) |
abstract DataInput |
getDataInput(long offset,
int size) |
abstract File |
getFile()
returns underlying file if it exists
|
abstract int |
getInt(long offset) |
abstract long |
getLong(long offset) |
long |
getPackedLong(long pos) |
long |
getSixLong(long pos)
Reads a long from the indicated position
|
int |
getUnsignedByte(long offset) |
int |
getUnsignedShort(long offset) |
abstract boolean |
isEmpty() |
abstract boolean |
isSliced() |
static Volume.Factory |
memoryFactory(boolean useDirectBuffer,
long sizeLimit,
int chunkShift) |
abstract void |
putByte(long offset,
byte value) |
abstract void |
putData(long offset,
byte[] src,
int srcPos,
int srcSize) |
abstract void |
putData(long offset,
ByteBuffer buf) |
abstract void |
putInt(long offset,
int value) |
abstract void |
putLong(long offset,
long value) |
int |
putPackedLong(long pos,
long value)
Writes packed long at given position and returns number of bytes used.
|
void |
putSixLong(long pos,
long value)
Writes a long to the indicated position
|
void |
putUnsignedByte(long offset,
int b) |
void |
putUnsignedShort(long offset,
int value) |
abstract void |
sync() |
abstract void |
truncate(long size) |
abstract boolean |
tryAvailable(long offset) |
static Volume |
volumeForFile(File f,
boolean useRandomAccessFile,
boolean readOnly,
long sizeLimit,
int chunkShift,
int sizeIncrement) |
static void |
volumeTransfer(long size,
Volume from,
Volume to)
transfer data from one volume to second.
|
public void ensureAvailable(long offset)
offset
- IOError
- if Volume can not be expanded beyond given offsetpublic abstract boolean tryAvailable(long offset)
public abstract void truncate(long size)
public abstract void putLong(long offset, long value)
public abstract void putInt(long offset, int value)
public abstract void putByte(long offset, byte value)
public abstract void putData(long offset, byte[] src, int srcPos, int srcSize)
public abstract void putData(long offset, ByteBuffer buf)
public abstract long getLong(long offset)
public abstract int getInt(long offset)
public abstract byte getByte(long offset)
public abstract DataInput getDataInput(long offset, int size)
public abstract void close()
public abstract void sync()
public abstract boolean isEmpty()
public abstract void deleteFile()
public abstract boolean isSliced()
public void putUnsignedShort(long offset, int value)
public int getUnsignedShort(long offset)
public int getUnsignedByte(long offset)
public void putUnsignedByte(long offset, int b)
public long getSixLong(long pos)
public void putSixLong(long pos, long value)
public int putPackedLong(long pos, long value)
public abstract File getFile()
public long getPackedLong(long pos)
public static Volume volumeForFile(File f, boolean useRandomAccessFile, boolean readOnly, long sizeLimit, int chunkShift, int sizeIncrement)
public static Volume.Factory fileFactory(File indexFile, int rafMode, boolean readOnly, long sizeLimit, int chunkShift, int sizeIncrement)
public static Volume.Factory fileFactory(File indexFile, int rafMode, boolean readOnly, long sizeLimit, int chunkShift, int sizeIncrement, File physFile, File transLogFile)
public static Volume.Factory memoryFactory(boolean useDirectBuffer, long sizeLimit, int chunkShift)
Copyright © 2015. All rights reserved.