You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ay...@apache.org on 2019/11/22 06:13:02 UTC
[hadoop] branch trunk updated: HDFS-13842. RBF: Exceptions are
conflicting when creating the same mount entry twice. Contributed by Ranith
Sardar.
This is an automated email from the ASF dual-hosted git repository.
ayushsaxena pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new c422e36 HDFS-13842. RBF: Exceptions are conflicting when creating the same mount entry twice. Contributed by Ranith Sardar.
c422e36 is described below
commit c422e36397920311bd2823deb0206a97cf288bf0
Author: Ayush Saxena <ay...@apache.org>
AuthorDate: Fri Nov 22 11:27:35 2019 +0530
HDFS-13842. RBF: Exceptions are conflicting when creating the same mount entry twice. Contributed by Ranith Sardar.
---
.../java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java | 1 +
.../hadoop/hdfs/server/federation/router/TestRouterAdminCLI.java | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java
index 80598fb..4f8dcde 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java
@@ -530,6 +530,7 @@ public class RouterAdmin extends Configured implements Tool {
for (String nsId : nss) {
if (!existingEntry.addDestination(nsId, dest)) {
System.err.println("Cannot add destination at " + nsId + " " + dest);
+ return false;
}
}
if (readonly) {
diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterAdminCLI.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterAdminCLI.java
index 3c0a61d..a868392 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterAdminCLI.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterAdminCLI.java
@@ -159,6 +159,8 @@ public class TestRouterAdminCLI {
String dest = "/addmounttable";
String[] argv = new String[] {"-add", src, nsId, dest};
assertEquals(0, ToolRunner.run(admin, argv));
+ assertEquals(-1, ToolRunner.run(admin, argv));
+
stateStore.loadCache(MountTableStoreImpl.class, true);
GetMountTableEntriesRequest getRequest = GetMountTableEntriesRequest
@@ -744,9 +746,7 @@ public class TestRouterAdminCLI {
// verify multi args ClrQuota
String dest1 = "/QuotaMounttable1";
- // Add mount table entries.
- argv = new String[] {"-add", src, nsId, dest};
- assertEquals(0, ToolRunner.run(admin, argv));
+ // Add one more mount table entry.
argv = new String[] {"-add", src1, nsId, dest1};
assertEquals(0, ToolRunner.run(admin, argv));
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org