From efdc0070d880c7e1b778e0029a1b827ca962ce70 Mon Sep 17 00:00:00 2001 From: Zhe Zhang Date: Wed, 24 Feb 2016 14:29:03 -0800 Subject: [PATCH] HADOOP-12808. Rename the RS coder from HDFS-RAID as legacy. Contributed by Rui Li. Change-Id: Icb64eb60833fe0139aadb6da9aa666f664defc0e --- .../hadoop-common/CHANGES.txt | 3 +++ .../hadoop/io/erasurecode/CodecUtil.java | 4 +-- ...awDecoder.java => RSRawDecoderLegacy.java} | 4 +-- ...awEncoder.java => RSRawEncoderLegacy.java} | 4 +-- ...va => RSRawErasureCoderFactoryLegacy.java} | 8 +++--- .../rawcoder/util/package-info.java | 27 +++++++++++++++++++ .../coder/TestHHXORErasureCoder.java | 4 +-- .../erasurecode/coder/TestRSErasureCoder.java | 4 +-- ...awCoder.java => TestRSRawCoderLegacy.java} | 9 +++---- 9 files changed, 48 insertions(+), 19 deletions(-) rename hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/{RSRawDecoder.java => RSRawDecoderLegacy.java} (98%) rename hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/{RSRawEncoder.java => RSRawEncoderLegacy.java} (96%) rename hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/{RSRawErasureCoderFactory.java => RSRawErasureCoderFactoryLegacy.java} (80%) create mode 100644 hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/util/package-info.java rename hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/erasurecode/rawcoder/{TestRSRawCoder.java => TestRSRawCoderLegacy.java} (81%) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 8fd61f0004a..c91820edcfd 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -653,6 +653,9 @@ Trunk (Unreleased) HADOOP-12041. Implement another Reed-Solomon coder in pure Java. (Kai Zheng via zhz) + HADOOP-12808. Rename the RS coder from HDFS-RAID as legacy. + (Rui Li via zhz) + Release 2.9.0 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/CodecUtil.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/CodecUtil.java index 87bedf86f5d..fd5bd672e9d 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/CodecUtil.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/CodecUtil.java @@ -43,7 +43,7 @@ public final class CodecUtil { CommonConfigurationKeys.IO_ERASURECODE_CODEC_RS_RAWCODER_KEY, true, numDataUnits, numParityUnits); if (rawCoder == null) { - rawCoder = new RSRawEncoder(numDataUnits, numParityUnits); + rawCoder = new RSRawEncoderLegacy(numDataUnits, numParityUnits); } return (RawErasureEncoder) rawCoder; @@ -62,7 +62,7 @@ public final class CodecUtil { CommonConfigurationKeys.IO_ERASURECODE_CODEC_RS_RAWCODER_KEY, false, numDataUnits, numParityUnits); if (rawCoder == null) { - rawCoder = new RSRawDecoder(numDataUnits, numParityUnits); + rawCoder = new RSRawDecoderLegacy(numDataUnits, numParityUnits); } return (RawErasureDecoder) rawCoder; diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawDecoder.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawDecoderLegacy.java similarity index 98% rename from hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawDecoder.java rename to hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawDecoderLegacy.java index b7ee49de785..7c8fa59dcfc 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawDecoder.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawDecoderLegacy.java @@ -34,7 +34,7 @@ import java.nio.ByteBuffer; * addressed in HADOOP-11871. */ @InterfaceAudience.Private -public class RSRawDecoder extends AbstractRawErasureDecoder { +public class RSRawDecoderLegacy extends AbstractRawErasureDecoder { // To describe and calculate the needed Vandermonde matrix private int[] errSignature; private int[] primitivePower; @@ -61,7 +61,7 @@ public class RSRawDecoder extends AbstractRawErasureDecoder { private ByteBuffer[] adjustedDirectBufferOutputsParameter = new ByteBuffer[getNumParityUnits()]; - public RSRawDecoder(int numDataUnits, int numParityUnits) { + public RSRawDecoderLegacy(int numDataUnits, int numParityUnits) { super(numDataUnits, numParityUnits); if (numDataUnits + numParityUnits >= RSUtil.GF.getFieldSize()) { throw new HadoopIllegalArgumentException( diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawEncoder.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawEncoderLegacy.java similarity index 96% rename from hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawEncoder.java rename to hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawEncoderLegacy.java index 0f25b2ae771..805772087e7 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawEncoder.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawEncoderLegacy.java @@ -29,10 +29,10 @@ import java.util.Arrays; * when possible. */ @InterfaceAudience.Private -public class RSRawEncoder extends AbstractRawErasureEncoder { +public class RSRawEncoderLegacy extends AbstractRawErasureEncoder { private int[] generatingPolynomial; - public RSRawEncoder(int numDataUnits, int numParityUnits) { + public RSRawEncoderLegacy(int numDataUnits, int numParityUnits) { super(numDataUnits, numParityUnits); assert (getNumDataUnits() + getNumParityUnits() < RSUtil.GF.getFieldSize()); diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawErasureCoderFactory.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawErasureCoderFactoryLegacy.java similarity index 80% rename from hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawErasureCoderFactory.java rename to hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawErasureCoderFactoryLegacy.java index b034cbf7f52..5aa75e4e168 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawErasureCoderFactory.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSRawErasureCoderFactoryLegacy.java @@ -20,18 +20,18 @@ package org.apache.hadoop.io.erasurecode.rawcoder; import org.apache.hadoop.classification.InterfaceAudience; /** - * A raw coder factory for raw Reed-Solomon coder in Java. + * A raw coder factory for the legacy raw Reed-Solomon coder in Java. */ @InterfaceAudience.Private -public class RSRawErasureCoderFactory implements RawErasureCoderFactory { +public class RSRawErasureCoderFactoryLegacy implements RawErasureCoderFactory { @Override public RawErasureEncoder createEncoder(int numDataUnits, int numParityUnits) { - return new RSRawEncoder(numDataUnits, numParityUnits); + return new RSRawEncoderLegacy(numDataUnits, numParityUnits); } @Override public RawErasureDecoder createDecoder(int numDataUnits, int numParityUnits) { - return new RSRawDecoder(numDataUnits, numParityUnits); + return new RSRawDecoderLegacy(numDataUnits, numParityUnits); } } diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/util/package-info.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/util/package-info.java new file mode 100644 index 00000000000..c2339ac1444 --- /dev/null +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/util/package-info.java @@ -0,0 +1,27 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * General helpers for implementing raw erasure coders. + */ +@InterfaceAudience.Private +@InterfaceStability.Unstable +package org.apache.hadoop.io.erasurecode.rawcoder.util; + +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; \ No newline at end of file diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/erasurecode/coder/TestHHXORErasureCoder.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/erasurecode/coder/TestHHXORErasureCoder.java index ad346e08fae..6372d48648d 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/erasurecode/coder/TestHHXORErasureCoder.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/erasurecode/coder/TestHHXORErasureCoder.java @@ -19,7 +19,7 @@ package org.apache.hadoop.io.erasurecode.coder; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.CommonConfigurationKeys; -import org.apache.hadoop.io.erasurecode.rawcoder.RSRawErasureCoderFactory; +import org.apache.hadoop.io.erasurecode.rawcoder.RSRawErasureCoderFactoryLegacy; import org.junit.Before; import org.junit.Test; @@ -51,7 +51,7 @@ public class TestHHXORErasureCoder extends TestHHErasureCoderBase { */ Configuration conf = new Configuration(); conf.set(CommonConfigurationKeys.IO_ERASURECODE_CODEC_RS_RAWCODER_KEY, - RSRawErasureCoderFactory.class.getCanonicalName()); + RSRawErasureCoderFactoryLegacy.class.getCanonicalName()); prepare(conf, 10, 4, new int[]{0}, new int[0]); testCoding(true); diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/erasurecode/coder/TestRSErasureCoder.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/erasurecode/coder/TestRSErasureCoder.java index 56ccac37278..213eee649ce 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/erasurecode/coder/TestRSErasureCoder.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/erasurecode/coder/TestRSErasureCoder.java @@ -19,7 +19,7 @@ package org.apache.hadoop.io.erasurecode.coder; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.CommonConfigurationKeys; -import org.apache.hadoop.io.erasurecode.rawcoder.RSRawErasureCoderFactory; +import org.apache.hadoop.io.erasurecode.rawcoder.RSRawErasureCoderFactoryLegacy; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -58,7 +58,7 @@ public class TestRSErasureCoder extends TestErasureCoderBase { */ Configuration conf = new Configuration(); conf.set(CommonConfigurationKeys.IO_ERASURECODE_CODEC_RS_RAWCODER_KEY, - RSRawErasureCoderFactory.class.getCanonicalName()); + RSRawErasureCoderFactoryLegacy.class.getCanonicalName()); prepare(conf, 10, 4, new int[]{0}, new int[0]); testCoding(true); diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/erasurecode/rawcoder/TestRSRawCoder.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/erasurecode/rawcoder/TestRSRawCoderLegacy.java similarity index 81% rename from hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/erasurecode/rawcoder/TestRSRawCoder.java rename to hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/erasurecode/rawcoder/TestRSRawCoderLegacy.java index 26458f37b7d..ef58e43f8d3 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/erasurecode/rawcoder/TestRSRawCoder.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/erasurecode/rawcoder/TestRSRawCoderLegacy.java @@ -18,17 +18,16 @@ package org.apache.hadoop.io.erasurecode.rawcoder; import org.junit.Before; -import org.junit.Test; /** - * Test raw Reed-solomon coder implemented in Java. + * Test the legacy raw Reed-solomon coder implemented in Java. */ -public class TestRSRawCoder extends TestRSRawCoderBase { +public class TestRSRawCoderLegacy extends TestRSRawCoderBase { @Before public void setup() { - this.encoderClass = RSRawEncoder.class; - this.decoderClass = RSRawDecoder.class; + this.encoderClass = RSRawEncoderLegacy.class; + this.decoderClass = RSRawDecoderLegacy.class; setAllowDump(false); // Change to true to allow verbose dump for debugging } }