Class CacheFile
Database using the Database.getCacheFile.-
Method Summary
Modifier and TypeMethodDescriptionlongReturn the maximum size for the file backing the database, or 0 if no maximum file size has been configured.booleanReturn true if the opening of backing temporary files for in-memory databases has been disallowed.Return the cache priority for pages from the specified file.booleanReturn true if the file will be removed when the last reference to it is closed.voidsetMaximumSize(long bytes) Set the maximum size for the file backing the database.voidsetNoFile(boolean onoff) Disallow opening backing temporary files for in-memory databases, even if they expand to fill the entire cache.voidsetPriority(CacheFilePriority priority) Set the cache priority for pages from the specified file.voidsetUnlink(boolean onoff) Remove the file when the last reference to it is closed.
-
Method Details
-
getPriority
Return the cache priority for pages from the specified file.This method may be called at any time during the life of the application.
- Returns:
- The cache priority for pages from the specified file.
- Throws:
DatabaseException- if a failure occurs.
-
setPriority
Set the cache priority for pages from the specified file.The priority of a page biases the replacement algorithm to be more or less likely to discard a page when space is needed in the buffer pool. The bias is temporary, and pages will eventually be discarded if they are not referenced again. Setting the priority is only advisory, and does not guarantee pages will be treated in a specific way.
This method may be called at any time during the life of the application.
- Parameters:
priority- The cache priority for pages from the specified file.- Throws:
DatabaseException- if a failure occurs.
-
getMaximumSize
Return the maximum size for the file backing the database, or 0 if no maximum file size has been configured.This method may be called at any time during the life of the application.
- Returns:
- The maximum size for the file backing the database, or 0 if
no maximum file size has been configured.
- Throws:
DatabaseException- if a failure occurs.
-
setMaximumSize
Set the maximum size for the file backing the database.Attempts to allocate new pages in the file after the limit has been reached will fail.
This method may be called at any time during the life of the application.
- Parameters:
bytes- The maximum size for the file backing the database.- Throws:
DatabaseException- if a failure occurs.
-
getNoFile
Return true if the opening of backing temporary files for in-memory databases has been disallowed.This method may be called at any time during the life of the application.
- Returns:
- True if the opening of backing temporary files for in-memory
databases has been disallowed.
- Throws:
DatabaseException- if a failure occurs.
-
setNoFile
Disallow opening backing temporary files for in-memory databases, even if they expand to fill the entire cache.Attempts to create new file pages after the cache has been filled will fail.
This method may be called at any time during the life of the application.
- Parameters:
onoff- If true, disallow opening backing temporary files for in-memory databases, even if they expand to fill the entire cache.- Throws:
DatabaseException- if a failure occurs.
-
getUnlink
Return true if the file will be removed when the last reference to it is closed.This method may be called at any time during the life of the application.
- Returns:
- True if the file will be removed when the last reference to it is
closed.
- Throws:
DatabaseException- if a failure occurs.
-
setUnlink
Remove the file when the last reference to it is closed.This method may be called at any time during the life of the application.
- Parameters:
onoff- If true, remove the file when the last reference to it is closed.- Throws:
DatabaseException- if a failure occurs.
-