Skip to content

Commit

Permalink
HDFS-8364. Erasure coding: fix some minor bugs in EC CLI (Contributed…
Browse files Browse the repository at this point in the history
… by Walter Su)
  • Loading branch information
vinayakumarb authored and Zhe Zhang committed May 26, 2015
1 parent 9798065 commit bba15e0
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 4 deletions.
3 changes: 3 additions & 0 deletions hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,6 @@

HDFS-8195. Erasure coding: Fix file quota change when we complete/commit
the striped blocks. (Takuya Fukudome via zhz)

HDFS-8364. Erasure coding: fix some minor bugs in EC CLI
(Walter Su via vinayakumarb)
1 change: 1 addition & 0 deletions hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function hadoop_usage
echo " datanode run a DFS datanode"
echo " dfs run a filesystem command on the file system"
echo " dfsadmin run a DFS admin client"
echo " erasurecode configure HDFS erasure coding zones"
echo " fetchdt fetch a delegation token from the NameNode"
echo " fsck run a DFS filesystem checking utility"
echo " getconf get config values from configuration"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ protected void processPath(PathData item) throws IOException {
out.println("EC Zone created successfully at " + item.path);
} catch (IOException e) {
throw new IOException("Unable to create EC zone for the path "
+ item.path, e);
+ item.path + ". " + e.getMessage());
}
}
}
Expand Down Expand Up @@ -165,10 +165,14 @@ protected void processPath(PathData item) throws IOException {
DistributedFileSystem dfs = (DistributedFileSystem) item.fs;
try {
ErasureCodingZoneInfo ecZoneInfo = dfs.getErasureCodingZoneInfo(item.path);
out.println(ecZoneInfo.toString());
if (ecZoneInfo != null) {
out.println(ecZoneInfo.toString());
} else {
out.println("Path " + item.path + " is not in EC zone");
}
} catch (IOException e) {
throw new IOException("Unable to create EC zone for the path "
+ item.path, e);
throw new IOException("Unable to get EC zone for the path "
+ item.path + ". " + e.getMessage());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,24 @@
</comparators>
</test>

<test>
<description>createZone : create a zone twice</description>
<test-commands>
<command>-fs NAMENODE -mkdir /eczone</command>
<ec-admin-command>-fs NAMENODE -createZone /eczone</ec-admin-command>
<ec-admin-command>-fs NAMENODE -createZone /eczone</ec-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rmdir /eczone</command>
</cleanup-commands>
<comparators>
<comparator>
<type>SubstringComparator</type>
<expected-output>Directory /eczone is already in an erasure coding zone</expected-output>
</comparator>
</comparators>
</test>

<test>
<description>createZone : default schema</description>
<test-commands>
Expand All @@ -140,6 +158,23 @@
</comparators>
</test>

<test>
<description>getZoneInfo : get information about the EC zone at specified path not in zone</description>
<test-commands>
<command>-fs NAMENODE -mkdir /noec</command>
<ec-admin-command>-fs NAMENODE -getZoneInfo /noec</ec-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rmdir /noec</command>
</cleanup-commands>
<comparators>
<comparator>
<type>SubstringComparator</type>
<expected-output>Path NAMENODE/noec is not in EC zone</expected-output>
</comparator>
</comparators>
</test>

<test>
<description>getZoneInfo : get information about the EC zone at specified path</description>
<test-commands>
Expand Down

0 comments on commit bba15e0

Please sign in to comment.