Package org.apache.hadoop.io.erasurecode
Class CodecUtil
java.lang.Object
org.apache.hadoop.io.erasurecode.CodecUtil
A codec & coder utility to help create coders conveniently.
CodecUtil includes erasure coder configurations key and default
values such as coder class name and erasure codec option values included
by ErasureCodecOptions. ErasureEncoder and
ErasureDecoder are created by createEncoder and createDecoder
respectively.RawErasureEncoder and RawErasureDecoder are
are created by createRawEncoder and createRawDecoder.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final StringErasure coder hitch hiker XOR codec.static final booleanstatic final Stringstatic final Stringstatic final StringErasure coder Reed-Solomon codec.static final StringComma separated raw codec name.static final Stringstatic final Stringstatic final StringErasure coder XOR codec.static final StringRaw coder factory for the XOR codec. -
Method Summary
Modifier and TypeMethodDescriptionstatic ErasureDecodercreateDecoder(Configuration conf, ErasureCodecOptions options) Create decoder corresponding to given codec.static ErasureEncodercreateEncoder(Configuration conf, ErasureCodecOptions options) Create encoder corresponding to given codec.static RawErasureDecodercreateRawDecoder(Configuration conf, String codec, ErasureCoderOptions coderOptions) Create RS raw decoder according to configuration.static RawErasureEncodercreateRawEncoder(Configuration conf, String codec, ErasureCoderOptions coderOptions) Create RS raw encoder according to configuration.static boolean
-
Field Details
-
IO_ERASURECODE_CODEC
- See Also:
-
IO_ERASURECODE_CODEC_XOR_KEY
Erasure coder XOR codec.- See Also:
-
IO_ERASURECODE_CODEC_XOR
-
IO_ERASURECODE_CODEC_RS_KEY
Erasure coder Reed-Solomon codec.- See Also:
-
IO_ERASURECODE_CODEC_RS
-
IO_ERASURECODE_CODEC_HHXOR_KEY
Erasure coder hitch hiker XOR codec.- See Also:
-
IO_ERASURECODE_CODEC_HHXOR
-
IO_ERASURECODE_CODEC_RS_LEGACY_RAWCODERS_KEY
Comma separated raw codec name. The first coder is prior to the latter.- See Also:
-
IO_ERASURECODE_CODEC_RS_RAWCODERS_KEY
- See Also:
-
IO_ERASURECODE_CODEC_XOR_RAWCODERS_KEY
Raw coder factory for the XOR codec.- See Also:
-
IO_ERASURECODE_CODEC_NATIVE_ENABLED_KEY
- See Also:
-
IO_ERASURECODE_CODEC_NATIVE_ENABLED_DEFAULT
public static final boolean IO_ERASURECODE_CODEC_NATIVE_ENABLED_DEFAULT- See Also:
-
-
Method Details
-
createEncoder
Create encoder corresponding to given codec.- Parameters:
options- Erasure codec optionsconf- configuration.- Returns:
- erasure encoder
-
createDecoder
Create decoder corresponding to given codec.- Parameters:
options- Erasure codec optionsconf- configuration.- Returns:
- erasure decoder
-
createRawEncoder
public static RawErasureEncoder createRawEncoder(Configuration conf, String codec, ErasureCoderOptions coderOptions) Create RS raw encoder according to configuration.- Parameters:
conf- configurationcoderOptions- coder options that's used to create the codercodec- the codec to use. If null, will use the default codec- Returns:
- raw encoder
-
createRawDecoder
public static RawErasureDecoder createRawDecoder(Configuration conf, String codec, ErasureCoderOptions coderOptions) Create RS raw decoder according to configuration.- Parameters:
conf- configurationcoderOptions- coder options that's used to create the codercodec- the codec to use. If null, will use the default codec- Returns:
- raw decoder
-
hasCodec
-