Interface ISqlJetPageCache
- All Known Implementing Classes:
SqlJetPageCache
public interface ISqlJetPageCache
The page cache subsystem
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanAll()
Mark all dirty list pages as clean Make every page in the cache clean.void
clear()
Discard the contents of the cachevoid
Clear flags from pages of the page cachevoid
close()
Reset and close the cache objectvoid
drop
(ISqlJetPage page) 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 numberint
Return the total number of pages stored in the cacheint
Return the total number of outstanding page referencesvoid
iterate
(ISqlJetPageCallback xIter) Iterate through all pages currently stored in the cache.void
makeClean
(ISqlJetPage page) Make sure the page is marked as clean.void
makeDirty
(ISqlJetPage page) 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
release
(ISqlJetPage page) 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
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 pagebPurgeable
- True if pages are on backing storexStress
- Call to try to make pages cleanszExtra
- Extra space associated with each pagexDestroy
- 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
Try to obtain a page from the cache.- Parameters:
createFlag
- If true, create page if it does not exist alreadypgno
- Page number to obtain- Returns:
- Throws:
SqlJetException
-
release
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
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
Make sure the page is marked as dirty. If it isn't dirty already, make it so.- Parameters:
page
-
-
makeClean
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
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
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
-
-