@InterfaceAudience.Private public class HFileDataBlockEncoderImpl extends Object implements HFileDataBlockEncoder
Modifier and Type | Field and Description |
---|---|
private DataBlockEncoding |
encoding |
DATA_BLOCK_ENCODING
Constructor and Description |
---|
HFileDataBlockEncoderImpl(DataBlockEncoding encoding)
Do data block encoding with specified options.
|
Modifier and Type | Method and Description |
---|---|
static HFileDataBlockEncoder |
createFromFileInfo(HFileInfo fileInfo) |
void |
encode(Cell cell,
HFileBlockEncodingContext encodingCtx,
DataOutputStream out)
Encodes a KeyValue.
|
void |
endBlockEncoding(HFileBlockEncodingContext encodingCtx,
DataOutputStream out,
byte[] uncompressedBytesWithHeader,
BlockType blockType)
Ends encoding for a block of KeyValues.
|
DataBlockEncoding |
getDataBlockEncoding()
Returns the data block encoding
|
DataBlockEncoding |
getEffectiveEncodingInCache(boolean isCompaction) |
HFileBlockDecodingContext |
newDataBlockDecodingContext(org.apache.hadoop.conf.Configuration conf,
HFileContext fileContext)
create a encoder specific decoding context for reading.
|
HFileBlockEncodingContext |
newDataBlockEncodingContext(org.apache.hadoop.conf.Configuration conf,
byte[] dummyHeader,
HFileContext fileContext)
Create an encoder specific encoding context object for writing.
|
void |
saveMetadata(HFile.Writer writer)
Save metadata in HFile which will be written to disk
|
void |
startBlockEncoding(HFileBlockEncodingContext encodingCtx,
DataOutputStream out)
Starts encoding for a block of KeyValues.
|
String |
toString() |
boolean |
useEncodedScanner()
Decides whether we should use a scanner over encoded blocks.
|
boolean |
useEncodedScanner(boolean isCompaction) |
private final DataBlockEncoding encoding
public HFileDataBlockEncoderImpl(DataBlockEncoding encoding)
encoding
- What kind of data block encoding will be used.public static HFileDataBlockEncoder createFromFileInfo(HFileInfo fileInfo) throws IOException
IOException
public void saveMetadata(HFile.Writer writer) throws IOException
HFileDataBlockEncoder
saveMetadata
in interface HFileDataBlockEncoder
writer
- writer for a given HFileIOException
- on disk problemspublic DataBlockEncoding getDataBlockEncoding()
HFileDataBlockEncoder
getDataBlockEncoding
in interface HFileDataBlockEncoder
public boolean useEncodedScanner(boolean isCompaction)
public DataBlockEncoding getEffectiveEncodingInCache(boolean isCompaction)
getEffectiveEncodingInCache
in interface HFileDataBlockEncoder
public void encode(Cell cell, HFileBlockEncodingContext encodingCtx, DataOutputStream out) throws IOException
HFileDataBlockEncoder
encode
in interface HFileDataBlockEncoder
IOException
public boolean useEncodedScanner()
HFileDataBlockEncoder
useEncodedScanner
in interface HFileDataBlockEncoder
public HFileBlockEncodingContext newDataBlockEncodingContext(org.apache.hadoop.conf.Configuration conf, byte[] dummyHeader, HFileContext fileContext)
HFileDataBlockEncoder
newDataBlockEncodingContext
in interface HFileDataBlockEncoder
conf
- store configurationdummyHeader
- header bytesfileContext
- HFile meta dataHFileBlockEncodingContext
objectpublic HFileBlockDecodingContext newDataBlockDecodingContext(org.apache.hadoop.conf.Configuration conf, HFileContext fileContext)
HFileDataBlockEncoder
newDataBlockDecodingContext
in interface HFileDataBlockEncoder
conf
- store configurationfileContext
- - HFile meta dataHFileBlockDecodingContext
objectpublic void startBlockEncoding(HFileBlockEncodingContext encodingCtx, DataOutputStream out) throws IOException
HFileDataBlockEncoder
HFileDataBlockEncoder.endBlockEncoding(HFileBlockEncodingContext, DataOutputStream, byte[], BlockType)
to
finish encoding of a block. nnnstartBlockEncoding
in interface HFileDataBlockEncoder
IOException
public void endBlockEncoding(HFileBlockEncodingContext encodingCtx, DataOutputStream out, byte[] uncompressedBytesWithHeader, BlockType blockType) throws IOException
HFileDataBlockEncoder
endBlockEncoding
in interface HFileDataBlockEncoder
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.