
public final class CASDiskWriteAheadLog extends Object implements OWriteAheadLog
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DEFAULT_MAX_CACHE_SIZE |
MASTER_RECORD_EXTENSION, WAL_SEGMENT_EXTENSION| Constructor and Description |
|---|
CASDiskWriteAheadLog(String storageName,
Path storagePath,
Path walPath,
int maxPagesCacheSize,
int bufferSize,
byte[] aesKey,
byte[] iv,
long segmentsInterval,
long maxSegmentSize,
int commitDelay,
boolean filterWALFiles,
Locale locale,
long walSizeHardLimit,
int fsyncInterval,
boolean keepSingleWALSegment,
boolean callFsync,
boolean printPerformanceStatistic,
int statisticPrintInterval) |
| Modifier and Type | Method and Description |
|---|---|
long |
activeSegment() |
void |
addCheckpointListener(OCheckpointRequestListener listener) |
void |
addCutTillLimit(OLogSequenceNumber lsn)
Adds LSN after which WAL log should be preserved.
|
void |
addEventAt(OLogSequenceNumber lsn,
Runnable event)
Adds the event to fire when this write ahead log instances reaches the given LSN.
|
boolean |
appendNewSegment()
Adds new segment so all subsequent log entries will be added to this new segment.
|
void |
appendSegment(long segmentIndex) |
OLogSequenceNumber |
begin() |
OLogSequenceNumber |
begin(long segmentId) |
void |
close() |
void |
close(boolean flush) |
boolean |
cutAllSegmentsSmallerThan(long segmentId) |
boolean |
cutTill(OLogSequenceNumber lsn)
Cut WAL content till passed in value of LSN at maximum in many cases smaller portion of WAL may
be cut.
|
void |
delete() |
OLogSequenceNumber |
end() |
void |
flush() |
OLogSequenceNumber |
getFlushedLsn() |
List<String> |
getWalFiles() |
OLogSequenceNumber |
log(WriteableWALRecord writeableRecord) |
OLogSequenceNumber |
logAtomicOperationEndRecord(long operationUnitId,
boolean rollback,
OLogSequenceNumber startLsn,
Map<String,OAtomicOperationMetadata<?>> atomicOperationMetadata) |
OLogSequenceNumber |
logAtomicOperationStartRecord(boolean isRollbackSupported,
long unitId) |
OLogSequenceNumber |
logAtomicOperationStartRecord(boolean isRollbackSupported,
long unitId,
byte[] metadata) |
protected int |
maxCacheSize() |
void |
moveLsnAfter(OLogSequenceNumber lsn)
Next LSN generated by WAL will be bigger than passed in value.
|
List<WriteableWALRecord> |
next(OLogSequenceNumber lsn,
int limit) |
long[] |
nonActiveSegments() |
File[] |
nonActiveSegments(long fromSegment) |
int |
pageSize() |
List<WriteableWALRecord> |
read(OLogSequenceNumber lsn,
int limit) |
void |
removeCheckpointListener(OCheckpointRequestListener listener) |
void |
removeCutTillLimit(OLogSequenceNumber lsn)
Removes LSN after which WAL log should be preserved.
|
protected static final int DEFAULT_MAX_CACHE_SIZE
public CASDiskWriteAheadLog(String storageName, Path storagePath, Path walPath, int maxPagesCacheSize, int bufferSize, byte[] aesKey, byte[] iv, long segmentsInterval, long maxSegmentSize, int commitDelay, boolean filterWALFiles, Locale locale, long walSizeHardLimit, int fsyncInterval, boolean keepSingleWALSegment, boolean callFsync, boolean printPerformanceStatistic, int statisticPrintInterval) throws IOException
IOExceptionpublic int pageSize()
protected int maxCacheSize()
public List<WriteableWALRecord> read(OLogSequenceNumber lsn, int limit) throws IOException
read in interface OWriteAheadLogIOExceptionpublic List<WriteableWALRecord> next(OLogSequenceNumber lsn, int limit) throws IOException
next in interface OWriteAheadLogIOExceptionpublic void addEventAt(OLogSequenceNumber lsn, Runnable event)
OWriteAheadLogaddEventAt in interface OWriteAheadLoglsn - the LSN to fire at.event - the event to fire.public void delete()
throws IOException
delete in interface OWriteAheadLogIOExceptionpublic void addCutTillLimit(OLogSequenceNumber lsn)
OWriteAheadLogaddCutTillLimit in interface OWriteAheadLoglsn - LSN after which cut of the WAL is not allowed.OWriteAheadLog.removeCutTillLimit(OLogSequenceNumber),
OWriteAheadLog.cutTill(OLogSequenceNumber)public void removeCutTillLimit(OLogSequenceNumber lsn)
OWriteAheadLogremoveCutTillLimit in interface OWriteAheadLoglsn - LSN after which cut of the WAL is not allowed.OWriteAheadLog.removeCutTillLimit(OLogSequenceNumber),
OWriteAheadLog.cutTill(OLogSequenceNumber)public OLogSequenceNumber logAtomicOperationStartRecord(boolean isRollbackSupported, long unitId)
logAtomicOperationStartRecord in interface OWriteAheadLogpublic OLogSequenceNumber logAtomicOperationStartRecord(boolean isRollbackSupported, long unitId, byte[] metadata)
logAtomicOperationStartRecord in interface OWriteAheadLogpublic OLogSequenceNumber logAtomicOperationEndRecord(long operationUnitId, boolean rollback, OLogSequenceNumber startLsn, Map<String,OAtomicOperationMetadata<?>> atomicOperationMetadata)
logAtomicOperationEndRecord in interface OWriteAheadLogpublic OLogSequenceNumber log(WriteableWALRecord writeableRecord)
log in interface OWriteAheadLogpublic OLogSequenceNumber begin()
begin in interface OWriteAheadLogpublic OLogSequenceNumber begin(long segmentId)
begin in interface OWriteAheadLogpublic boolean cutAllSegmentsSmallerThan(long segmentId)
throws IOException
cutAllSegmentsSmallerThan in interface OWriteAheadLogIOExceptionpublic boolean cutTill(OLogSequenceNumber lsn) throws IOException
OWriteAheadLogOWriteAheadLog.addCutTillLimit(OLogSequenceNumber) then "protected" part of WAL will be preserved for sure.cutTill in interface OWriteAheadLoglsn - Maximum value of LSN till WAL will be cut.true if some portion of WAL will be cut and false if WAL left
untouched.IOExceptionpublic long activeSegment()
activeSegment in interface OWriteAheadLogpublic boolean appendNewSegment()
OWriteAheadLogappendNewSegment in interface OWriteAheadLogtrue if new segment is added, and false otherwise.public void appendSegment(long segmentIndex)
public void moveLsnAfter(OLogSequenceNumber lsn)
OWriteAheadLogmoveLsnAfter in interface OWriteAheadLogpublic long[] nonActiveSegments()
nonActiveSegments in interface OWriteAheadLogpublic File[] nonActiveSegments(long fromSegment)
nonActiveSegments in interface OWriteAheadLogpublic void flush()
flush in interface OWriteAheadLogpublic void close()
throws IOException
close in interface OWriteAheadLogIOExceptionpublic void close(boolean flush)
throws IOException
close in interface OWriteAheadLogIOExceptionpublic void addCheckpointListener(OCheckpointRequestListener listener)
addCheckpointListener in interface OWriteAheadLogpublic void removeCheckpointListener(OCheckpointRequestListener listener)
removeCheckpointListener in interface OWriteAheadLogpublic OLogSequenceNumber getFlushedLsn()
getFlushedLsn in interface OWriteAheadLogpublic OLogSequenceNumber end()
end in interface OWriteAheadLogCopyright © 2009–2025 OrientDB. All rights reserved.