@InterfaceAudience.Private public class HFileDataBlockEncoderImpl extends Object implements HFileDataBlockEncoder
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(HFile.FileInfo fileInfo) |
int |
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() |
DataBlockEncoding |
getEffectiveEncodingInCache(boolean isCompaction) |
HFileBlockDecodingContext |
newDataBlockDecodingContext(HFileContext fileContext)
create a encoder specific decoding context for reading.
|
HFileBlockEncodingContext |
newDataBlockEncodingContext(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) |
public HFileDataBlockEncoderImpl(DataBlockEncoding encoding)
encoding
- What kind of data block encoding will be used.public static HFileDataBlockEncoder createFromFileInfo(HFile.FileInfo 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()
getDataBlockEncoding
in interface HFileDataBlockEncoder
public boolean useEncodedScanner(boolean isCompaction)
public DataBlockEncoding getEffectiveEncodingInCache(boolean isCompaction)
getEffectiveEncodingInCache
in interface HFileDataBlockEncoder
public int 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(byte[] dummyHeader, HFileContext fileContext)
HFileDataBlockEncoder
newDataBlockEncodingContext
in interface HFileDataBlockEncoder
dummyHeader
- header bytesfileContext
- HFile meta dataHFileBlockEncodingContext
objectpublic HFileBlockDecodingContext newDataBlockDecodingContext(HFileContext fileContext)
HFileDataBlockEncoder
newDataBlockDecodingContext
in interface HFileDataBlockEncoder
fileContext
- - 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.startBlockEncoding
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–2019 Cloudera. All rights reserved.