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 |
| 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) |
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)
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 CommitLogReader commitLogReader
public static CommitLogReplayer construct(CommitLog commitLog)
public void replayPath(java.io.File file,
boolean tolerateTruncation)
throws java.io.IOException
java.io.IOExceptionpublic void replayFiles(java.io.File[] clogs)
throws java.io.IOException
java.io.IOExceptionpublic int blockForWrites()
public static IntervalSet<CommitLogPosition> persistedIntervals(java.lang.Iterable<SSTableReader> onDisk, CommitLogPosition truncatedAt)
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)
CommitLogReadHandlerhandleMutation in interface CommitLogReadHandlerm - deserialized mutationsize - serialized size of the mutationentryLocation - filePointer offset inside the CommitLogSegment for the recorddesc - CommitLogDescriptor for mutation being processedpublic boolean shouldSkipSegmentOnError(CommitLogReadHandler.CommitLogReadException exception) throws java.io.IOException
CommitLogReadHandlershouldSkipSegmentOnError in interface CommitLogReadHandlerexception - 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 CommitLogReadHandlerexception - CommitLogReadException w/details on exception statejava.io.IOExceptionCopyright © 2018 The Apache Software Foundation