public class CommitLogReader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ALL_MUTATIONS |
Constructor and Description |
---|
CommitLogReader() |
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.util.Map.Entry<TableId,java.util.concurrent.atomic.AtomicInteger>> |
getInvalidMutations() |
void |
readAllFiles(CommitLogReadHandler handler,
java.io.File[] files)
Reads all passed in files with no minimum, no start, and no mutation limit.
|
void |
readAllFiles(CommitLogReadHandler handler,
java.io.File[] files,
CommitLogPosition minPosition)
Reads all passed in files with minPosition, no start, and no mutation limit.
|
void |
readCommitLogSegment(CommitLogReadHandler handler,
java.io.File file,
boolean tolerateTruncation)
Reads passed in file fully
|
void |
readCommitLogSegment(CommitLogReadHandler handler,
java.io.File file,
CommitLogPosition minPosition,
boolean tolerateTruncation)
Reads all mutations from passed in file from minPosition
|
void |
readCommitLogSegment(CommitLogReadHandler handler,
java.io.File file,
CommitLogPosition minPosition,
int mutationLimit,
boolean tolerateTruncation)
Reads mutations from file, handing them off to handler
|
void |
readCommitLogSegment(CommitLogReadHandler handler,
java.io.File file,
int mutationLimit,
boolean tolerateTruncation)
Reads passed in file fully, up to mutationLimit count
|
protected void |
readMutation(CommitLogReadHandler handler,
byte[] inputBuffer,
int size,
CommitLogPosition minPosition,
int entryLocation,
CommitLogDescriptor desc)
Deserializes and passes a Mutation to the ICommitLogReadHandler requested
|
public static final int ALL_MUTATIONS
public java.util.Set<java.util.Map.Entry<TableId,java.util.concurrent.atomic.AtomicInteger>> getInvalidMutations()
public void readAllFiles(CommitLogReadHandler handler, java.io.File[] files) throws java.io.IOException
java.io.IOException
public void readAllFiles(CommitLogReadHandler handler, java.io.File[] files, CommitLogPosition minPosition) throws java.io.IOException
java.io.IOException
public void readCommitLogSegment(CommitLogReadHandler handler, java.io.File file, boolean tolerateTruncation) throws java.io.IOException
java.io.IOException
public void readCommitLogSegment(CommitLogReadHandler handler, java.io.File file, CommitLogPosition minPosition, boolean tolerateTruncation) throws java.io.IOException
java.io.IOException
public void readCommitLogSegment(CommitLogReadHandler handler, java.io.File file, int mutationLimit, boolean tolerateTruncation) throws java.io.IOException
java.io.IOException
public void readCommitLogSegment(CommitLogReadHandler handler, java.io.File file, CommitLogPosition minPosition, int mutationLimit, boolean tolerateTruncation) throws java.io.IOException
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 foundjava.io.IOException
protected void readMutation(CommitLogReadHandler handler, byte[] inputBuffer, int size, CommitLogPosition minPosition, int entryLocation, CommitLogDescriptor desc) throws java.io.IOException
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 onjava.io.IOException
Copyright © 2009- The Apache Software Foundation