@InterfaceAudience.Private abstract class OutputSink extends Object
Modifier and Type | Class and Description |
---|---|
static class |
OutputSink.WriterThread |
Modifier and Type | Field and Description |
---|---|
protected CompletionService<Void> |
closeCompletionService |
protected ThreadPoolExecutor |
closeThreadPool
Used when close this output sink.
|
private WALSplitter.PipelineController |
controller |
protected EntryBuffers |
entryBuffers |
private static org.slf4j.Logger |
LOG |
protected int |
numThreads |
protected CancelableProgressable |
reporter |
protected List<org.apache.hadoop.fs.Path> |
splits
List of all the files produced by this sink
|
protected MonitoredTask |
status |
protected AtomicLong |
totalSkippedEdits |
private List<OutputSink.WriterThread> |
writerThreads |
Constructor and Description |
---|
OutputSink(WALSplitter.PipelineController controller,
EntryBuffers entryBuffers,
int numWriters) |
Modifier and Type | Method and Description |
---|---|
(package private) abstract void |
append(EntryBuffers.RegionEntryBuffer buffer) |
(package private) abstract List<org.apache.hadoop.fs.Path> |
close() |
(package private) boolean |
finishWriterThreads()
Wait for writer threads to dump all info to the sink
|
(package private) abstract int |
getNumberOfRecoveredRegions()
Returns number of regions we've recovered
|
(package private) abstract int |
getNumOpenWriters()
Returns the number of currently opened writers
|
(package private) abstract Map<String,Long> |
getOutputCounts()
Returns a map from encoded region ID to the number of edits written out for that region.
|
(package private) long |
getTotalSkippedEdits() |
(package private) abstract boolean |
keepRegionEvent(WAL.Entry entry)
Some WALEdit's contain only KV's for account on what happened to a region.
|
(package private) void |
setReporter(CancelableProgressable reporter) |
(package private) void |
setStatus(MonitoredTask status) |
(package private) void |
startWriterThreads()
Start the threads that will pump data from the entryBuffers to the output files.
|
protected void |
updateStatusWithMsg(String msg)
Set status message in
MonitoredTask instance that is set in this OutputSink |
private static final org.slf4j.Logger LOG
private final WALSplitter.PipelineController controller
protected final EntryBuffers entryBuffers
private final List<OutputSink.WriterThread> writerThreads
protected final int numThreads
protected CancelableProgressable reporter
protected final AtomicLong totalSkippedEdits
protected final List<org.apache.hadoop.fs.Path> splits
protected MonitoredTask status
protected final ThreadPoolExecutor closeThreadPool
protected final CompletionService<Void> closeCompletionService
public OutputSink(WALSplitter.PipelineController controller, EntryBuffers entryBuffers, int numWriters)
void setReporter(CancelableProgressable reporter)
void setStatus(MonitoredTask status)
void startWriterThreads() throws IOException
IOException
boolean finishWriterThreads() throws IOException
IOException
long getTotalSkippedEdits()
abstract int getNumOpenWriters()
abstract void append(EntryBuffers.RegionEntryBuffer buffer) throws IOException
buffer
- A buffer of some number of edits for a given region.IOException
- For any IO errorsabstract List<org.apache.hadoop.fs.Path> close() throws IOException
IOException
abstract Map<String,Long> getOutputCounts()
abstract int getNumberOfRecoveredRegions()
abstract boolean keepRegionEvent(WAL.Entry entry)
protected final void updateStatusWithMsg(String msg)
MonitoredTask
instance that is set in this OutputSinkmsg
- message to update the status withCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.