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

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.StoreFile.Writer
Enclosing class:
StoreFile

public static class StoreFile.Writer
extends Object

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  HFileDataBlockEncoder dataBlockEncoder
           
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

dataBlockEncoder

protected HFileDataBlockEncoder dataBlockEncoder

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

Parameters:
trt -

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
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 © 2014 The Apache Software Foundation. All Rights Reserved.