@InterfaceAudience.Private public class HFileWriterV2 extends AbstractHFileWriter
| Modifier and Type | Class and Description | 
|---|---|
| (package private) static class  | HFileWriterV2.WriterFactoryV2 | 
| Modifier and Type | Field and Description | 
|---|---|
| private List<HFileBlock.BlockWritable> | additionalLoadOnOpenDataAdditional data items to be written to the "load-on-open" section. | 
| private HFileBlockIndex.BlockIndexWriter | dataBlockIndexWriter | 
| private long | firstDataBlockOffsetThe offset of the first data block or -1 if the file is empty. | 
| protected HFileBlock.Writer | fsBlockWriterUnified version 2 block writer | 
| private List<InlineBlockWriter> | inlineBlockWritersInline block writers for multi-level block index and compound Blooms. | 
| static int | KEY_VALUE_VER_WITH_MEMSTOREVersion for KeyValue which includes memstore timestamp | 
| static byte[] | KEY_VALUE_VERSIONKeyValue version in FileInfo | 
| private Cell | lastCellOfPreviousBlockThe last(stop) Cell of the previous data block. | 
| protected long | lastDataBlockOffsetThe offset of the last data block or 0 if the file is empty. | 
| (package private) static org.apache.commons.logging.Log | LOG | 
| static byte[] | MAX_MEMSTORE_TS_KEYMax memstore (mvcc) timestamp in FileInfo | 
| protected long | maxMemstoreTS | 
| private HFileBlockIndex.BlockIndexWriter | metaBlockIndexWriter | 
| private static boolean | WARN_CELL_WITH_TAGSwarn on cell with tags | 
blockEncoder, cacheConf, closeOutputStream, comparator, entryCount, fileInfo, firstCellInBlock, hFileContext, lastCell, metaData, metaNames, name, outputStream, path, totalKeyLength, totalUncompressedBytes, totalValueLength| Constructor and Description | 
|---|
| HFileWriterV2(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 context)Constructor that takes a path, creates and closes the output stream. | 
| Modifier and Type | Method and Description | 
|---|---|
| private void | addBloomFilter(BloomFilterWriter bfw,
              BlockType blockType) | 
| void | addDeleteFamilyBloomFilter(BloomFilterWriter bfw)Store delete family Bloom filter in the file, which is only supported in
 HFile V2. | 
| void | addGeneralBloomFilter(BloomFilterWriter bfw)Store general Bloom filter in the file. | 
| void | addInlineBlockWriter(InlineBlockWriter ibw)Adds an inline block writer such as a multi-level block index writer or
 a compound Bloom filter writer. | 
| void | append(Cell cell)Add key/value to file. | 
| void | appendMetaBlock(String metaBlockName,
               org.apache.hadoop.io.Writable content)Add a meta block to the end of the file. | 
| protected void | checkBlockBoundary()At a block boundary, write all the inline blocks and opens new block. | 
| void | close() | 
| private void | doCacheOnWrite(long offset)Caches the last written HFile block. | 
| private void | finishBlock()Clean up the current data block | 
| protected void | finishInit(org.apache.hadoop.conf.Configuration conf)Additional initialization steps | 
| HFileContext | getFileContext()Return the file context for the HFile this writer belongs to | 
| protected int | getMajorVersion() | 
| protected int | getMinorVersion() | 
| protected void | newBlock()Ready a new block for writing. | 
| private void | writeInlineBlocks(boolean closing)Gives inline block writers an opportunity to contribute blocks. | 
appendFileInfo, checkKey, checkValue, compressionByName, createOutputStream, finishClose, finishFileInfo, getPath, toString, writeFileInfostatic final org.apache.commons.logging.Log LOG
public static final byte[] MAX_MEMSTORE_TS_KEY
public static final byte[] KEY_VALUE_VERSION
public static final int KEY_VALUE_VER_WITH_MEMSTORE
private List<InlineBlockWriter> inlineBlockWriters
protected HFileBlock.Writer fsBlockWriter
private HFileBlockIndex.BlockIndexWriter dataBlockIndexWriter
private HFileBlockIndex.BlockIndexWriter metaBlockIndexWriter
private long firstDataBlockOffset
protected long lastDataBlockOffset
private Cell lastCellOfPreviousBlock
private List<HFileBlock.BlockWritable> additionalLoadOnOpenData
protected long maxMemstoreTS
private static boolean WARN_CELL_WITH_TAGS
public HFileWriterV2(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 context)
              throws IOException
IOExceptionprotected void finishInit(org.apache.hadoop.conf.Configuration conf)
protected void checkBlockBoundary()
                           throws IOException
IOExceptionprivate void finishBlock()
                  throws IOException
IOExceptionprivate void writeInlineBlocks(boolean closing)
                        throws IOException
IOExceptionprivate void doCacheOnWrite(long offset)
offset - the offset of the block we want to cache. Used to determine
          the cache key.protected void newBlock()
                 throws IOException
IOExceptionpublic void appendMetaBlock(String metaBlockName, org.apache.hadoop.io.Writable content)
AbstractHFileWriter.appendFileInfo(byte[], byte[])metaBlockName - name of the blockcontent - will call readFields to get data later (DO NOT REUSE)public void append(Cell cell) throws IOException
cell - Cell to add. Cannot be empty nor null.IOExceptionpublic void close()
           throws IOException
IOExceptionpublic void addInlineBlockWriter(InlineBlockWriter ibw)
HFile.Writerpublic void addGeneralBloomFilter(BloomFilterWriter bfw)
HFile.Writerpublic void addDeleteFamilyBloomFilter(BloomFilterWriter bfw)
HFile.Writerprivate void addBloomFilter(BloomFilterWriter bfw, BlockType blockType)
protected int getMajorVersion()
protected int getMinorVersion()
public HFileContext getFileContext()
HFile.WriterCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.