Class 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 Detail

      • 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
    • Constructor Detail

      • 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 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:
        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