org.apache.hadoop.hbase.regionserver
Class StoreFile.Writer

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.StoreFile.Writer
All Implemented Interfaces:
Compactor.CellSink
Enclosing class:
StoreFile

public static class StoreFile.Writer
extends Object
implements Compactor.CellSink

A StoreFile writer. Use this to read/write HBase Store Files. It is package local because it is an implementation detail of the HBase regionserver.


Field Summary
protected  int bytesPerChecksum
          Bytes per Checksum
protected  ChecksumType checksumType
          Checksum type
protected  HFile.Writer writer
           
 
Method Summary
 void append(KeyValue kv)
           
 void appendFileInfo(byte[] key, byte[] value)
           
 void appendMetadata(long maxSequenceId, boolean majorCompaction)
          Writes meta data.
 void appendTrackedTimestampsToMetadata()
          Add TimestampRange and earliest put timestamp to Metadata
 void close()
           
 org.apache.hadoop.fs.Path getPath()
           
 void setTimeRangeTracker(TimeRangeTracker trt)
          Set TimeRangeTracker.
 void trackTimestamps(KeyValue kv)
          Record the earlest Put timestamp.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

checksumType

protected ChecksumType checksumType
Checksum type


bytesPerChecksum

protected int bytesPerChecksum
Bytes per Checksum


writer

protected HFile.Writer writer
Method Detail

appendMetadata

public void appendMetadata(long maxSequenceId,
                           boolean majorCompaction)
                    throws IOException
Writes meta data. Call before close() since its written as meta data to this file.

Parameters:
maxSequenceId - Maximum sequence id.
majorCompaction - True if this file is product of a major compaction
Throws:
IOException - problem writing to FS

appendTrackedTimestampsToMetadata

public void appendTrackedTimestampsToMetadata()
                                       throws IOException
Add TimestampRange and earliest put timestamp to Metadata

Throws:
IOException

setTimeRangeTracker

public void setTimeRangeTracker(TimeRangeTracker trt)
Set TimeRangeTracker. Called when flushing to pass us a pre-calculated TimeRangeTracker, one made during updates to memstore so we don't have to make one ourselves as Cells get appended. Call before first append. If this method is not called, we will calculate our own range of the Cells that comprise this StoreFile (and write them on the end as metadata). It is good to have this stuff passed because it is expensive to make.


trackTimestamps

public void trackTimestamps(KeyValue kv)
Record the earlest Put timestamp. If the timeRangeTracker is not set, update TimeRangeTracker to include the timestamp of this key

Parameters:
kv -

append

public void append(KeyValue kv)
            throws IOException
Specified by:
append in interface Compactor.CellSink
Throws:
IOException

getPath

public org.apache.hadoop.fs.Path getPath()

close

public void close()
           throws IOException
Throws:
IOException

appendFileInfo

public void appendFileInfo(byte[] key,
                           byte[] value)
                    throws IOException
Throws:
IOException


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