Package org.apache.hadoop.hbase.wal
Class BoundedRecoveredHFilesOutputSink
java.lang.Object
org.apache.hadoop.hbase.wal.OutputSink
org.apache.hadoop.hbase.wal.BoundedRecoveredHFilesOutputSink
A WALSplitter sink that outputs
HFiles. Runs with a
bounded number of HFile writers at any one time rather than let the count run up.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.wal.OutputSink
OutputSink.WriterThread -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprivate final AtomicIntegerprivate ConcurrentMap<String,Long> private final WALSplitterFields inherited from class org.apache.hadoop.hbase.wal.OutputSink
closeCompletionService, closeThreadPool, entryBuffers, numThreads, reporter, splits, status, totalSkippedEdits -
Constructor Summary
ConstructorsConstructorDescriptionBoundedRecoveredHFilesOutputSink(WALSplitter walSplitter, WALSplitter.PipelineController controller, EntryBuffers entryBuffers, int numWriters) -
Method Summary
Modifier and TypeMethodDescription(package private) voidappend(EntryBuffers.RegionEntryBuffer buffer) List<org.apache.hadoop.fs.Path>close()private StoreFileWritercreateRecoveredHFileWriter(TableName tableName, String regionName, long seqId, String familyName, boolean isMetaTable) intReturns number of regions we've recovered(package private) intReturns the number of currently opened writersReturns a map from encoded region ID to the number of edits written out for that region.(package private) booleankeepRegionEvent(WAL.Entry entry) Some WALEdit's contain only KV's for account on what happened to a region.private booleanWrite out the remaining RegionEntryBuffers and close the writers.Methods inherited from class org.apache.hadoop.hbase.wal.OutputSink
finishWriterThreads, getTotalSkippedEdits, restartWriterThreadsIfNeeded, setReporter, setStatus, startWriterThreads, updateStatusWithMsg
-
Field Details
-
LOG
-
walSplitter
-
regionEditsWrittenMap
-
openingWritersNum
-
-
Constructor Details
-
BoundedRecoveredHFilesOutputSink
public BoundedRecoveredHFilesOutputSink(WALSplitter walSplitter, WALSplitter.PipelineController controller, EntryBuffers entryBuffers, int numWriters)
-
-
Method Details
-
append
- Specified by:
appendin classOutputSink- Parameters:
buffer- A buffer of some number of edits for a given region.- Throws:
IOException- For any IO errors
-
close
- Specified by:
closein 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:OutputSinkReturns a map from encoded region ID to the number of edits written out for that region.- Specified by:
getOutputCountsin classOutputSink
-
getNumberOfRecoveredRegions
Description copied from class:OutputSinkReturns number of regions we've recovered- Specified by:
getNumberOfRecoveredRegionsin classOutputSink
-
getNumOpenWriters
int getNumOpenWriters()Description copied from class:OutputSinkReturns the number of currently opened writers- Specified by:
getNumOpenWritersin classOutputSink
-
keepRegionEvent
Description copied from class:OutputSinkSome WALEdit's contain only KV's for account on what happened to a region. Not all sinks will want to get all of those edits.- Specified by:
keepRegionEventin classOutputSink- Returns:
- Return true if this sink wants to accept this region-level WALEdit.
-
createRecoveredHFileWriter
private StoreFileWriter createRecoveredHFileWriter(TableName tableName, String regionName, long seqId, String familyName, boolean isMetaTable) throws IOException - Returns:
- Returns a base HFile without compressions or encodings; good enough for recovery given hfile has metadata on how it was written.
- Throws:
IOException
-