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
HFile
s. 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
Modifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
private final AtomicInteger
private ConcurrentMap<String,
Long> private final WALSplitter
Fields inherited from class org.apache.hadoop.hbase.wal.OutputSink
closeCompletionService, closeThreadPool, entryBuffers, numThreads, reporter, splits, status, totalSkippedEdits
-
Constructor Summary
ConstructorDescriptionBoundedRecoveredHFilesOutputSink
(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 StoreFileWriter
createRecoveredHFileWriter
(TableName tableName, String regionName, long seqId, String familyName, boolean isMetaTable) 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.boolean
keepRegionEvent
(WAL.Entry entry) Some WALEdit's contain only KV's for account on what happened to a region.private boolean
Write 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:
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
Description copied from class:OutputSink
Returns the number of currently opened writers- Specified by:
getNumOpenWriters
in classOutputSink
-
keepRegionEvent
Description copied from class:OutputSink
Some 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:
keepRegionEvent
in 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
-