From 5c5b2ed7c7f26b0b26f4216c5c5e83efc535e052 Mon Sep 17 00:00:00 2001 From: Takanobu Asanuma Date: Wed, 16 Sep 2020 01:36:46 +0900 Subject: [PATCH] HDFS-15576. Erasure Coding: Add rs and rs-legacy codec test for addPolicies. Contributed by Fei Hui. --- .../hadoop/hdfs/util/TestECPolicyLoader.java | 8 +++---- .../test/resources/testErasureCodingConf.xml | 8 +++++++ .../src/test/resources/test_ec_policies.xml | 21 +++++++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/hdfs/util/TestECPolicyLoader.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/hdfs/util/TestECPolicyLoader.java index a6adb97dac..55fa56784f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/hdfs/util/TestECPolicyLoader.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/hdfs/util/TestECPolicyLoader.java @@ -52,12 +52,12 @@ public void testLoadECPolicy() throws Exception { out.println("1"); out.println(""); out.println(" "); - out.println(" RS"); + out.println(" rs"); out.println(" 12"); out.println(" 4"); out.println(" "); out.println(" "); - out.println(" RS-legacy"); + out.println(" rs-legacy"); out.println(" 12"); out.println(" 4"); out.println(" "); @@ -87,7 +87,7 @@ public void testLoadECPolicy() throws Exception { assertEquals(0, schema1.getExtraOptions().size()); assertEquals(12, schema1.getNumDataUnits()); assertEquals(4, schema1.getNumParityUnits()); - assertEquals("RS", schema1.getCodecName()); + assertEquals("rs", schema1.getCodecName()); ErasureCodingPolicy policy2 = policies.get(1); ECSchema schema2 = policy2.getSchema(); @@ -95,7 +95,7 @@ public void testLoadECPolicy() throws Exception { assertEquals(0, schema2.getExtraOptions().size()); assertEquals(12, schema2.getNumDataUnits()); assertEquals(4, schema2.getNumParityUnits()); - assertEquals("RS-legacy", schema2.getCodecName()); + assertEquals("rs-legacy", schema2.getCodecName()); } /** diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testErasureCodingConf.xml b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testErasureCodingConf.xml index 2cc08f4aa5..f527d35ef8 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testErasureCodingConf.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testErasureCodingConf.xml @@ -484,6 +484,14 @@ SubstringComparator Add ErasureCodingPolicy XOR-2-1-128k succeed + + SubstringComparator + Add ErasureCodingPolicy RS-12-4-128k succeed + + + SubstringComparator + Add ErasureCodingPolicy RS-LEGACY-12-4-128k succeed + SubstringComparator Add ErasureCodingPolicy RS-6-3-1024k failed diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/test_ec_policies.xml b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/test_ec_policies.xml index 6d5bb28313..6c5dc070ae 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/test_ec_policies.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/test_ec_policies.xml @@ -41,7 +41,20 @@ 1 + + rs + 12 + 4 + + + + rs-legacy + 12 + 4 + + + RS 6 3 @@ -57,6 +70,14 @@ 131072 + + RSk12m4 + 131072 + + + RS-LEGACYk12m4 + 131072 + RSk6m3 1048576