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,
long freeSpaceLimit,
int fsyncInterval,
boolean allowDirectIO,
boolean keepSingleWALSegment,
boolean callFsync,
boolean printPerformanceStatistic,
int statisticPrintInterval) |
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, long freeSpaceLimit, int fsyncInterval, boolean allowDirectIO, boolean keepSingleWALSegment, boolean callFsync, boolean printPerformanceStatistic, int statisticPrintInterval) throws IOException
IOException
public int pageSize()
protected int maxCacheSize()
public List<WriteableWALRecord> read(OLogSequenceNumber lsn, int limit) throws IOException
read
in interface OWriteAheadLog
IOException
public List<WriteableWALRecord> next(OLogSequenceNumber lsn, int limit) throws IOException
next
in interface OWriteAheadLog
IOException
public void addEventAt(OLogSequenceNumber lsn, Runnable event)
OWriteAheadLog
addEventAt
in interface OWriteAheadLog
lsn
- the LSN to fire at.event
- the event to fire.public void delete() throws IOException
delete
in interface OWriteAheadLog
IOException
public void addCutTillLimit(OLogSequenceNumber lsn)
OWriteAheadLog
addCutTillLimit
in interface OWriteAheadLog
lsn
- LSN after which cut of the WAL is not allowed.OWriteAheadLog.removeCutTillLimit(OLogSequenceNumber)
,
OWriteAheadLog.cutTill(OLogSequenceNumber)
public void removeCutTillLimit(OLogSequenceNumber lsn)
OWriteAheadLog
removeCutTillLimit
in interface OWriteAheadLog
lsn
- 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 OWriteAheadLog
public OLogSequenceNumber logAtomicOperationStartRecord(boolean isRollbackSupported, long unitId, byte[] metadata)
logAtomicOperationStartRecord
in interface OWriteAheadLog
public OLogSequenceNumber logAtomicOperationEndRecord(long operationUnitId, boolean rollback, OLogSequenceNumber startLsn, Map<String,OAtomicOperationMetadata<?>> atomicOperationMetadata)
logAtomicOperationEndRecord
in interface OWriteAheadLog
public OLogSequenceNumber logFuzzyCheckPointStart(OLogSequenceNumber flushedLsn)
logFuzzyCheckPointStart
in interface OWriteAheadLog
public OLogSequenceNumber logFuzzyCheckPointEnd()
logFuzzyCheckPointEnd
in interface OWriteAheadLog
public OLogSequenceNumber logFullCheckpointStart()
logFullCheckpointStart
in interface OWriteAheadLog
public OLogSequenceNumber logFullCheckpointEnd()
logFullCheckpointEnd
in interface OWriteAheadLog
public OLogSequenceNumber getLastCheckpoint()
getLastCheckpoint
in interface OWriteAheadLog
public OLogSequenceNumber log(WriteableWALRecord writeableRecord)
log
in interface OWriteAheadLog
public OLogSequenceNumber begin()
begin
in interface OWriteAheadLog
public OLogSequenceNumber begin(long segmentId)
begin
in interface OWriteAheadLog
public boolean cutAllSegmentsSmallerThan(long segmentId) throws IOException
cutAllSegmentsSmallerThan
in interface OWriteAheadLog
IOException
public boolean cutTill(OLogSequenceNumber lsn) throws IOException
OWriteAheadLog
OWriteAheadLog.addCutTillLimit(OLogSequenceNumber)
then "protected" part of WAL will be preserved for sure.cutTill
in interface OWriteAheadLog
lsn
- Maximum value of LSN till WAL will be cut.true
if some portion of WAL will be cut and false
if WAL left
untouched.IOException
public long activeSegment()
activeSegment
in interface OWriteAheadLog
public boolean appendNewSegment()
OWriteAheadLog
appendNewSegment
in interface OWriteAheadLog
true
if new segment is added, and false
otherwise.public void appendSegment(long segmentIndex)
public Path getWMRFile()
public void moveLsnAfter(OLogSequenceNumber lsn)
OWriteAheadLog
moveLsnAfter
in interface OWriteAheadLog
public long[] nonActiveSegments()
nonActiveSegments
in interface OWriteAheadLog
public File[] nonActiveSegments(long fromSegment)
nonActiveSegments
in interface OWriteAheadLog
public void flush()
flush
in interface OWriteAheadLog
public void close() throws IOException
close
in interface OWriteAheadLog
IOException
public void close(boolean flush) throws IOException
close
in interface OWriteAheadLog
IOException
public void addLowDiskSpaceListener(OLowDiskSpaceListener listener)
addLowDiskSpaceListener
in interface OWriteAheadLog
public void removeLowDiskSpaceListener(OLowDiskSpaceListener listener)
removeLowDiskSpaceListener
in interface OWriteAheadLog
public void addFullCheckpointListener(OCheckpointRequestListener listener)
addFullCheckpointListener
in interface OWriteAheadLog
public void removeFullCheckpointListener(OCheckpointRequestListener listener)
removeFullCheckpointListener
in interface OWriteAheadLog
public void addSegmentOverflowListener(SegmentOverflowListener listener)
public OLogSequenceNumber getFlushedLsn()
getFlushedLsn
in interface OWriteAheadLog
public OLogSequenceNumber end()
end
in interface OWriteAheadLog
Copyright © 2009–2020 OrientDB. All rights reserved.