
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
IOExceptionvoid truncate()
throws IOException
IOExceptionvoid open(String storageName, Path storagePath, int pageSize) throws IOException
IOExceptionOPointer loadPage(int fileId, int pageIndex, OByteBufferPool bufferPool) throws IOException
IOExceptionvoid restoreModeOn()
throws IOException
IOExceptionvoid restoreModeOff()
void close()
throws IOException
IOExceptionvoid startCheckpoint()
throws IOException
IOExceptionvoid endCheckpoint()
Copyright © 2009–2025 OrientDB. All rights reserved.