kevinrr888 commented on code in PR #6040:
URL: https://github.com/apache/accumulo/pull/6040#discussion_r2700128743


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/NamespaceOperationsHelper.java:
##########
@@ -146,45 +147,8 @@ public void checkIteratorConflicts(String namespace, 
IteratorSetting setting,
     if (!exists(namespace)) {
       throw new NamespaceNotFoundException(null, namespace, null);
     }
-    for (IteratorScope scope : scopes) {
-      String scopeStr =
-          String.format("%s%s", Property.TABLE_ITERATOR_PREFIX, 
scope.name().toLowerCase());
-      String nameStr = String.format("%s.%s", scopeStr, setting.getName());
-      String optStr = String.format("%s.opt.", nameStr);
-      Map<String,String> optionConflicts = new TreeMap<>();
-      for (Entry<String,String> property : this.getProperties(namespace)) {
-        if (property.getKey().startsWith(scopeStr)) {
-          if (property.getKey().equals(nameStr)) {
-            throw new AccumuloException(new IllegalArgumentException("iterator 
name conflict for "
-                + setting.getName() + ": " + property.getKey() + "=" + 
property.getValue()));
-          }
-          if (property.getKey().startsWith(optStr)) {
-            optionConflicts.put(property.getKey(), property.getValue());
-          }
-          if (property.getKey().contains(".opt.")) {
-            continue;
-          }
-          String[] parts = property.getValue().split(",");
-          if (parts.length != 2) {
-            throw new AccumuloException("Bad value for existing iterator 
setting: "
-                + property.getKey() + "=" + property.getValue());
-          }
-          try {
-            if (Integer.parseInt(parts[0]) == setting.getPriority()) {
-              throw new AccumuloException(new IllegalArgumentException(
-                  "iterator priority conflict: " + property.getKey() + "=" + 
property.getValue()));
-            }
-          } catch (NumberFormatException e) {
-            throw new AccumuloException("Bad value for existing iterator 
setting: "
-                + property.getKey() + "=" + property.getValue());
-          }

Review Comment:
   Yeah this does change the exceptions the client might receive from this. 
They will always receive an AccumuloException before and after these changes, 
but they no longer receive AccumuloExceptions for two things: 
AccumuloExceptions if `parts.length != 2` or the priority isn't a number. With 
my changes, I check properties against a regex (see new static vars in 
IteratorConfigUtil), ignoring those that don't match. So if `parts.length != 2` 
or the priority isn't a number, it is quietly ignored as not being an 
iterator-related property.
   
   I can add back AccumuloExceptions for these two cases if you think that is 
best.



-- 
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]

Reply via email to