@InterfaceAudience.Private public class BoundedRecoveredHFilesOutputSink extends OutputSink
HFile
s. Runs with a
bounded number of HFile writers at any one time rather than let the count run up.OutputSink.WriterThread
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
private AtomicInteger |
openingWritersNum |
private ConcurrentMap<String,Long> |
regionEditsWrittenMap |
private WALSplitter |
walSplitter |
closeCompletionService, closeThreadPool, entryBuffers, numThreads, reporter, splits, status, totalSkippedEdits
Constructor and Description |
---|
BoundedRecoveredHFilesOutputSink(WALSplitter walSplitter,
WALSplitter.PipelineController controller,
EntryBuffers entryBuffers,
int numWriters) |
Modifier and Type | Method and Description |
---|---|
void |
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 |
getNumberOfRecoveredRegions()
Returns number of regions we've recovered
|
int |
getNumOpenWriters()
Returns the number of currently opened writers
|
Map<String,Long> |
getOutputCounts()
Returns 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 |
writeRemainingEntryBuffers()
Write out the remaining RegionEntryBuffers and close the writers.
|
finishWriterThreads, getTotalSkippedEdits, restartWriterThreadsIfNeeded, setReporter, setStatus, startWriterThreads, updateStatusWithMsg
private static final org.slf4j.Logger LOG
private final WALSplitter walSplitter
private ConcurrentMap<String,Long> regionEditsWrittenMap
private final AtomicInteger openingWritersNum
public BoundedRecoveredHFilesOutputSink(WALSplitter walSplitter, WALSplitter.PipelineController controller, EntryBuffers entryBuffers, int numWriters)
public void append(EntryBuffers.RegionEntryBuffer buffer) throws IOException
append
in class OutputSink
buffer
- A buffer of some number of edits for a given region.IOException
- For any IO errorspublic List<org.apache.hadoop.fs.Path> close() throws IOException
close
in class OutputSink
IOException
private boolean writeRemainingEntryBuffers() throws IOException
IOException
public Map<String,Long> getOutputCounts()
OutputSink
getOutputCounts
in class OutputSink
public int getNumberOfRecoveredRegions()
OutputSink
getNumberOfRecoveredRegions
in class OutputSink
public int getNumOpenWriters()
OutputSink
getNumOpenWriters
in class OutputSink
public boolean keepRegionEvent(WAL.Entry entry)
OutputSink
keepRegionEvent
in class OutputSink
private StoreFileWriter createRecoveredHFileWriter(TableName tableName, String regionName, long seqId, String familyName, boolean isMetaTable) throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.