@InterfaceAudience.Private public abstract class AbstractMultiFileWriter extends Object implements CellSink, ShipperListener
Modifier and Type | Class and Description |
---|---|
static interface |
AbstractMultiFileWriter.WriterFactory |
Modifier and Type | Field and Description |
---|---|
protected StoreScanner |
sourceScanner
Source scanner that is tracking KV count; may be null if source is not StoreScanner
|
protected AbstractMultiFileWriter.WriterFactory |
writerFactory
Factory that is used to produce single StoreFile.Writer-s
|
Constructor and Description |
---|
AbstractMultiFileWriter() |
Modifier and Type | Method and Description |
---|---|
List<org.apache.hadoop.fs.Path> |
abortWriters()
Close all writers without throwing any exceptions.
|
void |
beforeShipped()
The action that needs to be performed before
Shipper.shipped() is performed |
List<org.apache.hadoop.fs.Path> |
commitWriters(long maxSeqId,
boolean majorCompaction)
Commit all writers.
|
void |
init(StoreScanner sourceScanner,
AbstractMultiFileWriter.WriterFactory factory)
Initializes multi-writer before usage.
|
protected void |
preCloseWriter(StoreFileWriter writer)
Subclasses override this method to be called before we close the give writer.
|
protected void |
preCommitWriters()
Subclasses override this method to be called at the end of a successful sequence of append; all
appends are processed before this method is called.
|
protected abstract Collection<StoreFileWriter> |
writers() |
protected AbstractMultiFileWriter.WriterFactory writerFactory
protected StoreScanner sourceScanner
public void init(StoreScanner sourceScanner, AbstractMultiFileWriter.WriterFactory factory)
sourceScanner
- Optional store scanner to obtain the information about read progress.factory
- Factory used to produce individual file writers.public List<org.apache.hadoop.fs.Path> commitWriters(long maxSeqId, boolean majorCompaction) throws IOException
Notice that here we use the same maxSeqId
for all output files since we haven't
find an easy to find enough sequence ids for different output files in some corner cases. See
comments in HBASE-15400 for more details.
IOException
public List<org.apache.hadoop.fs.Path> abortWriters()
protected abstract Collection<StoreFileWriter> writers()
protected void preCommitWriters() throws IOException
IOException
protected void preCloseWriter(StoreFileWriter writer) throws IOException
IOException
public void beforeShipped() throws IOException
ShipperListener
Shipper.shipped()
is performedbeforeShipped
in interface ShipperListener
IOException
Copyright © 2007–2019 Cloudera. All rights reserved.