Class BlockSourceBzip2
java.lang.Object
org.aksw.commons.io.hadoop.binseach.bz2.BlockSourceBzip2
- All Implemented Interfaces:
BlockSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic longprotected com.google.common.cache.LoadingCache<Long, org.aksw.commons.io.hadoop.binseach.bz2.BlockSourceBzip2.Neighbour> static final Patternprotected longprotected longstatic final Stringstatic final Patternstatic final intThe maximum number of bytes that may be scanned in order to find a block start Bzip blocks are typically 900K uncompressed; unfortunately the CBZip2InputStream API does not give access to the actual block size used.protected SeekableSourcestatic long -
Constructor Summary
ConstructorsConstructorDescriptionBlockSourceBzip2(SeekableSource seekableSource, MatcherFactory fwdBlockStartMatcherFactory, MatcherFactory bwdBlockStartMatcherFactory) -
Method Summary
Modifier and TypeMethodDescriptionorg.aksw.commons.util.ref.Ref<Block> org.aksw.commons.util.ref.Ref<Block> contentAtOrAfter(long requestPos, boolean inclusive) org.aksw.commons.util.ref.Ref<Block> contentAtOrBefore(long requestPos, boolean inclusive) static BlockSourcecreate(SeekableSource seekableSource) longfindBlockAtOrAfter(Seekable seekable) longfindBlockAtOrAfterCached(Seekable seekable) longfindBlockAtOrBefore(Seekable seekable) longfindBlockAtOrBeforeCached(Seekable seekable) longgetSizeOfBlock(long pos) longgetSizeOfBlockCached(long pos) booleanhasBlockAfter(long pos) booleanhasBlockBefore(long pos) protected longloadBlock(long pos) protected org.aksw.commons.util.ref.Ref<Block> longsize()
-
Field Details
-
COMPRESSED_MAGIC_STR
- See Also:
-
fwdMagicPattern
-
bwdMagicPattern
-
MAX_SEARCH_RANGE
public static final int MAX_SEARCH_RANGEThe maximum number of bytes that may be scanned in order to find a block start Bzip blocks are typically 900K uncompressed; unfortunately the CBZip2InputStream API does not give access to the actual block size used.- See Also:
-
seekableSource
-
ABSENT
public static long ABSENT -
UNKNOWN
public static long UNKNOWN -
blockTopologyCache
protected com.google.common.cache.LoadingCache<Long, org.aksw.commons.io.hadoop.binseach.bz2.BlockSourceBzip2.Neighbour> blockTopologyCache -
blockContentCache
-
cachedBlockSize
protected long cachedBlockSize -
cachedLastBlockSize
protected long cachedLastBlockSize
-
-
Constructor Details
-
BlockSourceBzip2
public BlockSourceBzip2(SeekableSource seekableSource, MatcherFactory fwdBlockStartMatcherFactory, MatcherFactory bwdBlockStartMatcherFactory)
-
-
Method Details
-
create
-
loadBlock
- Throws:
IOException
-
findBlockAtOrBeforeCached
- Throws:
IOException
-
findBlockAtOrBefore
- Throws:
IOException
-
contentAtOrBefore
public org.aksw.commons.util.ref.Ref<Block> contentAtOrBefore(long requestPos, boolean inclusive) throws IOException - Specified by:
contentAtOrBeforein interfaceBlockSource- Throws:
IOException
-
findBlockAtOrAfterCached
- Throws:
IOException
-
findBlockAtOrAfter
- Throws:
IOException
-
contentAtOrAfter
public org.aksw.commons.util.ref.Ref<Block> contentAtOrAfter(long requestPos, boolean inclusive) throws IOException - Specified by:
contentAtOrAfterin interfaceBlockSource- Throws:
IOException
-
hasBlockAfter
- Specified by:
hasBlockAfterin interfaceBlockSource- Throws:
IOException
-
hasBlockBefore
- Specified by:
hasBlockBeforein interfaceBlockSource- Throws:
IOException
-
size
- Specified by:
sizein interfaceBlockSource- Throws:
IOException
-
cache
public org.aksw.commons.util.ref.Ref<Block> cache(long blockStart, Seekable seekable) throws IOException - Throws:
IOException
-
getSizeOfBlock
- Specified by:
getSizeOfBlockin interfaceBlockSource- Throws:
IOException
-
getSizeOfBlockCached
- Throws:
IOException
-
loadBlock
- Throws:
IOException
-