Interface IMappedPage

  • All Known Implementing Classes:
    MappedPageImpl

    public interface IMappedPage
    Memory mapped page file ADT
    Author:
    bulldog
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void flush()
      Persist any changes to disk
      ByteBuffer getLocal​(int position)
      Get a thread local copy of the mapped page buffer
      byte[] getLocal​(int position, int length)
      Get data from a thread local copy of the mapped page buffer
      String getPageFile()
      The back page file name of the mapped page
      long getPageIndex()
      The index of the mapped page
      boolean isClosed()
      Check if this mapped page has been closed or not
      boolean isNew()
      Is the mapped page new or was it read from disk
      void setDirty​(boolean dirty)
      Set if the mapped page has been changed or not
    • Method Detail

      • getLocal

        ByteBuffer getLocal​(int position)
        Get a thread local copy of the mapped page buffer
        Parameters:
        position - start position(relative to the start position of source mapped page buffer) of the thread local buffer
        Returns:
        a byte buffer with specific position as start position.
      • getLocal

        byte[] getLocal​(int position,
                        int length)
        Get data from a thread local copy of the mapped page buffer
        Parameters:
        position - start position(relative to the start position of source mapped page buffer) of the thread local buffer
        length - the length to fetch
        Returns:
        byte data
      • isClosed

        boolean isClosed()
        Check if this mapped page has been closed or not
        Returns:
        returns true if closed
      • isNew

        boolean isNew()
        Is the mapped page new or was it read from disk
        Returns:
        true if no file on disk existed
      • setDirty

        void setDirty​(boolean dirty)
        Set if the mapped page has been changed or not
        Parameters:
        dirty - dirty flag to set
      • getPageFile

        String getPageFile()
        The back page file name of the mapped page
        Returns:
        name of page file
      • getPageIndex

        long getPageIndex()
        The index of the mapped page
        Returns:
        the index
      • flush

        void flush()
        Persist any changes to disk