public class BlockReadWrite
extends java.lang.Object
Constructor and Description |
---|
BlockReadWrite(BlockStore store,
Path path,
boolean isEnableMmap)
Creates a new store.
|
Modifier and Type | Method and Description |
---|---|
void |
fsync()
sync the output stream with the filesystem when possible.
|
long |
getFileSize()
Returns the file size.
|
void |
readBlock(long blockId,
byte[] buffer,
int offset,
int length)
Reads a block into the buffer.
|
void |
remove() |
void |
removeInit() |
java.lang.String |
toString() |
void |
writeBlock(long blockAddress,
byte[] buffer,
int offset,
int length,
boolean isPriority)
Saves the buffer to the database.
|
public BlockReadWrite(BlockStore store, Path path, boolean isEnableMmap)
database
- the owning database.name
- the store namelock
- the table lockpath
- the path to the filespublic long getFileSize()
public void removeInit() throws java.io.IOException
java.io.IOException
public void remove() throws java.sql.SQLException
java.sql.SQLException
public void readBlock(long blockId, byte[] buffer, int offset, int length) throws java.io.IOException
java.io.IOException
public void writeBlock(long blockAddress, byte[] buffer, int offset, int length, boolean isPriority) throws java.io.IOException
java.io.IOException
public void fsync() throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object