public interface PageSwapperFactory
| Modifier and Type | Method and Description |
|---|---|
PageSwapper |
createPageSwapper(File file,
int filePageSize,
PageEvictionCallback onEviction,
boolean createIfNotExist)
Create a PageSwapper for the given file.
|
int |
getCachePageSizeHint()
Get the most optimal cache page size (in bytes) for these PageSwapper implementations.
|
long |
getRequiredBufferAlignment()
Get the unit of alignment that the swappers require of the memory buffers.
|
String |
implementationName()
Get the name of this PageSwapperFactory implementation, for configuration purpose.
|
boolean |
isCachePageSizeHintStrict()
Gives
true if the getCachePageSizeHint() is the only cache page size that is supported for
these PageSwapper implementations, otherwise false. |
void |
setFileSystemAbstraction(FileSystemAbstraction fs)
Configure the FileSystemAbstraction to use.
|
void |
syncDevice()
Forces all prior writes made through all non-closed PageSwappers that this factory has created, to all the
relevant devices, such that the writes are durable when this call returns.
|
void setFileSystemAbstraction(FileSystemAbstraction fs)
String implementationName()
int getCachePageSizeHint()
boolean isCachePageSizeHintStrict()
true if the getCachePageSizeHint() is the only cache page size that is supported for
these PageSwapper implementations, otherwise false.long getRequiredBufferAlignment()
UnsafeUtil.pageSize() can be
returned.PageSwapper createPageSwapper(File file, int filePageSize, PageEvictionCallback onEviction, boolean createIfNotExist) throws IOException
file - The file that the PageSwapper will move file pages in and
out of.filePageSize - The size of the pages in the file. Presumably a
multiple of some record size.onEviction - The PageSwapper will be told about evictions, and has
the responsibility of informing the PagedFile via this callback.createIfNotExist - When true, creates the given file if it does not exist, instead of throwing an exception.IOException - If the PageSwapper could not be created, for
instance if the underlying file could not be opened, or the given file does not exist and createIfNotExist is
false.void syncDevice()
throws IOException
PageSwapper.force() method forces the writes for the individual file.
The PageCache.flushAndForce() method will first call force on the PageSwappers for all
mapped files, then call syncDevice on the PageSwapperFactory. This way, the writes are always made
durable regardless of which method that does the forcing.IOExceptionCopyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.