HDFS-2390. dfsadmin -setBalancerBandwidth does not validate -ve value. Contributed by Gautam Gopalakrishnan.
This commit is contained in:
parent
fdb56f74f3
commit
0bf285413f
@ -359,6 +359,9 @@ Release 2.8.0 - UNRELEASED
|
||||
|
||||
IMPROVEMENTS
|
||||
|
||||
HDFS-2390. dfsadmin -setBalancerBandwidth does not validate -ve value
|
||||
(Gautam Gopalakrishnan via harsh)
|
||||
|
||||
HDFS-8821. Explain message "Operation category X is not supported
|
||||
in state standby" (Gautam Gopalakrishnan via harsh)
|
||||
|
||||
|
@ -851,6 +851,11 @@ public int setBalancerBandwidth(String[] argv, int idx) throws IOException {
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
if (bandwidth < 0) {
|
||||
System.err.println("Bandwidth should be a non-negative integer");
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
FileSystem fs = getFS();
|
||||
if (!(fs instanceof DistributedFileSystem)) {
|
||||
System.err.println("FileSystem is " + fs.getUri());
|
||||
|
@ -192,6 +192,13 @@ public void testSetBalancerBandwidth() throws Exception {
|
||||
assertOutputMatches(message + newLine + message + newLine);
|
||||
}
|
||||
|
||||
@Test (timeout = 30000)
|
||||
public void testSetNegativeBalancerBandwidth() throws Exception {
|
||||
setUpHaCluster(false);
|
||||
int exitCode = admin.run(new String[] {"-setBalancerBandwidth", "-10"});
|
||||
assertEquals("Negative bandwidth value must fail the command", -1, exitCode);
|
||||
}
|
||||
|
||||
@Test (timeout = 30000)
|
||||
public void testMetaSave() throws Exception {
|
||||
setUpHaCluster(false);
|
||||
|
Loading…
Reference in New Issue
Block a user