Class CommitLogReader
java.lang.Object
org.apache.cassandra.db.commitlog.CommitLogReader
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidreadAllFiles(CommitLogReadHandler handler, File[] files) Reads all passed in files with no minimum, no start, and no mutation limit.voidreadAllFiles(CommitLogReadHandler handler, File[] files, CommitLogPosition minPosition) Reads all passed in files with minPosition, no start, and no mutation limit.voidreadCommitLogSegment(CommitLogReadHandler handler, File file, boolean tolerateTruncation) Reads passed in file fullyvoidreadCommitLogSegment(CommitLogReadHandler handler, File file, int mutationLimit, boolean tolerateTruncation) Reads passed in file fully, up to mutationLimit countvoidreadCommitLogSegment(CommitLogReadHandler handler, File file, CommitLogPosition minPosition, boolean tolerateTruncation) Reads all mutations from passed in file from minPositionvoidreadCommitLogSegment(CommitLogReadHandler handler, File file, CommitLogPosition minPosition, int mutationLimit, boolean tolerateTruncation) Reads mutations from file, handing them off to handlerprotected voidreadMutation(CommitLogReadHandler handler, byte[] inputBuffer, int size, CommitLogPosition minPosition, int entryLocation, CommitLogDescriptor desc) Deserializes and passes a Mutation to the ICommitLogReadHandler requested
-
Field Details
-
ALL_MUTATIONS
public static final int ALL_MUTATIONS- See Also:
-
-
Constructor Details
-
CommitLogReader
public CommitLogReader()
-
-
Method Details
-
getInvalidMutations
-
readAllFiles
Reads all passed in files with no minimum, no start, and no mutation limit.- Throws:
IOException
-
readAllFiles
public void readAllFiles(CommitLogReadHandler handler, File[] files, CommitLogPosition minPosition) throws IOException Reads all passed in files with minPosition, no start, and no mutation limit.- Throws:
IOException
-
readCommitLogSegment
public void readCommitLogSegment(CommitLogReadHandler handler, File file, boolean tolerateTruncation) throws IOException Reads passed in file fully- Throws:
IOException
-
readCommitLogSegment
public void readCommitLogSegment(CommitLogReadHandler handler, File file, CommitLogPosition minPosition, boolean tolerateTruncation) throws IOException Reads all mutations from passed in file from minPosition- Throws:
IOException
-
readCommitLogSegment
public void readCommitLogSegment(CommitLogReadHandler handler, File file, int mutationLimit, boolean tolerateTruncation) throws IOException Reads passed in file fully, up to mutationLimit count- Throws:
IOException
-
readCommitLogSegment
public void readCommitLogSegment(CommitLogReadHandler handler, File file, CommitLogPosition minPosition, int mutationLimit, boolean tolerateTruncation) throws IOException Reads mutations from file, handing them off to handler- Parameters:
handler- Handler that will take action based on deserialized Mutationsfile- CommitLogSegment file to readminPosition- Optional minimum CommitLogPosition - all segments with id larger or matching w/greater position will be readmutationLimit- Optional limit on # of mutations to replay. Local ALL_MUTATIONS serves as marker to play all.tolerateTruncation- Whether or not we should allow truncation of this file or throw if EOF found- Throws:
IOException
-
readMutation
protected void readMutation(CommitLogReadHandler handler, byte[] inputBuffer, int size, CommitLogPosition minPosition, int entryLocation, CommitLogDescriptor desc) throws IOException Deserializes and passes a Mutation to the ICommitLogReadHandler requested- Parameters:
handler- Handler that will take action based on deserialized MutationsinputBuffer- raw byte array w/Mutation datasize- deserialized size of mutationminPosition- We need to suppress replay of mutations that are before the required minPositionentryLocation- filePointer offset of end of mutation within CommitLogSegmentdesc- CommitLogDescriptor being worked on- Throws:
IOException
-