keith-turner commented on code in PR #2965:
URL: https://github.com/apache/accumulo/pull/2965#discussion_r980470298


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsHelper.java:
##########
@@ -56,10 +57,12 @@ public void attachIterator(String tableName, 
IteratorSetting setting,
     for (IteratorScope scope : scopes) {
       String root = String.format("%s%s.%s", Property.TABLE_ITERATOR_PREFIX,
           scope.name().toLowerCase(), setting.getName());
-      for (Entry<String,String> prop : setting.getOptions().entrySet()) {
-        this.setProperty(tableName, root + ".opt." + prop.getKey(), 
prop.getValue());
-      }
-      this.setProperty(tableName, root, setting.getPriority() + "," + 
setting.getIteratorClass());
+
+      Map<String,String> propsToAdd = setting.getOptions().entrySet().stream()
+          .collect(Collectors.toMap(prop -> root + ".opt." + prop.getKey(), 
Entry::getValue));
+      propsToAdd.put(root, setting.getPriority() + "," + 
setting.getIteratorClass());
+
+      this.modifyProperties(tableName, props -> props.putAll(propsToAdd));

Review Comment:
   If no one else is working on it or opposed to it, I would like to try 
creating a PR for the new modifyProperties method to make it retry 
automatically instead of throwing the  ConcurrentModificationException.  If 
that was done, then this PR could stay as is and not have to handle that 
condition.



-- 
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-unsubscr...@accumulo.apache.org

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

Reply via email to