org.apache.hadoop.hbase.regionserver
Class StripeMultiFileWriter

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.AbstractMultiFileWriter
      extended by org.apache.hadoop.hbase.regionserver.StripeMultiFileWriter
All Implemented Interfaces:
Compactor.CellSink
Direct Known Subclasses:
StripeMultiFileWriter.BoundaryMultiWriter, StripeMultiFileWriter.SizeMultiWriter

@InterfaceAudience.Private
public abstract class StripeMultiFileWriter
extends AbstractMultiFileWriter

Base class for cell sink that separates the provided cells into multiple files for stripe compaction.


Nested Class Summary
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.
 
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.regionserver.AbstractMultiFileWriter
AbstractMultiFileWriter.WriterFactory
 
Field Summary
protected  List<byte[]> boundaries
           
protected  KeyValue.KVComparator comparator
           
protected  List<StoreFile.Writer> existingWriters
           
 
Fields inherited from class org.apache.hadoop.hbase.regionserver.AbstractMultiFileWriter
sourceScanner, writerFactory
 
Constructor Summary
StripeMultiFileWriter(KeyValue.KVComparator comparator)
           
 
Method Summary
protected  void preCloseWriter(StoreFile.Writer writer)
          Subclasses override this method to be called before we close the give writer.
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()
           
protected  Collection<StoreFile.Writer> writers()
           
 
Methods inherited from class org.apache.hadoop.hbase.regionserver.AbstractMultiFileWriter
abortWriters, commitWriters, init, preCommitWriters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.hbase.regionserver.compactions.Compactor.CellSink
append
 

Field Detail

comparator

protected final KeyValue.KVComparator comparator

existingWriters

protected List<StoreFile.Writer> existingWriters

boundaries

protected List<byte[]> boundaries
Constructor Detail

StripeMultiFileWriter

public StripeMultiFileWriter(KeyValue.KVComparator comparator)
Method Detail

setNoStripeMetadata

public void setNoStripeMetadata()

writers

protected Collection<StoreFile.Writer> writers()
Specified by:
writers in class AbstractMultiFileWriter

preCloseWriter

protected void preCloseWriter(StoreFile.Writer writer)
                       throws IOException
Description copied from class: AbstractMultiFileWriter
Subclasses override this method to be called before we close the give writer. Usually you can append extra metadata to the writer.

Overrides:
preCloseWriter in class AbstractMultiFileWriter
Throws:
IOException

sanityCheckLeft

protected void sanityCheckLeft(byte[] left,
                               byte[] row,
                               int rowOffset,
                               int rowLength)
                        throws IOException
Subclasses can call this method to make sure the first KV is within multi-writer range.

Parameters:
left - The left boundary of the writer.
row - The row to check.
rowOffset - Offset for row.
rowLength - Length for row.
Throws:
IOException

sanityCheckRight

protected void sanityCheckRight(byte[] right,
                                byte[] row,
                                int rowOffset,
                                int rowLength)
                         throws IOException
Subclasses can call this method to make sure the last KV is within multi-writer range.

Parameters:
right - The right boundary of the writer.
row - The row to check.
rowOffset - Offset for row.
rowLength - Length for row.
Throws:
IOException


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.