HDFS-766. Error message not clear for set space quota out of boundary values. Contributed by Jon Zuanich.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1349640 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Aaron Myers 2012-06-13 05:34:19 +00:00
parent 788592aa3b
commit cbd17834c0
3 changed files with 10 additions and 2 deletions

View File

@ -210,6 +210,9 @@ Release 2.0.1-alpha - UNRELEASED
HDFS-3531. EditLogFileOutputStream#preallocate should check for HDFS-3531. EditLogFileOutputStream#preallocate should check for
incomplete writes. (Colin Patrick McCabe via eli) incomplete writes. (Colin Patrick McCabe via eli)
HDFS-766. Error message not clear for set space quota out of boundary
values. (Jon Zuanich via atm)
BREAKDOWN OF HDFS-3042 SUBTASKS BREAKDOWN OF HDFS-3042 SUBTASKS
HDFS-2185. HDFS portion of ZK-based FailoverController (todd) HDFS-2185. HDFS portion of ZK-based FailoverController (todd)

View File

@ -239,7 +239,12 @@ public class DFSAdmin extends FsShell {
CommandFormat c = new CommandFormat(2, Integer.MAX_VALUE); CommandFormat c = new CommandFormat(2, Integer.MAX_VALUE);
List<String> parameters = c.parse(args, pos); List<String> parameters = c.parse(args, pos);
String str = parameters.remove(0).trim(); String str = parameters.remove(0).trim();
quota = StringUtils.TraditionalBinaryPrefix.string2long(str); try {
quota = StringUtils.TraditionalBinaryPrefix.string2long(str);
} catch (NumberFormatException nfe) {
throw new IllegalArgumentException("\"" + str + "\" is not a valid value for a quota.");
}
this.args = parameters.toArray(new String[parameters.size()]); this.args = parameters.toArray(new String[parameters.size()]);
} }

View File

@ -15470,7 +15470,7 @@
<comparators> <comparators>
<comparator> <comparator>
<type>SubstringComparator</type> <type>SubstringComparator</type>
<expected-output>For input string: "a5"</expected-output> <expected-output>setSpaceQuota: "a5" is not a valid value for a quota.</expected-output>
</comparator> </comparator>
</comparators> </comparators>
</test> </test>