public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter implements IgniteWriteAheadLogManager
| Modifier and Type | Class and Description |
|---|---|
static class |
FileWriteAheadLogManager.FileDescriptor
WAL file descriptor.
|
static class |
FileWriteAheadLogManager.ReadFileHandle |
| Modifier and Type | Field and Description |
|---|---|
static FileWriteAheadLogManager.FileDescriptor[] |
EMPTY_DESCRIPTORS |
static String |
WAL_SEGMENT_FILE_EXT |
static FileFilter |
WAL_SEGMENT_FILE_FILTER
WAL segment file filter, see
WAL_NAME_PATTERN |
cctx, diagnosticLog, log| Constructor and Description |
|---|
FileWriteAheadLogManager(GridKernalContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
consistentId() |
void |
fsync(WALPointer ptr)
Makes sure that all log entries written to the log up until the specified pointer are actually persisted to
the underlying storage.
|
boolean |
isAlwaysWriteFullPages() |
boolean |
isFullSync() |
WALPointer |
log(WALRecord record)
Appends the given log entry to the write-ahead log.
|
void |
onActivate(GridKernalContext kctx)
Called when cluster performing activation.
|
void |
onDeActivate(GridKernalContext kctx)
Called when cluster performing deactivation.
|
void |
release(WALPointer start)
Invoke this method to release WAL history since provided pointer that was previously reserved.
|
WALIterator |
replay(WALPointer start)
Invoke this method to iterate over the written log entries.
|
boolean |
reserve(WALPointer start)
Invoke this method to reserve WAL history since provided pointer and prevent it's deletion.
|
boolean |
reserved(WALPointer ptr)
Checks if WAL segment is under lock or reserved
|
void |
resumeLogging(WALPointer lastPtr)
Resumes logging after start.
|
static FileWriteAheadLogManager.FileDescriptor[] |
scan(File[] allFiles) |
void |
start0() |
protected void |
stop0(boolean cancel) |
int |
truncate(WALPointer ptr)
Gives a hint to WAL manager to clear entries logged before the given pointer.
|
int |
walArchiveSegments() |
context, isStopping, kernalStartInfo, kernalStopInfo, log, onDisconnected, onKernalStop, onKernalStop0, printMemoryStats, start, startInfo, stop, stopInfo, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitonDisconnected, onKernalStop, printMemoryStats, start, stoppublic static final FileWriteAheadLogManager.FileDescriptor[] EMPTY_DESCRIPTORS
public static final String WAL_SEGMENT_FILE_EXT
public static final FileFilter WAL_SEGMENT_FILE_FILTER
WAL_NAME_PATTERNpublic FileWriteAheadLogManager(@NotNull
GridKernalContext ctx)
ctx - Kernal context.public void start0()
throws IgniteCheckedException
start0 in class GridCacheSharedManagerAdapterIgniteCheckedException - If failed.protected String consistentId()
protected void stop0(boolean cancel)
stop0 in class GridCacheSharedManagerAdaptercancel - Cancel flag.public void onActivate(GridKernalContext kctx) throws IgniteCheckedException
onActivate in interface IgniteChangeGlobalStateSupportkctx - Kernal context.IgniteCheckedException - If failed.public void onDeActivate(GridKernalContext kctx)
onDeActivate in interface IgniteChangeGlobalStateSupportkctx - Kernal context.public boolean isAlwaysWriteFullPages()
isAlwaysWriteFullPages in interface IgniteWriteAheadLogManagertrue If we have to always write full pages.public boolean isFullSync()
isFullSync in interface IgniteWriteAheadLogManagertrue if WAL will perform fair syncs on fsync call.public void resumeLogging(WALPointer lastPtr) throws IgniteCheckedException
resumeLogging in interface IgniteWriteAheadLogManagerIgniteCheckedExceptionpublic WALPointer log(WALRecord record) throws IgniteCheckedException, StorageException
log in interface IgniteWriteAheadLogManagerrecord - entry to log.IgniteWriteAheadLogManager.fsync(WALPointer) method to make sure the record is
written to the log.IgniteCheckedException - If failed to construct log entry.StorageException - If IO error occurred while writing log entry.public void fsync(WALPointer ptr) throws IgniteCheckedException, StorageException
fsync in interface IgniteWriteAheadLogManagerptr - Optional pointer to sync. If null, will sync up to the latest record.IgniteCheckedException - If failed to fsync.StorageException - If IO exception occurred during the write. If an exception is thrown from this
method, the WAL will be invalidated and the node will be stopped.public WALIterator replay(WALPointer start) throws IgniteCheckedException, StorageException
replay in interface IgniteWriteAheadLogManagerstart - Optional WAL pointer from which to start iteration.StorageException - If IO error occurred while reading WAL entries.IgniteCheckedExceptionpublic boolean reserve(WALPointer start) throws IgniteCheckedException
reserve in interface IgniteWriteAheadLogManagerstart - WAL pointer.IgniteCheckedExceptionpublic void release(WALPointer start) throws IgniteCheckedException
release in interface IgniteWriteAheadLogManagerstart - WAL pointer.IgniteCheckedExceptionpublic int truncate(WALPointer ptr)
truncate in interface IgniteWriteAheadLogManagerptr - Pointer for which it is safe to clear the log.public int walArchiveSegments()
walArchiveSegments in interface IgniteWriteAheadLogManagerpublic boolean reserved(WALPointer ptr)
reserved in interface IgniteWriteAheadLogManagerptr - Pointer to check.public static FileWriteAheadLogManager.FileDescriptor[] scan(File[] allFiles)
Follow @ApacheIgnite
Ignite Fabric : ver. 2.2.0 Release Date : September 15 2017