public interface Block
Block represents single .xd file in Log on storage device - disk, memory, network file
system. etc. Block is identified in the log by its address. Block
has length in bytes, which is not greater than maximum log block size. Block implementation defines the way data is
read from storage device.
Log blocks can be mutable and immutable. All blocks having length equal to maximum log block size are immutable. In any moment, only one block can be mutable. This has maximum address.DataReader,
DataWriter,
DataReaderWriterProvider,
EnvironmentConfig.getLogFileSize()| Modifier and Type | Method and Description |
|---|---|
long |
getAddress()
Returns address of the block in the
Log. |
long |
length()
Returns length of the block in bytes.
|
int |
read(byte[] output,
long position,
int offset,
int count)
Reads data from the underlying store device.
|
Block |
refresh()
For immutable
Block implementations, this method returns fresh representation of the same .xd
file. |
long getAddress()
Log. This address is always constant for the block.Loglong length()
EnvironmentConfig.getLogFileSize()int read(byte[] output,
long position,
int offset,
int count)
output - array to copy dataposition - starting position in the .xd fileoffset - starting offset in the arraycount - number of bytes to readBlock refresh()
Block implementations, this method returns fresh representation of the same .xd
file. For mutable Block implementations, this method just returns this Block instance..xd file