public abstract class BlockMappedInput extends BlockInput
Note: DO NOT use an instance
of this class from multiple threads - see Unmapper.
| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_EXPIRYMILLIS
Default time in milliseconds after which buffers will be discarded.
|
| Modifier | Constructor and Description |
|---|---|
protected |
BlockMappedInput(BlockManager blockManager)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
This does not close the BlockManager.
|
static BlockMappedInput |
createInput(BlockManager blockManager,
boolean caching)
Constructs an instance that does or does not support caching.
|
static BlockMappedInput |
createInput(BlockManager blockManager,
long expiryMillis)
Constructs an instance with explicit configuration.
|
long |
getBlockOffset(int iblock,
int offsetInBlock)
Returns the offset into this stream corresponding to a given
block index and offset into that block.
|
int[] |
getBlockPos(long offset)
Returns the block location of a given byte offset.
|
acquireBlock, getBlockCount, getOffset, isRandom, readByte, readBytes, readDouble, readFloat, readInt, readLong, readShort, seek, skippublic static final long DEFAULT_EXPIRYMILLIS
protected BlockMappedInput(BlockManager blockManager)
blockManager - manages file mapping using byte bufferspublic int[] getBlockPos(long offset)
BlockInputThis does the opposite of getBlockOffset.
getBlockPos in class BlockInputoffset - offset into this input streampublic long getBlockOffset(int iblock,
int offsetInBlock)
BlockInputThis does the opposite of getBlockPos.
getBlockOffset in class BlockInputiblock - block indexoffsetInBlock - offset into that blockpublic void close()
close in interface BasicInputclose in class BlockInputpublic static BlockMappedInput createInput(BlockManager blockManager, boolean caching) throws IOException
blockManager - manages buffer in blockscaching - whether buffers are cachedIOExceptionpublic static BlockMappedInput createInput(BlockManager blockManager, long expiryMillis) throws IOException
expiryMillis parameter controls caching.
If zero, the current buffer is discarded as soon
as a different one is used. Otherwise, an attempt is made to
discard buffers only after they have been unused for a certain
number of milliseconds.blockManager - manages buffer in blocksexpiryMillis - buffer caching period in millisecondsIOExceptionCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.