Class SeekableReadableChannelOverBlocks
java.lang.Object
org.aksw.commons.util.closeable.AutoCloseableBase
org.aksw.commons.util.closeable.AutoCloseableWithLeakDetectionBase
org.aksw.commons.io.shared.ChannelBase
org.aksw.commons.io.input.ReadableChannelBase<byte[]>
org.aksw.commons.io.input.SeekableReadableChannelBase<byte[]>
org.aksw.commons.io.hadoop.binseach.v2.SeekableReadableChannelOverBlocks
- All Implemented Interfaces:
Closeable, AutoCloseable, Cloneable, Channel, HasArrayOps<byte[]>, HasPosition, ReadableChannel<byte[]>, ReadableSource<byte[]>, SeekableReadableChannel<byte[]>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected NavigableMap<Long, Block> protected BlockSourceprotected BlockSourceChannelprotected Blockprotected longprotected longprotected longprotected longprotected NavigableMap<Long, Long> Fields inherited from class org.aksw.commons.util.closeable.AutoCloseableWithLeakDetectionBase
instantiationStackTraceFields inherited from class org.aksw.commons.util.closeable.AutoCloseableBase
closeStackTrace, enableCloseStackTrace, isClosed -
Constructor Summary
ConstructorsConstructorDescriptionSeekableReadableChannelOverBlocks(BlockSource blockSource, long firstBlockId, com.github.benmanes.caffeine.cache.Cache<Long, Block> globalCache) -
Method Summary
Modifier and TypeMethodDescriptionSeekableReadableChannel<byte[]> protected voidprotected voidArrayOps<byte[]> protected BlockgetOrLoadBlock(long blockId, long logicalBlockOffset) longprotected booleanstatic BlockloadBlock(BlockSource blockSource, BlockSourceChannel channel, long thisBlockId) longposition()voidposition(long pos) intread(byte[] array, int position, int length) Methods inherited from class ChannelBase
isOpenMethods inherited from class org.aksw.commons.util.closeable.AutoCloseableWithLeakDetectionBase
finalize, getInstantiationStackTraceMethods inherited from class org.aksw.commons.util.closeable.AutoCloseableBase
close, ensureOpen, throwClosedExceptionMethods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ReadableSource
readRaw
-
Field Details
-
blockSource
-
channel
-
firstBlockId
protected long firstBlockId -
currentBlockLogicalOffset
protected long currentBlockLogicalOffset -
currentBlock
-
currentBlockId
protected long currentBlockId -
currentLogicalPos
protected long currentLogicalPos -
globalCache
-
blockIdToBlock
-
logicalPosToBlockId
-
-
Constructor Details
-
SeekableReadableChannelOverBlocks
public SeekableReadableChannelOverBlocks(BlockSource blockSource, long firstBlockId, com.github.benmanes.caffeine.cache.Cache<Long, Block> globalCache) - Parameters:
blockSource-globalCache-channel- The initial channel positioned at the beginning of a block.
-
-
Method Details
-
getKnownBlocks
-
cloneObject
-
isPosValidInBlock
protected boolean isPosValidInBlock() -
ensureCurrentBlock
protected void ensureCurrentBlock() -
getStartingBlockSize
public long getStartingBlockSize() -
getOrLoadBlock
-
read
- Throws:
IOException
-
getArrayOps
-
position
- Throws:
IOException
-
closeActual
-
position
- Throws:
IOException
-
loadBlock
public static Block loadBlock(BlockSource blockSource, BlockSourceChannel channel, long thisBlockId) throws IOException - Throws:
IOException
-