[ 
https://issues.apache.org/jira/browse/HDFS-16978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17721034#comment-17721034
 ] 

ASF GitHub Bot commented on HDFS-16978:
---------------------------------------

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


##########
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:
   > btw. earlier this was a success case for you, the later entry used to take 
precedence. I tried it....
   
   i forgot to reply to this yesterday: yes this was success case and only 
later entry was taking precedence before this addendum, that is due to the 
nature of state store putAll implementation. 
   but good for us to prevent such inputs with the proper error message so that 
user can rectify it. that way, we won't have to rely on state store impl to 
resolve it with different behavior (i.e. guard against any behavior changes of 
putAll impl in all state stores).





> RBF: Admin command to support bulk add of mount points
> ------------------------------------------------------
>
>                 Key: HDFS-16978
>                 URL: https://issues.apache.org/jira/browse/HDFS-16978
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Viraj Jasani
>            Assignee: Viraj Jasani
>            Priority: Minor
>              Labels: pull-request-available
>
> All state store implementations support adding multiple state store records 
> using single putAll() implementation. We should provide new router admin API 
> to support bulk addition of mount table entries that can utilize this build 
> add implementation at state store level.
> For more than one mount point to be added, the goal of bulk addition should be
>  # To reduce frequent router calls
>  # To avoid frequent state store cache refreshers with each single mount 
> point addition



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to