Search in sources :

Example 1 with RawErasureDecoder

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);
}
Also used : RawErasureDecoder(org.apache.hadoop.io.erasurecode.rawcoder.RawErasureDecoder) ECBlock(org.apache.hadoop.io.erasurecode.ECBlock)

Example 2 with RawErasureDecoder

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);
}
Also used : RawErasureDecoder(org.apache.hadoop.io.erasurecode.rawcoder.RawErasureDecoder) ECBlock(org.apache.hadoop.io.erasurecode.ECBlock)

Example 3 with RawErasureDecoder

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);
}
Also used : RSRawDecoderLegacy(org.apache.hadoop.io.erasurecode.rawcoder.RSRawDecoderLegacy) RSRawEncoder(org.apache.hadoop.io.erasurecode.rawcoder.RSRawEncoder) RawErasureDecoder(org.apache.hadoop.io.erasurecode.rawcoder.RawErasureDecoder) RSRawEncoderLegacy(org.apache.hadoop.io.erasurecode.rawcoder.RSRawEncoderLegacy) RawErasureEncoder(org.apache.hadoop.io.erasurecode.rawcoder.RawErasureEncoder) RSRawDecoder(org.apache.hadoop.io.erasurecode.rawcoder.RSRawDecoder) Test(org.junit.Test)

Example 4 with RawErasureDecoder

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);
}
Also used : RawErasureDecoder(org.apache.hadoop.io.erasurecode.rawcoder.RawErasureDecoder) DummyRawDecoder(org.apache.hadoop.io.erasurecode.rawcoder.DummyRawDecoder) ECBlock(org.apache.hadoop.io.erasurecode.ECBlock)

Example 5 with RawErasureDecoder

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);
}
Also used : RawErasureDecoder(org.apache.hadoop.io.erasurecode.rawcoder.RawErasureDecoder) RawErasureEncoder(org.apache.hadoop.io.erasurecode.rawcoder.RawErasureEncoder) ECBlock(org.apache.hadoop.io.erasurecode.ECBlock)

Aggregations

RawErasureDecoder (org.apache.hadoop.io.erasurecode.rawcoder.RawErasureDecoder)7 ECBlock (org.apache.hadoop.io.erasurecode.ECBlock)4 Test (org.junit.Test)3 Block (org.apache.hadoop.hdfs.protocol.Block)2 LocatedBlock (org.apache.hadoop.hdfs.protocol.LocatedBlock)2 LocatedBlocks (org.apache.hadoop.hdfs.protocol.LocatedBlocks)2 LocatedStripedBlock (org.apache.hadoop.hdfs.protocol.LocatedStripedBlock)2 ErasureCoderOptions (org.apache.hadoop.io.erasurecode.ErasureCoderOptions)2 RawErasureEncoder (org.apache.hadoop.io.erasurecode.rawcoder.RawErasureEncoder)2 DummyRawDecoder (org.apache.hadoop.io.erasurecode.rawcoder.DummyRawDecoder)1 RSRawDecoder (org.apache.hadoop.io.erasurecode.rawcoder.RSRawDecoder)1 RSRawDecoderLegacy (org.apache.hadoop.io.erasurecode.rawcoder.RSRawDecoderLegacy)1 RSRawEncoder (org.apache.hadoop.io.erasurecode.rawcoder.RSRawEncoder)1 RSRawEncoderLegacy (org.apache.hadoop.io.erasurecode.rawcoder.RSRawEncoderLegacy)1