public class OMemoryWriteAheadLog extends OAbstractWriteAheadLog
MASTER_RECORD_EXTENSION, WAL_SEGMENT_EXTENSION
Constructor and Description |
---|
OMemoryWriteAheadLog() |
Modifier and Type | Method and Description |
---|---|
long |
activeSegment() |
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.
|
void |
addFullCheckpointListener(OCheckpointRequestListener listener) |
void |
addLowDiskSpaceListener(OLowDiskSpaceListener listener) |
boolean |
appendNewSegment()
Adds new segment so all subsequent log entries will be added to this new segment.
|
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() |
OLogSequenceNumber |
log(WriteableWALRecord record) |
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) |
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) |
List<WriteableWALRecord> |
read(OLogSequenceNumber lsn,
int limit) |
void |
removeCutTillLimit(OLogSequenceNumber lsn)
Removes LSN after which WAL log should be preserved.
|
void |
removeFullCheckpointListener(OCheckpointRequestListener listener) |
void |
removeLowDiskSpaceListener(OLowDiskSpaceListener listener) |
checkForClose, getLastCheckpoint, logFullCheckpointEnd, logFullCheckpointStart, logFuzzyCheckPointEnd, logFuzzyCheckPointStart
public OLogSequenceNumber begin()
public OLogSequenceNumber end()
public void flush()
public OLogSequenceNumber logAtomicOperationStartRecord(boolean isRollbackSupported, long unitId)
public OLogSequenceNumber logAtomicOperationStartRecord(boolean isRollbackSupported, long unitId, byte[] metadata)
public OLogSequenceNumber logAtomicOperationEndRecord(long operationUnitId, boolean rollback, OLogSequenceNumber startLsn, Map<String,OAtomicOperationMetadata<?>> atomicOperationMetadata)
public OLogSequenceNumber log(WriteableWALRecord record)
public void close() throws IOException
IOException
public void close(boolean flush) throws IOException
IOException
public void delete() throws IOException
IOException
public List<WriteableWALRecord> read(OLogSequenceNumber lsn, int limit) throws IOException
IOException
public List<WriteableWALRecord> next(OLogSequenceNumber lsn, int limit)
public OLogSequenceNumber getFlushedLsn()
public boolean cutTill(OLogSequenceNumber lsn)
OWriteAheadLog
OWriteAheadLog.addCutTillLimit(OLogSequenceNumber)
then "protected" part of WAL will be preserved for sure.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.public void addFullCheckpointListener(OCheckpointRequestListener listener)
public void removeFullCheckpointListener(OCheckpointRequestListener listener)
public void moveLsnAfter(OLogSequenceNumber lsn)
OWriteAheadLog
public void addCutTillLimit(OLogSequenceNumber lsn)
OWriteAheadLog
lsn
- LSN after which cut of the WAL is not allowed.OWriteAheadLog.removeCutTillLimit(OLogSequenceNumber)
,
OWriteAheadLog.cutTill(OLogSequenceNumber)
public void removeCutTillLimit(OLogSequenceNumber lsn)
OWriteAheadLog
lsn
- LSN after which cut of the WAL is not allowed.OWriteAheadLog.removeCutTillLimit(OLogSequenceNumber)
,
OWriteAheadLog.cutTill(OLogSequenceNumber)
public File[] nonActiveSegments(long fromSegment)
public long[] nonActiveSegments()
public long activeSegment()
public void addLowDiskSpaceListener(OLowDiskSpaceListener listener)
public void removeLowDiskSpaceListener(OLowDiskSpaceListener listener)
public OLogSequenceNumber begin(long segmentId)
public boolean cutAllSegmentsSmallerThan(long segmentId)
public void addEventAt(OLogSequenceNumber lsn, Runnable event)
OWriteAheadLog
lsn
- the LSN to fire at.event
- the event to fire.public boolean appendNewSegment()
OWriteAheadLog
true
if new segment is added, and false
otherwise.Copyright © 2009–2020 OrientDB. All rights reserved.