Interface ISqlJetPageCache

All Known Implementing Classes:
SqlJetPageCache

public interface ISqlJetPageCache
The page cache subsystem
Author:
TMate Software Ltd., Sergey Scherbina (sergey.scherbina@gmail.com)
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Mark all dirty list pages as clean Make every page in the cache clean.
    void
    Discard the contents of the cache
    void
    Clear flags from pages of the page cache
    void
    Reset and close the cache object
    void
    Remove page from cache Drop a page from the cache.
    fetch(int pageNumber, boolean createFlag)
    Try to obtain a page from the cache.
    int
    Get the cache-size for the pager-cache.
    Get a list of all dirty pages in the cache, sorted by page number
    int
    Return the total number of pages stored in the cache
    int
    Return the total number of outstanding page references
    void
    Iterate through all pages currently stored in the cache.
    void
    Make sure the page is marked as clean.
    void
    Make sure the page is marked as dirty.
    void
    move(ISqlJetPage page, int pageNumber)
    Change a page number.
    void
    open(int szPage, boolean bPurgeable, ISqlJetPageCallback xStress)
    Create a new pager cache.
    void
    Dereference a page.
    void
    setCacheSize(int cacheSize)
    Set the suggested cache-size for the pager-cache.
    void
    setPageSize(int pageSize)
    Modify the page-size after the cache has been created.
    void
    truncate(int pageNumber)
    Remove all pages with page numbers more than pageNumber.
  • Method Details

    • open

      void open(int szPage, boolean bPurgeable, ISqlJetPageCallback xStress)
      Create a new pager cache. Under memory stress, invoke xStress to try to make pages clean. Only clean and unpinned pages can be reclaimed.
      Parameters:
      szPage - Size of every page
      bPurgeable - True if pages are on backing store
      xStress - Call to try to make pages clean
      szExtra - Extra space associated with each page
      xDestroy - Called to destroy a page
    • setPageSize

      void setPageSize(int pageSize)
      Modify the page-size after the cache has been created. Change the page size for PCache object. This can only happen when the cache is empty.
      Parameters:
      pageSize -
    • fetch

      ISqlJetPage fetch(int pageNumber, boolean createFlag) throws SqlJetException
      Try to obtain a page from the cache.
      Parameters:
      createFlag - If true, create page if it does not exist already
      pgno - Page number to obtain
      Returns:
      Throws:
      SqlJetException
    • release

      void release(ISqlJetPage page)
      Dereference a page. When the reference count reaches zero, move the page to the LRU list if it is clean. One release per successful fetch. Page is pinned until released. Reference counted.
      Parameters:
      page -
    • drop

      void drop(ISqlJetPage page)
      Remove page from cache Drop a page from the cache. There must be exactly one reference to the page. This function deletes that reference, so after it returns the page pointed to by p is invalid.
      Parameters:
      page -
    • makeDirty

      void makeDirty(ISqlJetPage page)
      Make sure the page is marked as dirty. If it isn't dirty already, make it so.
      Parameters:
      page -
    • makeClean

      void makeClean(ISqlJetPage page)
      Make sure the page is marked as clean. If it isn't clean already, make it so.
      Parameters:
      page -
    • cleanAll

      void cleanAll()
      Mark all dirty list pages as clean Make every page in the cache clean.
    • move

      void move(ISqlJetPage page, int pageNumber)
      Change a page number. Used by incr-vacuum. Change the page number of page p to newPgno. If newPgno is 0, then the page object is added to the clean-list and the PGHDR_REUSE_UNLIKELY flag set.
      Parameters:
      page -
      pageNumber -
    • truncate

      void truncate(int pageNumber)
      Remove all pages with page numbers more than pageNumber. Reset the cache if pageNumber==0 Drop every cache entry whose page number is greater than "pgno".
      Parameters:
      pageNumber -
    • getDirtyList

      ISqlJetPage getDirtyList()
      Get a list of all dirty pages in the cache, sorted by page number
      Returns:
    • close

      void close()
      Reset and close the cache object
    • clearSyncFlags

      void clearSyncFlags()
      Clear flags from pages of the page cache
    • clear

      void clear()
      Discard the contents of the cache
    • getRefCount

      int getRefCount()
      Return the total number of outstanding page references
    • getPageCount

      int getPageCount()
      Return the total number of pages stored in the cache
    • iterate

      void iterate(ISqlJetPageCallback xIter) throws SqlJetException
      Iterate through all pages currently stored in the cache.
      Parameters:
      xIter -
      Throws:
      SqlJetException
    • getCachesize

      int getCachesize()
      Get the cache-size for the pager-cache.
      Returns:
    • setCacheSize

      void setCacheSize(int cacheSize)
      Set the suggested cache-size for the pager-cache. If no global maximum is configured, then the system attempts to limit the total number of pages cached by purgeable pager-caches to the sum of the suggested cache-sizes.
      Parameters:
      cacheSize -