public class SegmentAware extends Object
| Constructor and Description |
|---|
SegmentAware(int walSegmentsCnt,
boolean compactionEnabled) |
| Modifier and Type | Method and Description |
|---|---|
void |
awaitSegment(long absSegIdx)
Waiting until current WAL index will be greater or equal than given one.
|
void |
awaitSegmentArchived(long awaitIdx)
Method will wait activation of particular WAL segment index.
|
boolean |
checkCanReadArchiveOrReserveWorkSegment(long absIdx) |
long |
curAbsWalIdx() |
void |
curAbsWalIdx(long curAbsWalIdx)
Update current WAL index.
|
void |
forceInterrupt()
Interrupt waiting on related objects.
|
void |
interrupt()
Interrupt waiting on related objects.
|
long |
keepUncompressedIdxFrom() |
void |
keepUncompressedIdxFrom(long idx) |
long |
lastArchivedAbsoluteIndex() |
long |
lastCompressedIdx() |
long |
lastTruncatedArchiveIdx() |
void |
lastTruncatedArchiveIdx(long lastTruncatedArchiveIdx) |
boolean |
locked(long absIdx)
Check if WAL segment locked (protected from move to archive)
|
void |
markAsMovedToArchive(long toArchive)
Mark segment as moved to archive under lock.
|
long |
nextAbsoluteSegmentIndex()
Calculate next segment index or wait if needed.
|
void |
onSegmentCompressed(long compressedIdx)
Callback after segment compression finish.
|
void |
release(long absIdx) |
void |
releaseWorkSegment(long absIdx) |
void |
reserve(long absIdx) |
boolean |
reserved(long absIdx)
Checks if segment is currently reserved (protected from deletion during WAL cleanup).
|
void |
reset()
Reset interrupted flag.
|
void |
setLastArchivedAbsoluteIndex(long lastAbsArchivedIdx) |
long |
waitNextSegmentForArchivation()
Waiting until archivation of next segment will be allowed.
|
long |
waitNextSegmentToCompress()
Pessimistically tries to reserve segment for compression in order to avoid concurrent truncation.
|
public SegmentAware(int walSegmentsCnt,
boolean compactionEnabled)
walSegmentsCnt - Total WAL segments count.compactionEnabled - Is wal compaction enabled.public void awaitSegment(long absSegIdx)
throws IgniteInterruptedCheckedException
absSegIdx - Target WAL index.IgniteInterruptedCheckedExceptionpublic long nextAbsoluteSegmentIndex()
throws IgniteInterruptedCheckedException
IgniteInterruptedCheckedExceptionpublic long curAbsWalIdx()
public long waitNextSegmentForArchivation()
throws IgniteInterruptedCheckedException
public void markAsMovedToArchive(long toArchive)
throws IgniteInterruptedCheckedException
toArchive - Segment which was should be moved to archive.IgniteInterruptedCheckedException - if interrupted during waiting.public void awaitSegmentArchived(long awaitIdx)
throws IgniteInterruptedCheckedException
awaitIdx - absolute index lastArchivedAbsoluteIndex() to become true.IgniteInterruptedCheckedException - if interrupted.public long waitNextSegmentToCompress()
throws IgniteInterruptedCheckedException
public void onSegmentCompressed(long compressedIdx)
compressedIdx - Index of compressed segment.public long lastCompressedIdx()
public void keepUncompressedIdxFrom(long idx)
idx - Minimum raw segment index that should be preserved from deletion.public long keepUncompressedIdxFrom()
public void curAbsWalIdx(long curAbsWalIdx)
curAbsWalIdx - New current WAL index.public void lastTruncatedArchiveIdx(long lastTruncatedArchiveIdx)
lastTruncatedArchiveIdx - Last truncated segment;public long lastTruncatedArchiveIdx()
public void setLastArchivedAbsoluteIndex(long lastAbsArchivedIdx)
lastAbsArchivedIdx - New value of last archived segment index.public long lastArchivedAbsoluteIndex()
public void reserve(long absIdx)
absIdx - Index for reservation.public boolean reserved(long absIdx)
absIdx - Index for check reservation.True if index is reserved.public void release(long absIdx)
absIdx - Reserved index.public boolean locked(long absIdx)
absIdx - Index for check reservation.True if index is locked.public boolean checkCanReadArchiveOrReserveWorkSegment(long absIdx)
absIdx - Segment absolute index.True if can read, no lock is held, false if work segment, need release
segment later, use releaseWorkSegment(long) for unlockpublic void releaseWorkSegment(long absIdx)
absIdx - Segment absolute index.public void reset()
public void interrupt()
public void forceInterrupt()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.9.0 Release Date : October 15 2020