Package org.apache.hadoop.hbase.wal
Class RecoveredEditsOutputSink
java.lang.Object
org.apache.hadoop.hbase.wal.OutputSink
org.apache.hadoop.hbase.wal.AbstractRecoveredEditsOutputSink
org.apache.hadoop.hbase.wal.RecoveredEditsOutputSink
Class that manages the output streams from the log splitting process. Every region only has one
recovered edits file PER split WAL (if we split multiple WALs during a log-splitting session, on
open, a Region may have multiple recovered.edits files to replay -- one per split WAL).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.wal.AbstractRecoveredEditsOutputSink
AbstractRecoveredEditsOutputSink.RecoveredEditsWriter
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.wal.OutputSink
OutputSink.WriterThread
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
Fields inherited from class org.apache.hadoop.hbase.wal.OutputSink
closeCompletionService, closeThreadPool, entryBuffers, numThreads, reporter, splits, status, totalSkippedEdits
-
Constructor Summary
ConstructorDescriptionRecoveredEditsOutputSink
(WALSplitter walSplitter, WALSplitter.PipelineController controller, EntryBuffers entryBuffers, int numWriters) -
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(EntryBuffers.RegionEntryBuffer buffer) List<org.apache.hadoop.fs.Path>
close()
private boolean
Close all of the output streams.int
Returns number of regions we've recoveredint
Returns the number of currently opened writersReturns a map from encoded region ID to the number of edits written out for that region.getRecoveredEditsWriter
(TableName tableName, byte[] region, long seqId) Get a writer and path for a log starting at the given entry.Methods inherited from class org.apache.hadoop.hbase.wal.AbstractRecoveredEditsOutputSink
closeRecoveredEditsWriter, createRecoveredEditsWriter, keepRegionEvent, updateRegionMaximumEditLogSeqNum
Methods inherited from class org.apache.hadoop.hbase.wal.OutputSink
finishWriterThreads, getTotalSkippedEdits, restartWriterThreadsIfNeeded, setReporter, setStatus, startWriterThreads, updateStatusWithMsg
-
Field Details
-
LOG
-
writers
-
-
Constructor Details
-
RecoveredEditsOutputSink
public RecoveredEditsOutputSink(WALSplitter walSplitter, WALSplitter.PipelineController controller, EntryBuffers entryBuffers, int numWriters)
-
-
Method Details
-
append
- Specified by:
append
in classOutputSink
- Parameters:
buffer
- A buffer of some number of edits for a given region.- Throws:
IOException
- For any IO errors
-
getRecoveredEditsWriter
private AbstractRecoveredEditsOutputSink.RecoveredEditsWriter getRecoveredEditsWriter(TableName tableName, byte[] region, long seqId) throws IOException Get a writer and path for a log starting at the given entry. This function is threadsafe so long as multiple threads are always acting on different regions.- Returns:
- null if this region shouldn't output any logs
- Throws:
IOException
-
close
- Specified by:
close
in classOutputSink
- Throws:
IOException
-
closeWriters
Close all of the output streams.- Returns:
- true when there is no error.
- Throws:
IOException
-
getOutputCounts
Description copied from class:OutputSink
Returns a map from encoded region ID to the number of edits written out for that region.- Specified by:
getOutputCounts
in classOutputSink
-
getNumberOfRecoveredRegions
Description copied from class:OutputSink
Returns number of regions we've recovered- Specified by:
getNumberOfRecoveredRegions
in classOutputSink
-
getNumOpenWriters
Description copied from class:OutputSink
Returns the number of currently opened writers- Specified by:
getNumOpenWriters
in classOutputSink
-