@InterfaceAudience.Private public abstract class StripeMultiFileWriter extends Object implements Compactor.CellSink
| Modifier and Type | Class and Description |
|---|---|
static class |
StripeMultiFileWriter.BoundaryMultiWriter
MultiWriter that separates the cells based on fixed row-key boundaries.
|
static class |
StripeMultiFileWriter.SizeMultiWriter
MultiWriter that separates the cells based on target cell number per file and file count.
|
static interface |
StripeMultiFileWriter.WriterFactory |
| Modifier and Type | Field and Description |
|---|---|
protected List<byte[]> |
boundaries |
protected KeyValue.KVComparator |
comparator |
protected List<StoreFile.Writer> |
existingWriters |
protected StoreScanner |
sourceScanner
Source scanner that is tracking KV count; may be null if source is not StoreScanner
|
protected StripeMultiFileWriter.WriterFactory |
writerFactory
Factory that is used to produce single StoreFile.Writer-s
|
| Constructor and Description |
|---|
StripeMultiFileWriter() |
| Modifier and Type | Method and Description |
|---|---|
List<org.apache.hadoop.fs.Path> |
abortWriters() |
List<org.apache.hadoop.fs.Path> |
commitWriters(long maxSeqId,
boolean isMajor) |
protected abstract void |
commitWritersInternal()
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.
|
void |
init(StoreScanner sourceScanner,
StripeMultiFileWriter.WriterFactory factory,
KeyValue.KVComparator comparator)
Initializes multi-writer before usage.
|
protected void |
sanityCheckLeft(byte[] left,
byte[] row,
int rowOffset,
int rowLength)
Subclasses can call this method to make sure the first KV is within multi-writer range.
|
protected void |
sanityCheckRight(byte[] right,
byte[] row,
int rowOffset,
int rowLength)
Subclasses can call this method to make sure the last KV is within multi-writer range.
|
void |
setNoStripeMetadata() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitappendprotected StripeMultiFileWriter.WriterFactory writerFactory
protected KeyValue.KVComparator comparator
protected List<StoreFile.Writer> existingWriters
protected List<byte[]> boundaries
protected StoreScanner sourceScanner
public void init(StoreScanner sourceScanner, StripeMultiFileWriter.WriterFactory factory, KeyValue.KVComparator comparator) throws IOException
sourceScanner - Optional store scanner to obtain the information about read progress.factory - Factory used to produce individual file writers.comparator - Comparator used to compare rows.IOExceptionpublic void setNoStripeMetadata()
public List<org.apache.hadoop.fs.Path> commitWriters(long maxSeqId, boolean isMajor) throws IOException
IOExceptionpublic List<org.apache.hadoop.fs.Path> abortWriters()
protected void sanityCheckLeft(byte[] left,
byte[] row,
int rowOffset,
int rowLength)
throws IOException
left - The left boundary of the writer.row - The row to check.rowOffset - Offset for row.rowLength - Length for row.IOExceptionprotected void sanityCheckRight(byte[] right,
byte[] row,
int rowOffset,
int rowLength)
throws IOException
right - The right boundary of the writer.row - The row to check.rowOffset - Offset for row.rowLength - Length for row.IOExceptionprotected abstract void commitWritersInternal()
throws IOException
IOExceptionCopyright © 2014 The Apache Software Foundation. All rights reserved.