@InterfaceAudience.Private public abstract class AbstractMultiFileWriter extends Object implements Compactor.CellSink
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.
|
List<org.apache.hadoop.fs.Path> |
commitWriters(long maxSeqId,
boolean majorCompaction)
Commit all writers.
|
List<org.apache.hadoop.fs.Path> |
commitWriters(long maxSeqId,
boolean majorCompaction,
Collection<StoreFile> storeFiles) |
void |
init(StoreScanner sourceScanner,
AbstractMultiFileWriter.WriterFactory factory)
Initializes multi-writer before usage.
|
protected void |
preCloseWriter(StoreFile.Writer 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<StoreFile.Writer> |
writers() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
append
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> commitWriters(long maxSeqId, boolean majorCompaction, Collection<StoreFile> storeFiles) throws IOException
IOException
public List<org.apache.hadoop.fs.Path> abortWriters()
protected abstract Collection<StoreFile.Writer> writers()
protected void preCommitWriters() throws IOException
IOException
protected void preCloseWriter(StoreFile.Writer writer) throws IOException
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.