public class CommitLogReplayer extends java.lang.Object implements CommitLogReadHandler
Modifier and Type | Class and Description |
---|---|
static class |
CommitLogReplayer.CommitLogReplayException |
static class |
CommitLogReplayer.MutationInitiator |
CommitLogReadHandler.CommitLogReadErrorReason, CommitLogReadHandler.CommitLogReadException
Modifier and Type | Field and Description |
---|---|
protected CommitLogReader |
commitLogReader |
static long |
MAX_OUTSTANDING_REPLAY_BYTES |
static CommitLogReplayer.MutationInitiator |
mutationInitiator |
protected boolean |
sawCDCMutation |
Modifier and Type | Method and Description |
---|---|
int |
blockForWrites()
Flushes all keyspaces associated with this replayer in parallel, blocking until their flushes are complete.
|
static CommitLogReplayer |
construct(CommitLog commitLog,
java.util.UUID localHostId) |
static CommitLogPosition |
firstNotCovered(java.util.Collection<IntervalSet<CommitLogPosition>> ranges)
Find the earliest commit log position that is not covered by the known flushed ranges for some table.
|
void |
handleMutation(Mutation m,
int size,
int entryLocation,
CommitLogDescriptor desc)
Process a deserialized mutation
|
void |
handleUnrecoverableError(CommitLogReadHandler.CommitLogReadException exception)
The logic for whether or not we throw on an error is identical for the replayer between recoverable or non.
|
static IntervalSet<CommitLogPosition> |
persistedIntervals(java.lang.Iterable<SSTableReader> onDisk,
CommitLogPosition truncatedAt,
java.util.UUID localhostId)
A set of known safe-to-discard commit log replay positions, based on
the range covered by on disk sstables and those prior to the most recent truncation record
|
protected boolean |
pointInTimeExceeded(Mutation fm) |
void |
replayFiles(java.io.File[] clogs) |
void |
replayPath(java.io.File file,
boolean tolerateTruncation) |
boolean |
shouldSkipSegmentOnError(CommitLogReadHandler.CommitLogReadException exception)
Handle an error during segment read, signaling whether or not you want the reader to skip the remainder of the
current segment on error.
|
public static long MAX_OUTSTANDING_REPLAY_BYTES
public static CommitLogReplayer.MutationInitiator mutationInitiator
protected boolean sawCDCMutation
protected CommitLogReader commitLogReader
public static CommitLogReplayer construct(CommitLog commitLog, java.util.UUID localHostId)
public void replayPath(java.io.File file, boolean tolerateTruncation) throws java.io.IOException
java.io.IOException
public void replayFiles(java.io.File[] clogs) throws java.io.IOException
java.io.IOException
public int blockForWrites()
public static IntervalSet<CommitLogPosition> persistedIntervals(java.lang.Iterable<SSTableReader> onDisk, CommitLogPosition truncatedAt, java.util.UUID localhostId)
public static CommitLogPosition firstNotCovered(java.util.Collection<IntervalSet<CommitLogPosition>> ranges)
protected boolean pointInTimeExceeded(Mutation fm)
public void handleMutation(Mutation m, int size, int entryLocation, CommitLogDescriptor desc)
CommitLogReadHandler
handleMutation
in interface CommitLogReadHandler
m
- deserialized mutationsize
- serialized size of the mutationentryLocation
- filePointer offset inside the CommitLogSegment for the end of the recorddesc
- CommitLogDescriptor for mutation being processedpublic boolean shouldSkipSegmentOnError(CommitLogReadHandler.CommitLogReadException exception) throws java.io.IOException
CommitLogReadHandler
shouldSkipSegmentOnError
in interface CommitLogReadHandler
exception
- CommitLogReadException w/details on exception statejava.io.IOException
- In the event the handler wants forceful termination of all processing, throw IOException.public void handleUnrecoverableError(CommitLogReadHandler.CommitLogReadException exception) throws java.io.IOException
handleUnrecoverableError
in interface CommitLogReadHandler
exception
- CommitLogReadException w/details on exception statejava.io.IOException
Copyright © 2009-2021 The Apache Software Foundation