Class BlockSourceBzip2
- java.lang.Object
-
- org.aksw.commons.io.hadoop.binseach.bz2.BlockSourceBzip2
-
- All Implemented Interfaces:
org.aksw.commons.io.block.api.BlockSource
public class BlockSourceBzip2 extends Object implements org.aksw.commons.io.block.api.BlockSource
-
-
Field Summary
Fields Modifier and Type Field Description static longABSENTprotected com.google.common.cache.Cache<Long,org.aksw.commons.util.ref.Ref<org.aksw.commons.io.block.api.Block>>blockContentCacheprotected com.google.common.cache.LoadingCache<Long,org.aksw.commons.io.hadoop.binseach.bz2.BlockSourceBzip2.Neighbour>blockTopologyCachestatic PatternbwdMagicPatternprotected longcachedBlockSizeprotected longcachedLastBlockSizestatic StringCOMPRESSED_MAGIC_STRstatic PatternfwdMagicPatternstatic intMAX_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.protected org.aksw.commons.io.seekable.api.SeekableSourceseekableSourcestatic longUNKNOWN
-
Constructor Summary
Constructors Constructor Description BlockSourceBzip2(org.aksw.commons.io.seekable.api.SeekableSource seekableSource, org.aksw.commons.io.deprecated.MatcherFactory fwdBlockStartMatcherFactory, org.aksw.commons.io.deprecated.MatcherFactory bwdBlockStartMatcherFactory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.aksw.commons.util.ref.Ref<org.aksw.commons.io.block.api.Block>cache(long blockStart, org.aksw.commons.io.seekable.api.Seekable seekable)org.aksw.commons.util.ref.Ref<org.aksw.commons.io.block.api.Block>contentAtOrAfter(long requestPos, boolean inclusive)org.aksw.commons.util.ref.Ref<org.aksw.commons.io.block.api.Block>contentAtOrBefore(long requestPos, boolean inclusive)static org.aksw.commons.io.block.api.BlockSourcecreate(org.aksw.commons.io.seekable.api.SeekableSource seekableSource)longfindBlockAtOrAfter(org.aksw.commons.io.seekable.api.Seekable seekable)longfindBlockAtOrAfterCached(org.aksw.commons.io.seekable.api.Seekable seekable)longfindBlockAtOrBefore(org.aksw.commons.io.seekable.api.Seekable seekable)longfindBlockAtOrBeforeCached(org.aksw.commons.io.seekable.api.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<org.aksw.commons.io.block.api.Block>loadBlock(org.aksw.commons.io.seekable.api.Seekable seekable)longsize()
-
-
-
Field Detail
-
COMPRESSED_MAGIC_STR
public static final String COMPRESSED_MAGIC_STR
- See Also:
- Constant Field Values
-
fwdMagicPattern
public static final Pattern fwdMagicPattern
-
bwdMagicPattern
public static final Pattern bwdMagicPattern
-
MAX_SEARCH_RANGE
public static final int MAX_SEARCH_RANGE
The 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:
- Constant Field Values
-
seekableSource
protected org.aksw.commons.io.seekable.api.SeekableSource 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
protected com.google.common.cache.Cache<Long,org.aksw.commons.util.ref.Ref<org.aksw.commons.io.block.api.Block>> blockContentCache
-
cachedBlockSize
protected long cachedBlockSize
-
cachedLastBlockSize
protected long cachedLastBlockSize
-
-
Method Detail
-
create
public static org.aksw.commons.io.block.api.BlockSource create(org.aksw.commons.io.seekable.api.SeekableSource seekableSource)
-
loadBlock
protected org.aksw.commons.util.ref.Ref<org.aksw.commons.io.block.api.Block> loadBlock(org.aksw.commons.io.seekable.api.Seekable seekable) throws IOException- Throws:
IOException
-
findBlockAtOrBeforeCached
public long findBlockAtOrBeforeCached(org.aksw.commons.io.seekable.api.Seekable seekable) throws IOException- Throws:
IOException
-
findBlockAtOrBefore
public long findBlockAtOrBefore(org.aksw.commons.io.seekable.api.Seekable seekable) throws IOException- Throws:
IOException
-
contentAtOrBefore
public org.aksw.commons.util.ref.Ref<org.aksw.commons.io.block.api.Block> contentAtOrBefore(long requestPos, boolean inclusive) throws IOException- Specified by:
contentAtOrBeforein interfaceorg.aksw.commons.io.block.api.BlockSource- Throws:
IOException
-
findBlockAtOrAfterCached
public long findBlockAtOrAfterCached(org.aksw.commons.io.seekable.api.Seekable seekable) throws IOException- Throws:
IOException
-
findBlockAtOrAfter
public long findBlockAtOrAfter(org.aksw.commons.io.seekable.api.Seekable seekable) throws IOException- Throws:
IOException
-
contentAtOrAfter
public org.aksw.commons.util.ref.Ref<org.aksw.commons.io.block.api.Block> contentAtOrAfter(long requestPos, boolean inclusive) throws IOException- Specified by:
contentAtOrAfterin interfaceorg.aksw.commons.io.block.api.BlockSource- Throws:
IOException
-
hasBlockAfter
public boolean hasBlockAfter(long pos) throws IOException- Specified by:
hasBlockAfterin interfaceorg.aksw.commons.io.block.api.BlockSource- Throws:
IOException
-
hasBlockBefore
public boolean hasBlockBefore(long pos) throws IOException- Specified by:
hasBlockBeforein interfaceorg.aksw.commons.io.block.api.BlockSource- Throws:
IOException
-
size
public long size() throws IOException- Specified by:
sizein interfaceorg.aksw.commons.io.block.api.BlockSource- Throws:
IOException
-
cache
public org.aksw.commons.util.ref.Ref<org.aksw.commons.io.block.api.Block> cache(long blockStart, org.aksw.commons.io.seekable.api.Seekable seekable) throws IOException- Throws:
IOException
-
getSizeOfBlock
public long getSizeOfBlock(long pos) throws IOException- Specified by:
getSizeOfBlockin interfaceorg.aksw.commons.io.block.api.BlockSource- Throws:
IOException
-
getSizeOfBlockCached
public long getSizeOfBlockCached(long pos) throws IOException- Throws:
IOException
-
loadBlock
protected long loadBlock(long pos) throws IOException- Throws:
IOException
-
-