public interface DoubleWriteLog
At the first step we perform fsync of the data to the log using single sequential write
calling write(ByteBuffer[], int[], int[])
method.
As the second step we write pages to the data files.
At third step we fsync data files in background process and then truncate log calling truncate()
method. Write to the file and truncation of data should be done in single lock to
prevent situation when data are written to the log but not to the pages and then truncated. That
is typically not a problem because write cache uses single thread model.
If during the write of pages we reach log threshold write(ByteBuffer[], int[], int[])
method will return true. If that happens fsync of pages should be called to truncate page log.
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
endCheckpoint() |
OPointer |
loadPage(int fileId,
int pageIndex,
OByteBufferPool bufferPool) |
void |
open(String storageName,
Path storagePath,
int pageSize) |
void |
restoreModeOff() |
void |
restoreModeOn() |
void |
startCheckpoint() |
void |
truncate() |
boolean |
write(ByteBuffer[] buffers,
int[] fileId,
int[] pageIndex) |
boolean write(ByteBuffer[] buffers, int[] fileId, int[] pageIndex) throws IOException
IOException
void truncate() throws IOException
IOException
void open(String storageName, Path storagePath, int pageSize) throws IOException
IOException
OPointer loadPage(int fileId, int pageIndex, OByteBufferPool bufferPool) throws IOException
IOException
void restoreModeOn() throws IOException
IOException
void restoreModeOff()
void close() throws IOException
IOException
void startCheckpoint() throws IOException
IOException
void endCheckpoint()
Copyright © 2009–2020 OrientDB. All rights reserved.