org.apache.hadoop.hbase.io.hfile
Class HFileWriterV3

java.lang.Object
  extended by org.apache.hadoop.hbase.io.hfile.AbstractHFileWriter
      extended by org.apache.hadoop.hbase.io.hfile.HFileWriterV2
          extended by org.apache.hadoop.hbase.io.hfile.HFileWriterV3
All Implemented Interfaces:
Closeable, HFile.Writer

@InterfaceAudience.Private
public class HFileWriterV3
extends HFileWriterV2

HFile writer for version 3.


Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.io.hfile.HFileWriterV2
fsBlockWriter, KEY_VALUE_VER_WITH_MEMSTORE, KEY_VALUE_VERSION, lastDataBlockOffset, MAX_MEMSTORE_TS_KEY, maxMemstoreTS
 
Fields inherited from class org.apache.hadoop.hbase.io.hfile.AbstractHFileWriter
blockEncoder, cacheConf, closeOutputStream, comparator, entryCount, fileInfo, firstKeyInBlock, hFileContext, lastKeyBuffer, lastKeyLength, lastKeyOffset, metaData, metaNames, name, outputStream, path, totalKeyLength, totalUncompressedBytes, totalValueLength
 
Constructor Summary
HFileWriterV3(org.apache.hadoop.conf.Configuration conf, CacheConfig cacheConf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.FSDataOutputStream ostream, KeyValue.KVComparator comparator, HFileContext fileContext)
          Constructor that takes a path, creates and closes the output stream.
 
Method Summary
 void append(byte[] key, byte[] value)
          Add key/value to file.
 void append(byte[] key, byte[] value, byte[] tag)
          Add key/value to file.
 void append(KeyValue kv)
          Add key/value to file.
protected  void finishClose(FixedFileTrailer trailer)
          Sets remaining trailer fields, writes the trailer to disk, and optionally closes the output stream.
protected  void finishFileInfo()
          Add last bits of metadata to file info before it is written out.
protected  int getMajorVersion()
           
protected  int getMinorVersion()
           
 
Methods inherited from class org.apache.hadoop.hbase.io.hfile.HFileWriterV2
addDeleteFamilyBloomFilter, addGeneralBloomFilter, addInlineBlockWriter, append, appendMetaBlock, checkBlockBoundary, close, finishInit, getFileContext, newBlock
 
Methods inherited from class org.apache.hadoop.hbase.io.hfile.AbstractHFileWriter
appendFileInfo, checkKey, checkValue, compressionByName, createOutputStream, getPath, toString, writeFileInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HFileWriterV3

public HFileWriterV3(org.apache.hadoop.conf.Configuration conf,
                     CacheConfig cacheConf,
                     org.apache.hadoop.fs.FileSystem fs,
                     org.apache.hadoop.fs.Path path,
                     org.apache.hadoop.fs.FSDataOutputStream ostream,
                     KeyValue.KVComparator comparator,
                     HFileContext fileContext)
              throws IOException
Constructor that takes a path, creates and closes the output stream.

Throws:
IOException
Method Detail

append

public void append(KeyValue kv)
            throws IOException
Add key/value to file. Keys must be added in an order that agrees with the Comparator passed on construction.

Specified by:
append in interface HFile.Writer
Overrides:
append in class HFileWriterV2
Parameters:
kv - KeyValue to add. Cannot be empty nor null.
Throws:
IOException

append

public void append(byte[] key,
                   byte[] value)
            throws IOException
Add key/value to file. Keys must be added in an order that agrees with the Comparator passed on construction.

Specified by:
append in interface HFile.Writer
Overrides:
append in class HFileWriterV2
Parameters:
key - Key to add. Cannot be empty nor null.
value - Value to add. Cannot be empty nor null.
Throws:
IOException

append

public void append(byte[] key,
                   byte[] value,
                   byte[] tag)
            throws IOException
Add key/value to file. Keys must be added in an order that agrees with the Comparator passed on construction.

Specified by:
append in interface HFile.Writer
Overrides:
append in class HFileWriterV2
Parameters:
key - Key to add. Cannot be empty nor null.
value - Value to add. Cannot be empty nor null.
tag - Tag t add. Cannot be empty or null.
Throws:
IOException

finishFileInfo

protected void finishFileInfo()
                       throws IOException
Description copied from class: AbstractHFileWriter
Add last bits of metadata to file info before it is written out.

Overrides:
finishFileInfo in class AbstractHFileWriter
Throws:
IOException

getMajorVersion

protected int getMajorVersion()
Overrides:
getMajorVersion in class HFileWriterV2

getMinorVersion

protected int getMinorVersion()
Overrides:
getMinorVersion in class HFileWriterV2

finishClose

protected void finishClose(FixedFileTrailer trailer)
                    throws IOException
Description copied from class: AbstractHFileWriter
Sets remaining trailer fields, writes the trailer to disk, and optionally closes the output stream.

Overrides:
finishClose in class AbstractHFileWriter
Throws:
IOException


Copyright © 2015 The Apache Software Foundation. All rights reserved.