Package org.apache.hadoop.hbase.wal
Class OutputSink
java.lang.Object
org.apache.hadoop.hbase.wal.OutputSink
- Direct Known Subclasses:
AbstractRecoveredEditsOutputSink
,BoundedRecoveredHFilesOutputSink
,RegionReplicaReplicationEndpoint.RegionReplicaOutputSink
The following class is an abstraction class to provide a common interface to support different
ways of consuming recovered edits.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected final CompletionService<Void>
protected final ThreadPoolExecutor
Used when close this output sink.private final WALSplitter.PipelineController
protected final EntryBuffers
private static final org.slf4j.Logger
protected final int
protected CancelableProgressable
protected final List<org.apache.hadoop.fs.Path>
List of all the files produced by this sinkprotected MonitoredTask
protected final AtomicLong
private final List<OutputSink.WriterThread>
-
Constructor Summary
ConstructorDescriptionOutputSink
(WALSplitter.PipelineController controller, EntryBuffers entryBuffers, int numWriters) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
append
(EntryBuffers.RegionEntryBuffer buffer) protected abstract List<org.apache.hadoop.fs.Path>
close()
protected boolean
finishWriterThreads
(boolean interrupt) Wait for writer threads to dump all info to the sinkprotected abstract int
Returns number of regions we've recoveredprotected abstract int
Returns the number of currently opened writersReturns a map from encoded region ID to the number of edits written out for that region.(package private) long
protected abstract boolean
keepRegionEvent
(WAL.Entry entry) Some WALEdit's contain only KV's for account on what happened to a region.void
(package private) void
setReporter
(CancelableProgressable reporter) (package private) void
setStatus
(MonitoredTask status) void
Start the threads that will pump data from the entryBuffers to the output files.protected final void
Set status message inMonitoredTask
instance that is set in this OutputSink
-
Field Details
-
LOG
-
controller
-
entryBuffers
-
writerThreads
-
numThreads
-
reporter
-
totalSkippedEdits
-
splits
List of all the files produced by this sink -
status
-
closeThreadPool
Used when close this output sink. -
closeCompletionService
-
-
Constructor Details
-
OutputSink
public OutputSink(WALSplitter.PipelineController controller, EntryBuffers entryBuffers, int numWriters)
-
-
Method Details
-
setReporter
-
setStatus
-
startWriterThreads
Start the threads that will pump data from the entryBuffers to the output files.- Throws:
IOException
-
restartWriterThreadsIfNeeded
-
finishWriterThreads
Wait for writer threads to dump all info to the sink- Returns:
- true when there is no error
- Throws:
IOException
-
getTotalSkippedEdits
long getTotalSkippedEdits() -
getNumOpenWriters
Returns the number of currently opened writers -
append
- Parameters:
buffer
- A buffer of some number of edits for a given region.- Throws:
IOException
- For any IO errors
-
close
- Throws:
IOException
-
getOutputCounts
Returns a map from encoded region ID to the number of edits written out for that region. -
getNumberOfRecoveredRegions
Returns number of regions we've recovered -
keepRegionEvent
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.- Returns:
- Return true if this sink wants to accept this region-level WALEdit.
-
updateStatusWithMsg
Set status message inMonitoredTask
instance that is set in this OutputSink- Parameters:
msg
- message to update the status with
-