Skip to content

Commit fa48363

Browse files
committed
Revert "HDFS-13732. ECAdmin should print the policy name when an EC policy is set. Contributed by Zsolt Venczel."
This reverts commit 7dc79a8.
1 parent c5203b0 commit fa48363

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/ECAdmin.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -358,16 +358,16 @@ public int run(Configuration conf, List<String> args) throws IOException {
358358
final DistributedFileSystem dfs = AdminHelper.getDFS(p.toUri(), conf);
359359
try {
360360
dfs.setErasureCodingPolicy(p, ecPolicyName);
361-
362-
String actualECPolicyName = dfs.getErasureCodingPolicy(p).getName();
363-
364-
System.out.println("Set " + actualECPolicyName +
365-
" erasure coding policy on "+ path);
361+
if (ecPolicyName == null){
362+
ecPolicyName = "default";
363+
}
364+
System.out.println("Set " + ecPolicyName + " erasure coding policy on" +
365+
" " + path);
366366
RemoteIterator<FileStatus> dirIt = dfs.listStatusIterator(p);
367367
if (dirIt.hasNext()) {
368368
System.out.println("Warning: setting erasure coding policy on a " +
369369
"non-empty directory will not automatically convert existing " +
370-
"files to " + actualECPolicyName + " erasure coding policy");
370+
"files to " + ecPolicyName + " erasure coding policy");
371371
}
372372
} catch (Exception e) {
373373
System.err.println(AdminHelper.prettifyException(e));

hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testErasureCodingConf.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@
734734
<comparators>
735735
<comparator>
736736
<type>SubstringComparator</type>
737-
<expected-output>Set RS-6-3-1024k erasure coding policy on /ecdir</expected-output>
737+
<expected-output>Set default erasure coding policy on /ecdir</expected-output>
738738
</comparator>
739739
</comparators>
740740
</test>
@@ -752,11 +752,11 @@
752752
<comparators>
753753
<comparator>
754754
<type>SubstringComparator</type>
755-
<expected-output>Set RS-6-3-1024k erasure coding policy on /ecdir</expected-output>
755+
<expected-output>Set default erasure coding policy on /ecdir</expected-output>
756756
</comparator>
757757
<comparator>
758758
<type>SubstringComparator</type>
759-
<expected-output>Warning: setting erasure coding policy on a non-empty directory will not automatically convert existing files to RS-6-3-1024k erasure coding policy</expected-output>
759+
<expected-output>Warning: setting erasure coding policy on a non-empty directory will not automatically convert existing files to default erasure coding policy</expected-output>
760760
</comparator>
761761
</comparators>
762762
</test>

0 commit comments

Comments
 (0)