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 long
     
    protected com.google.common.cache.Cache<Long,org.aksw.commons.util.ref.Ref<org.aksw.commons.io.block.api.Block>>
     
    protected com.google.common.cache.LoadingCache<Long,org.aksw.commons.io.hadoop.binseach.bz2.BlockSourceBzip2.Neighbour>
     
    static final Pattern
     
    protected long
     
    protected long
     
    static final String
     
    static final Pattern
     
    static final int
    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.
    protected org.aksw.commons.io.seekable.api.SeekableSource
     
    static long
     
  • 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

    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.BlockSource
    create(org.aksw.commons.io.seekable.api.SeekableSource seekableSource)
     
    long
    findBlockAtOrAfter(org.aksw.commons.io.seekable.api.Seekable seekable)
     
    long
    findBlockAtOrAfterCached(org.aksw.commons.io.seekable.api.Seekable seekable)
     
    long
    findBlockAtOrBefore(org.aksw.commons.io.seekable.api.Seekable seekable)
     
    long
    findBlockAtOrBeforeCached(org.aksw.commons.io.seekable.api.Seekable seekable)
     
    long
    getSizeOfBlock(long pos)
     
    long
     
    boolean
    hasBlockAfter(long pos)
     
    boolean
    hasBlockBefore(long pos)
     
    protected long
    loadBlock(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)
     
    long
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • COMPRESSED_MAGIC_STR

      public static final String COMPRESSED_MAGIC_STR
      See Also:
    • 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:
    • 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
  • Constructor Details

    • BlockSourceBzip2

      public BlockSourceBzip2(org.aksw.commons.io.seekable.api.SeekableSource seekableSource, org.aksw.commons.io.deprecated.MatcherFactory fwdBlockStartMatcherFactory, org.aksw.commons.io.deprecated.MatcherFactory bwdBlockStartMatcherFactory)
  • Method Details

    • 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:
      contentAtOrBefore in interface org.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:
      contentAtOrAfter in interface org.aksw.commons.io.block.api.BlockSource
      Throws:
      IOException
    • hasBlockAfter

      public boolean hasBlockAfter(long pos) throws IOException
      Specified by:
      hasBlockAfter in interface org.aksw.commons.io.block.api.BlockSource
      Throws:
      IOException
    • hasBlockBefore

      public boolean hasBlockBefore(long pos) throws IOException
      Specified by:
      hasBlockBefore in interface org.aksw.commons.io.block.api.BlockSource
      Throws:
      IOException
    • size

      public long size() throws IOException
      Specified by:
      size in interface org.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:
      getSizeOfBlock in interface org.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