Interface PageMemory

All Known Implementing Classes:
PageMemoryImpl

public interface PageMemory
Page memory accessor.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    acquirePage(int grpId, int pageId, int tag)
    Gets the page absolute pointer associated with the given page ID.
    long
    acquirePage(int grpId, int pageId, int tag, boolean restore)
    Gets the page absolute pointer associated with the given page ID.
    int
    allocatePage(int grpId, int tag)
    Allocates a page from the space for the given partition ID and the given flags.
    void
    Begins a checkpoint.
    void
    Finishes a checkpoint.
    boolean
    isDirty(int grpId, int pageId, long page)
     
    int
    metaPageId(int grpId)
    Gets or allocates metadata page for specified grpId.
    long
    readLock(int grpId, int pageId, long absPtr, int tag, boolean touch)
     
    void
    readUnlock(int grpId, int pageId, long absPtr)
    Releases locked page.
    void
    Reduces memory footprint.
    void
    releasePage(int grpId, int pageId, long absPtr)
     
    void
    Runs a checkpoint.
    boolean
    Heuristic method which allows a thread to check if it safe to start memory struture modifications in regard with checkpointing.
    void
    Start page memory.
    void
    startStore(int grpId, int metaPageTag, Path path, boolean restorationMode)
    Starts the store with the specified ID.
    void
    Stop page memory.
    void
    stopStore(int grpId, boolean freePages)
    Stops the store with the specified ID.
    long
    Total pages can be placed to memory.
    long
    tryWriteLock(int grpId, int pageId, long absPtr, int tag)
     
    long
    writeLock(int grpId, int pageId, long absPtr, int tag)
     
    void
    writeUnlock(int grpId, int pageId, long absPtr, boolean modified, int tag)
     
  • Field Details

  • Method Details

    • start

      void start() throws IgniteCheckedException
      Start page memory.
      Throws:
      IgniteCheckedException
    • stop

      void stop() throws IgniteCheckedException
      Stop page memory.
      Throws:
      IgniteException
      IgniteCheckedException
    • startStore

      void startStore(int grpId, int metaPageTag, Path path, boolean restorationMode) throws IgniteCheckedException
      Starts the store with the specified ID.
      Parameters:
      grpId - Group ID.
      metaPageTag - Meta-page tag.
      path - Store path.
      restorationMode - Flag indicating restoration mode.
      Throws:
      IgniteCheckedException
    • stopStore

      void stopStore(int grpId, boolean freePages) throws IgniteCheckedException
      Stops the store with the specified ID.
      Parameters:
      grpId -
      freePages -
      Throws:
      IgniteCheckedException
    • totalPages

      long totalPages()
      Total pages can be placed to memory.
    • allocatePage

      int allocatePage(int grpId, int tag) throws IgniteCheckedException
      Allocates a page from the space for the given partition ID and the given flags.
      Parameters:
      storeId - Group ID.
      tag - Tag.
      Returns:
      page ID within the store.
      Throws:
      IgniteCheckedException - If failed.
    • metaPageId

      int metaPageId(int grpId) throws IgniteCheckedException
      Gets or allocates metadata page for specified grpId.
      Parameters:
      grpId - Group ID.
      Returns:
      Meta page ID for the store.
      Throws:
      IgniteCheckedException - If failed.
    • acquirePage

      long acquirePage(int grpId, int pageId, int tag) throws IgniteCheckedException
      Gets the page absolute pointer associated with the given page ID. Each page obtained with this method must be released by calling #releasePage(int, long, long).

      An invocation of this method behaves exactly like the invocation acquirePage(grpId, pageId, false).

      Parameters:
      grpId - Group ID.
      pageId - Page ID.
      tag - Tag.
      Returns:
      Page pointer.
      Throws:
      IgniteCheckedException - If failed.
    • acquirePage

      long acquirePage(int grpId, int pageId, int tag, boolean restore) throws IgniteCheckedException
      Gets the page absolute pointer associated with the given page ID. Each page obtained with this method must be released by calling #releasePage(int, long, long).
      Parameters:
      grpId - Group ID.
      pageId - Page ID.
      tag - Tag.
      restore - Whether the page is acquired for restoration.
      Returns:
      Page pointer.
      Throws:
      IgniteCheckedException - If failed.
    • releasePage

      void releasePage(int grpId, int pageId, long absPtr)
      Parameters:
      grpId - Group ID.
      pageId - Page ID to release.
      absPtr - Page pointer.
    • readLock

      long readLock(int grpId, int pageId, long absPtr, int tag, boolean touch)
      Parameters:
      absPtr - Absolute pointer to read lock.
      pageId - Page ID.
      force - Force flag.
      tag - Tag.
      touch - Update page timestamp.
      Returns:
      Pointer to the page read buffer.
    • readUnlock

      void readUnlock(int grpId, int pageId, long absPtr)
      Releases locked page.
      Parameters:
      grpId - Cache group ID.
      pageId - Page ID.
      absPtr - Page pointer.
    • writeLock

      long writeLock(int grpId, int pageId, long absPtr, int tag)
      Parameters:
      grpId - Group ID.
      pageId - Page ID.
      absPtr - Absolute pointer to read lock.
      tag - Tag.
      Returns:
      Pointer to the page read buffer.
    • tryWriteLock

      long tryWriteLock(int grpId, int pageId, long absPtr, int tag)
      Parameters:
      grpId - Group ID.
      pageId - Page ID.
      absPtr - Absolute pointer to read lock.
      tag - Tag.
      Returns:
      Pointer to the page read buffer.
    • writeUnlock

      void writeUnlock(int grpId, int pageId, long absPtr, boolean modified, int tag)
      Parameters:
      grpId - Group ID.
      pageId - Page ID.
      absPtr - Absolute pointer to read lock.
      modified - Flag indicating whether the page was modified.
      tag - Tag.
    • isDirty

      boolean isDirty(int grpId, int pageId, long page)
      Parameters:
      grpId - Cache group ID.
      pageId - Page ID.
      page - Page pointer.
      Returns:
      true if the page is dirty.
    • beginCheckpoint

      void beginCheckpoint()
      Begins a checkpoint.
    • runCheckpoint

      void runCheckpoint() throws IgniteCheckedException
      Runs a checkpoint.
      Parameters:
      handle -
      Throws:
      IgniteCheckedException
    • finishCheckpoint

      void finishCheckpoint()
      Finishes a checkpoint.
      Parameters:
      handle -
    • safeToUpdate

      boolean safeToUpdate()
      Heuristic method which allows a thread to check if it safe to start memory struture modifications in regard with checkpointing. May return false-negative result during or after partition eviction.
      Returns:
      False if there are too many dirty pages and a thread should wait for a checkpoint to begin.
    • reduceMemoryFootprint

      void reduceMemoryFootprint() throws IgniteCheckedException
      Reduces memory footprint.
      Throws:
      IgniteCheckedException