Package org.apache.hadoop.hbase.wal
Class BoundedRecoveredEditsOutputSink
java.lang.Object
org.apache.hadoop.hbase.wal.OutputSink
org.apache.hadoop.hbase.wal.AbstractRecoveredEditsOutputSink
org.apache.hadoop.hbase.wal.BoundedRecoveredEditsOutputSink
Class that manages the output streams from the log splitting process. Every region may have many
recovered edits file. But the opening writers is bounded. Bounded means the output streams will
be no more than the size of threadpool.
-
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
private final AtomicInteger
private ConcurrentMap<String,
Long> Fields inherited from class org.apache.hadoop.hbase.wal.OutputSink
closeCompletionService, closeThreadPool, entryBuffers, numThreads, reporter, splits, status, totalSkippedEdits
-
Constructor Summary
ConstructorDescriptionBoundedRecoveredEditsOutputSink
(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()
int
Returns number of regions we've recovered(package private) int
Returns the number of currently opened writersReturns a map from encoded region ID to the number of edits written out for that region.private boolean
Write out the remaining RegionEntryBuffers and close the writers.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
-
regionEditsWrittenMap
-
openingWritersNum
-
-
Constructor Details
-
BoundedRecoveredEditsOutputSink
public BoundedRecoveredEditsOutputSink(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
-
close
- Specified by:
close
in classOutputSink
- Throws:
IOException
-
writeRemainingEntryBuffers
Write out the remaining RegionEntryBuffers and close the writers.- 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
int getNumOpenWriters()Description copied from class:OutputSink
Returns the number of currently opened writers- Specified by:
getNumOpenWriters
in classOutputSink
-