public class BlockManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BLOCKSIZE
Default size of a block.
|
Constructor and Description |
---|
BlockManager(java.nio.channels.FileChannel chan,
long offset,
long size,
java.lang.String logName,
Unmapper unmapper,
int blockSize)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes all the BufferManagers maintained by this object.
|
int |
getBlockCount()
Returns the number of blocks used by this mananger.
|
int |
getBlockSize()
Returns the size of blocks used by this manager.
|
BufferManager |
getBufferManager(int ib)
Returns the BufferManager for a given block.
|
public static final int DEFAULT_BLOCKSIZE
public BlockManager(java.nio.channels.FileChannel chan, long offset, long size, java.lang.String logName, Unmapper unmapper, int blockSize)
chan
- file channeloffset
- offset into file of start of mapped regionsize
- length of mapped regionlogName
- description of mapped region
suitable for use in logging messagesunmapper
- used to unmap buffers, may be null for safetyblockSize
- size of each block (except the last)public int getBlockCount()
public int getBlockSize()
public BufferManager getBufferManager(int ib)
ib
- block indexpublic void close()