HDFS-15576. Erasure Coding: Add rs and rs-legacy codec test for addPolicies. Contributed by Fei Hui.
This commit is contained in:
parent
f4ed9f3f91
commit
5c5b2ed7c7
|
@ -52,12 +52,12 @@ public class TestECPolicyLoader {
|
|||
out.println("<layoutversion>1</layoutversion>");
|
||||
out.println("<schemas>");
|
||||
out.println(" <schema id=\"RSk12m4\">");
|
||||
out.println(" <codec>RS</codec>");
|
||||
out.println(" <codec>rs</codec>");
|
||||
out.println(" <k>12</k>");
|
||||
out.println(" <m>4</m>");
|
||||
out.println(" </schema>");
|
||||
out.println(" <schema id=\"RS-legacyk12m4\">");
|
||||
out.println(" <codec>RS-legacy</codec>");
|
||||
out.println(" <codec>rs-legacy</codec>");
|
||||
out.println(" <k>12</k>");
|
||||
out.println(" <m>4</m>");
|
||||
out.println(" </schema>");
|
||||
|
@ -87,7 +87,7 @@ public class TestECPolicyLoader {
|
|||
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 class TestECPolicyLoader {
|
|||
assertEquals(0, schema2.getExtraOptions().size());
|
||||
assertEquals(12, schema2.getNumDataUnits());
|
||||
assertEquals(4, schema2.getNumParityUnits());
|
||||
assertEquals("RS-legacy", schema2.getCodecName());
|
||||
assertEquals("rs-legacy", schema2.getCodecName());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -484,6 +484,14 @@
|
|||
<type>SubstringComparator</type>
|
||||
<expected-output>Add ErasureCodingPolicy XOR-2-1-128k succeed</expected-output>
|
||||
</comparator>
|
||||
<comparator>
|
||||
<type>SubstringComparator</type>
|
||||
<expected-output>Add ErasureCodingPolicy RS-12-4-128k succeed</expected-output>
|
||||
</comparator>
|
||||
<comparator>
|
||||
<type>SubstringComparator</type>
|
||||
<expected-output>Add ErasureCodingPolicy RS-LEGACY-12-4-128k succeed</expected-output>
|
||||
</comparator>
|
||||
<comparator>
|
||||
<type>SubstringComparator</type>
|
||||
<expected-output>Add ErasureCodingPolicy RS-6-3-1024k failed</expected-output>
|
||||
|
|
|
@ -41,7 +41,20 @@
|
|||
<m>1</m>
|
||||
<options> </options>
|
||||
</schema>
|
||||
<schema id="RSk12m4">
|
||||
<codec>rs</codec>
|
||||
<k>12</k>
|
||||
<m>4</m>
|
||||
<options> </options>
|
||||
</schema>
|
||||
<schema id="RS-LEGACYk12m4">
|
||||
<codec>rs-legacy</codec>
|
||||
<k>12</k>
|
||||
<m>4</m>
|
||||
<options> </options>
|
||||
</schema>
|
||||
<schema id="RSk6m3">
|
||||
<!-- just for failed test -->
|
||||
<codec>RS</codec>
|
||||
<k>6</k>
|
||||
<m>3</m>
|
||||
|
@ -57,6 +70,14 @@
|
|||
<!-- cellsize must be an positive integer multiple of 1024(1k) -->
|
||||
<cellsize>131072</cellsize>
|
||||
</policy>
|
||||
<policy>
|
||||
<schema>RSk12m4</schema>
|
||||
<cellsize>131072</cellsize>
|
||||
</policy>
|
||||
<policy>
|
||||
<schema>RS-LEGACYk12m4</schema>
|
||||
<cellsize>131072</cellsize>
|
||||
</policy>
|
||||
<policy>
|
||||
<schema>RSk6m3</schema>
|
||||
<cellsize>1048576</cellsize>
|
||||
|
|
Loading…
Reference in New Issue