org.apache.hadoop.hbase.regionserver
Class StripeMultiFileWriter.SizeMultiWriter

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.AbstractMultiFileWriter
      extended by org.apache.hadoop.hbase.regionserver.StripeMultiFileWriter
          extended by org.apache.hadoop.hbase.regionserver.StripeMultiFileWriter.SizeMultiWriter
All Implemented Interfaces:
Compactor.CellSink
Enclosing class:
StripeMultiFileWriter

public static class StripeMultiFileWriter.SizeMultiWriter
extends StripeMultiFileWriter

MultiWriter that separates the cells based on target cell number per file and file count. New file is started every time the target number of KVs is reached, unless the fixed count of writers has already been created (in that case all the remaining KVs go into the last writer).


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.regionserver.StripeMultiFileWriter
StripeMultiFileWriter.BoundaryMultiWriter, StripeMultiFileWriter.SizeMultiWriter
 
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.regionserver.AbstractMultiFileWriter
AbstractMultiFileWriter.WriterFactory
 
Field Summary
protected  byte[] lastRowInCurrentWriter
           
 
Fields inherited from class org.apache.hadoop.hbase.regionserver.StripeMultiFileWriter
boundaries, comparator, existingWriters
 
Fields inherited from class org.apache.hadoop.hbase.regionserver.AbstractMultiFileWriter
sourceScanner, writerFactory
 
Constructor Summary
StripeMultiFileWriter.SizeMultiWriter(KeyValue.KVComparator comparator, int targetCount, long targetKvs, byte[] left, byte[] right)
           
 
Method Summary
 void append(KeyValue kv)
           
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.
 
Methods inherited from class org.apache.hadoop.hbase.regionserver.StripeMultiFileWriter
preCloseWriter, sanityCheckLeft, sanityCheckRight, setNoStripeMetadata, writers
 
Methods inherited from class org.apache.hadoop.hbase.regionserver.AbstractMultiFileWriter
abortWriters, commitWriters, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastRowInCurrentWriter

protected byte[] lastRowInCurrentWriter
Constructor Detail

StripeMultiFileWriter.SizeMultiWriter

public StripeMultiFileWriter.SizeMultiWriter(KeyValue.KVComparator comparator,
                                             int targetCount,
                                             long targetKvs,
                                             byte[] left,
                                             byte[] right)
Parameters:
targetCount - The maximum count of writers that can be created.
targetKvs - The number of KVs to read from source before starting each new writer.
left - The left boundary of the first writer.
right - The right boundary of the last writer.
Method Detail

append

public void append(KeyValue kv)
            throws IOException
Throws:
IOException

preCommitWriters

protected void preCommitWriters()
                         throws IOException
Description copied from class: AbstractMultiFileWriter
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.

Overrides:
preCommitWriters in class AbstractMultiFileWriter
Throws:
IOException


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