public interface PageSwapper
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close and release all resources associated with the file underlying this
PageSwapper.
|
void |
evicted(long pageId,
Page page)
Notification that a page has been evicted, used to clean up state in structures
outside the page table.
|
File |
file()
Get the file that this PageSwapper represents.
|
void |
force()
Forces all writes done by this PageSwapper to the underlying storage device, such that the writes are durable
when this call returns.
|
long |
getLastPageId()
Get the filePageId of the last page in the concrete file.
|
long |
read(long filePageId,
Page page)
Read the page with the given filePageId, from the concrete file on the
file system, into the given page.
|
long |
read(long startFilePageId,
Page[] pages,
int arrayOffset,
int length)
Read pages from the file into the given pages, starting from the given startFilePageId.
|
void |
truncate()
Truncate the file represented by this PageSwapper, so the size of the file is zero and
getLastPageId() returns -1. |
long |
write(long filePageId,
Page page)
Write the contents of the given page, to the concrete file on the file
system, at the located indicated by the given filePageId.
|
long |
write(long startFilePageId,
Page[] pages,
int arrayOffset,
int length)
Write the contents of the given pages, to the concrete file on the file system,
starting at the location of the given startFilePageId.
|
long read(long filePageId,
Page page)
throws IOException
IOExceptionlong read(long startFilePageId,
Page[] pages,
int arrayOffset,
int length)
throws IOException
IOExceptionlong write(long filePageId,
Page page)
throws IOException
IOExceptionlong write(long startFilePageId,
Page[] pages,
int arrayOffset,
int length)
throws IOException
IOExceptionvoid evicted(long pageId,
Page page)
File file()
void close()
throws IOException
IOExceptionvoid force()
throws IOException
PageSwapperFactory.syncDevice() method forces the writes for all
non-closed PageSwappers created through the given PageSwapperFactory.
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.IOExceptionlong getLastPageId()
throws IOException
IOExceptionvoid truncate()
throws IOException
getLastPageId() returns -1.
Truncation may occur concurrently with writes, in which case both operations will appear to be atomic, such that
either the write happens before the truncation and is lost, or the file is truncated and the write then extends
the file with any zero padding and the written data.IOExceptionCopyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.