@InterfaceAudience.Private public class HFileWriterV2 extends AbstractHFileWriter
Modifier and Type | Field and Description |
---|---|
protected HFileBlock.Writer |
fsBlockWriter
Unified version 2 block writer
|
static int |
KEY_VALUE_VER_WITH_MEMSTORE
Version for KeyValue which includes memstore timestamp
|
static byte[] |
KEY_VALUE_VERSION
KeyValue version in FileInfo
|
protected long |
lastDataBlockOffset
The offset of the last data block or 0 if the file is empty.
|
static byte[] |
MAX_MEMSTORE_TS_KEY
Max memstore (mvcc) timestamp in FileInfo
|
protected long |
maxMemstoreTS |
static String |
UNIFIED_ENCODED_BLOCKSIZE_RATIO
if this feature is enabled, preCalculate encoded data size before real encoding happens
|
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 |
---|---|
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() |
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.
|
appendFileInfo, checkKey, checkValue, compressionByName, createOutputStream, finishClose, finishFileInfo, getPath, toString, writeFileInfo
public static final byte[] MAX_MEMSTORE_TS_KEY
public static final byte[] KEY_VALUE_VERSION
public static final int KEY_VALUE_VER_WITH_MEMSTORE
protected HFileBlock.Writer fsBlockWriter
protected long lastDataBlockOffset
protected long maxMemstoreTS
public static final String UNIFIED_ENCODED_BLOCKSIZE_RATIO
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
IOException
protected void finishInit(org.apache.hadoop.conf.Configuration conf)
protected void checkBlockBoundary() throws IOException
IOException
protected void newBlock() throws IOException
IOException
public 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.IOException
public void close() throws IOException
IOException
public void addInlineBlockWriter(InlineBlockWriter ibw)
HFile.Writer
public void addGeneralBloomFilter(BloomFilterWriter bfw)
HFile.Writer
public void addDeleteFamilyBloomFilter(BloomFilterWriter bfw)
HFile.Writer
protected int getMajorVersion()
protected int getMinorVersion()
public HFileContext getFileContext()
HFile.Writer
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.