Interface PageManager

All Superinterfaces:
BlockSource
All Known Implementing Classes:
PageManagerForByteBuffer, PageManagerForFileChannel, PageManagerOverDataStreamSource, PageManagerWrapper

public interface PageManager extends BlockSource
A PageSource (TODO change to that naming) is a special kind of BlockSource where all blocks have the same size and there is a 1:1 correspondance between a pages and non-overlapping regions in the underlying buffer. Consecutive page ids do not necessarily have to refer to consecutive regions.
Author:
raven
  • Method Summary

    Modifier and Type
    Method
    Description
    default org.aksw.commons.util.ref.Ref<? extends Page>
    contentAtOrAfter(long pos, boolean inclusive)
     
    default org.aksw.commons.util.ref.Ref<? extends Page>
    contentAtOrBefore(long pos, boolean inclusive)
     
    long
    The maximum position in the underlying buffer
    int
    The pageSize.
    default long
    getSizeOfBlock(long pos)
    Return the size of the block; all but the last block are guaranteed to have the same size
    default boolean
    hasBlockAfter(long pos)
     
    default boolean
    hasBlockBefore(long pos)
     
    org.aksw.commons.util.ref.Ref<? extends Page>
     
    default long
    Retrieve the number of available pages
  • Method Details

    • requestBufferForPage

      org.aksw.commons.util.ref.Ref<? extends Page> requestBufferForPage(long page)
    • getPageSize

      int getPageSize()
      The pageSize. Must never change during the life time of a page manager.
      Returns:
    • getEndPos

      long getEndPos()
      The maximum position in the underlying buffer
      Returns:
    • size

      default long size()
      Retrieve the number of available pages
      Specified by:
      size in interface BlockSource
      Returns:
    • contentAtOrBefore

      default org.aksw.commons.util.ref.Ref<? extends Page> contentAtOrBefore(long pos, boolean inclusive) throws IOException
      Specified by:
      contentAtOrBefore in interface BlockSource
      Throws:
      IOException
    • contentAtOrAfter

      default org.aksw.commons.util.ref.Ref<? extends Page> contentAtOrAfter(long pos, boolean inclusive) throws IOException
      Specified by:
      contentAtOrAfter in interface BlockSource
      Throws:
      IOException
    • hasBlockAfter

      default boolean hasBlockAfter(long pos) throws IOException
      Specified by:
      hasBlockAfter in interface BlockSource
      Throws:
      IOException
    • hasBlockBefore

      default boolean hasBlockBefore(long pos) throws IOException
      Specified by:
      hasBlockBefore in interface BlockSource
      Throws:
      IOException
    • getSizeOfBlock

      default long getSizeOfBlock(long pos) throws IOException
      Return the size of the block; all but the last block are guaranteed to have the same size
      Specified by:
      getSizeOfBlock in interface BlockSource
      Throws:
      IOException