You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/10/14 18:59:24 UTC

[GitHub] [accumulo] DomGarguilo opened a new pull request, #3025: Use NamespaceOperations.modifyProperties() in more places

DomGarguilo opened a new pull request, #3025:
URL: https://github.com/apache/accumulo/pull/3025

   Similar to #2965 
   
   This PR aims to use `NamespaceOperations.modifyProperties()` in places where it seems to be a better fit. Mostly looked for places where multiple properties where being set with concurrent calls to `setProperty()`, often in a loop.


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo] cshannon merged pull request #3025: Use NamespaceOperations.modifyProperties() in more places

Posted by GitBox <gi...@apache.org>.
cshannon merged PR #3025:
URL: https://github.com/apache/accumulo/pull/3025


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo] cshannon commented on a diff in pull request #3025: Use NamespaceOperations.modifyProperties() in more places

Posted by GitBox <gi...@apache.org>.
cshannon commented on code in PR #3025:
URL: https://github.com/apache/accumulo/pull/3025#discussion_r996303180


##########
shell/src/main/java/org/apache/accumulo/shell/commands/CreateNamespaceCommand.java:
##########
@@ -62,12 +63,11 @@ public int execute(final String fullCommand, final CommandLine cl, final Shell s
       }
     }
     if (configuration != null) {
-      for (Entry<String,String> entry : configuration.entrySet()) {
-        if (Property.isValidTablePropertyKey(entry.getKey())) {
-          shellState.getAccumuloClient().namespaceOperations().setProperty(namespace,
-              entry.getKey(), entry.getValue());
-        }
-      }
+      var propsToAdd = configuration.entrySet().stream()
+          .filter(entry -> Property.isValidTablePropertyKey(entry.getKey()))
+          .collect(Collectors.toMap(Entry::getKey, Entry::getValue));
+      shellState.getAccumuloClient().namespaceOperations().modifyProperties(namespace,
+          properties -> properties.putAll(propsToAdd));

Review Comment:
   ```suggestion
         final Map<String,String> config = configuration;
         shellState.getAccumuloClient().namespaceOperations().modifyProperties(namespace,
             properties -> config.entrySet().stream()
                 .filter(entry -> Property.isValidTablePropertyKey(entry.getKey()))
                 .forEach(entry -> properties.put(entry.getKey(), entry.getValue())));
   ```
   Basically the same suggestion as in #2965



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org