Revert "HDFS-13732. ECAdmin should print the policy name when an EC policy is set. Contributed by Zsolt Venczel."

This reverts commit 0424715207.
This commit is contained in:
Xiao Chen 2018-11-13 12:45:35 -08:00
parent abd9d93a55
commit 8ab6aa1b42
2 changed files with 9 additions and 9 deletions

View File

@ -357,16 +357,16 @@ public class ECAdmin extends Configured implements Tool {
final DistributedFileSystem dfs = AdminHelper.getDFS(p.toUri(), conf);
try {
dfs.setErasureCodingPolicy(p, ecPolicyName);
String actualECPolicyName = dfs.getErasureCodingPolicy(p).getName();
System.out.println("Set " + actualECPolicyName +
" erasure coding policy on "+ path);
if (ecPolicyName == null){
ecPolicyName = "default";
}
System.out.println("Set " + ecPolicyName + " erasure coding policy on" +
" " + path);
RemoteIterator<FileStatus> dirIt = dfs.listStatusIterator(p);
if (dirIt.hasNext()) {
System.out.println("Warning: setting erasure coding policy on a " +
"non-empty directory will not automatically convert existing " +
"files to " + actualECPolicyName + " erasure coding policy");
"files to " + ecPolicyName + " erasure coding policy");
}
} catch (Exception e) {
System.err.println(AdminHelper.prettifyException(e));

View File

@ -710,7 +710,7 @@
<comparators>
<comparator>
<type>SubstringComparator</type>
<expected-output>Set RS-6-3-1024k erasure coding policy on /ecdir</expected-output>
<expected-output>Set default erasure coding policy on /ecdir</expected-output>
</comparator>
</comparators>
</test>
@ -728,11 +728,11 @@
<comparators>
<comparator>
<type>SubstringComparator</type>
<expected-output>Set RS-6-3-1024k erasure coding policy on /ecdir</expected-output>
<expected-output>Set default erasure coding policy on /ecdir</expected-output>
</comparator>
<comparator>
<type>SubstringComparator</type>
<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>
<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>
</comparator>
</comparators>
</test>