use of org.apache.hadoop.io.erasurecode.rawcoder.RawErasureDecoder in project hadoop by apache.
the class RSErasureDecoder method prepareDecodingStep.
@Override
protected ErasureCodingStep prepareDecodingStep(final ECBlockGroup blockGroup) {
ECBlock[] inputBlocks = getInputBlocks(blockGroup);
ECBlock[] outputBlocks = getOutputBlocks(blockGroup);
RawErasureDecoder rawDecoder = checkCreateRSRawDecoder();
return new ErasureDecodingStep(inputBlocks, getErasedIndexes(inputBlocks), outputBlocks, rawDecoder);
}
use of org.apache.hadoop.io.erasurecode.rawcoder.RawErasureDecoder in project hadoop by apache.
the class XORErasureDecoder method prepareDecodingStep.
@Override
protected ErasureCodingStep prepareDecodingStep(final ECBlockGroup blockGroup) {
RawErasureDecoder rawDecoder = CodecUtil.createRawDecoder(getConf(), ErasureCodeConstants.XOR_CODEC_NAME, getOptions());
ECBlock[] inputBlocks = getInputBlocks(blockGroup);
return new ErasureDecodingStep(inputBlocks, getErasedIndexes(inputBlocks), getOutputBlocks(blockGroup), rawDecoder);
}
use of org.apache.hadoop.io.erasurecode.rawcoder.RawErasureDecoder in project hadoop by apache.
the class TestCodecRawCoderMapping method testRSDefaultRawCoder.
@Test
public void testRSDefaultRawCoder() {
ErasureCoderOptions coderOptions = new ErasureCoderOptions(numDataUnit, numParityUnit);
// should return default raw coder of rs codec
RawErasureEncoder encoder = CodecUtil.createRawEncoder(conf, ErasureCodeConstants.RS_CODEC_NAME, coderOptions);
Assert.assertTrue(encoder instanceof RSRawEncoder);
RawErasureDecoder decoder = CodecUtil.createRawDecoder(conf, ErasureCodeConstants.RS_CODEC_NAME, coderOptions);
Assert.assertTrue(decoder instanceof RSRawDecoder);
// should return default raw coder of rs-legacy codec
encoder = CodecUtil.createRawEncoder(conf, ErasureCodeConstants.RS_LEGACY_CODEC_NAME, coderOptions);
Assert.assertTrue(encoder instanceof RSRawEncoderLegacy);
decoder = CodecUtil.createRawDecoder(conf, ErasureCodeConstants.RS_LEGACY_CODEC_NAME, coderOptions);
Assert.assertTrue(decoder instanceof RSRawDecoderLegacy);
}
use of org.apache.hadoop.io.erasurecode.rawcoder.RawErasureDecoder in project hadoop by apache.
the class DummyErasureDecoder method prepareDecodingStep.
@Override
protected ErasureCodingStep prepareDecodingStep(ECBlockGroup blockGroup) {
RawErasureDecoder rawDecoder = new DummyRawDecoder(getOptions());
ECBlock[] inputBlocks = getInputBlocks(blockGroup);
return new ErasureDecodingStep(inputBlocks, getErasedIndexes(inputBlocks), getOutputBlocks(blockGroup), rawDecoder);
}
use of org.apache.hadoop.io.erasurecode.rawcoder.RawErasureDecoder in project hadoop by apache.
the class HHXORErasureDecoder method prepareDecodingStep.
@Override
protected ErasureCodingStep prepareDecodingStep(final ECBlockGroup blockGroup) {
RawErasureDecoder rawDecoder;
RawErasureEncoder rawEncoder;
ECBlock[] inputBlocks = getInputBlocks(blockGroup);
ECBlock[] outputBlocks = getOutputBlocks(blockGroup);
rawDecoder = checkCreateRSRawDecoder();
rawEncoder = checkCreateXorRawEncoder();
return new HHXORErasureDecodingStep(inputBlocks, getErasedIndexes(inputBlocks), outputBlocks, rawDecoder, rawEncoder);
}
Aggregations