ayushtkn commented on code in PR #5554:
URL: https://github.com/apache/hadoop/pull/5554#discussion_r1187900806


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java:
##########
@@ -462,6 +484,142 @@ public int run(String[] argv) throws Exception {
     return exitCode;
   }
 
+  /**
+   * Add all mount point entries provided in the request.
+   *
+   * @param parameters Parameters for the mount points.
+   * @param i Current index on the parameters array.
+   * @return True if adding all mount points was successful, False otherwise.
+   * @throws IOException If the RPC call to add the mount points fail.
+   */
+  private boolean addAllMount(String[] parameters, int i) throws IOException {
+    List<AddMountAttributes> addMountAttributesList = new ArrayList<>();
+    Set<String> mounts = new HashSet<>();
+    while (i < parameters.length) {
+      AddMountAttributes addMountAttributes = 
getAddMountAttributes(parameters, i, true);
+      if (addMountAttributes == null) {
+        return false;
+      }
+      if (mounts.contains(addMountAttributes.getMount())) {
+        System.err.println("Multiple inputs for mount: " + 
addMountAttributes.getMount());
+        return false;
+      }
+      mounts.add(addMountAttributes.getMount());

Review Comment:
   HashSet add method returns false, if the entry was already there, contains 
ain't required, unless I am missing something.
   
   btw. earlier this was a success case for you, the later entry used to take 
precedence. I tried it....



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to