You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -369,6 +369,9 @@ public int run(String[] argv) throws Exception {
369
369
try {
370
370
if (removeMount(argv[i])) {
371
371
System.out.println("Successfully removed mount point " + argv[i]);
372
+
} else {
373
+
exitCode = -1;
374
+
System.err.println("Failed to remove mount point " + argv[i]);
Copy file name to clipboardExpand all lines: hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterAdminCLI.java
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -433,10 +433,13 @@ public void testRemoveMountTable() throws Exception {
433
433
// remove an invalid mount table
434
434
StringinvalidPath = "/invalid";
435
435
System.setOut(newPrintStream(out));
436
+
System.setErr(newPrintStream(err));
436
437
argv = newString[] {"-rm", invalidPath};
437
-
assertEquals(0, ToolRunner.run(admin, argv));
438
+
assertEquals(-1, ToolRunner.run(admin, argv));
438
439
assertTrue(out.toString().contains(
439
440
"Cannot remove mount point " + invalidPath));
441
+
assertEquals("DFS Router Admin should report error for failure to remove mount point",
442
+
"Failed to remove mount point " + invalidPath + "\n", err.toString());
0 commit comments