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


##########
core/src/main/java/org/apache/accumulo/core/client/admin/NewTableConfiguration.java:
##########
@@ -199,29 +215,51 @@ public Map<String,String> getProperties() {
       // check the properties for conflicts with default iterators
       var defaultIterSettings = 
IteratorConfigUtil.getInitialTableIteratorSettings();
       // if a default prop already exists, don't want to consider that a 
conflict
-      var noDefaultsPropMap = new HashMap<>(propertyMap);
-      noDefaultsPropMap.entrySet().removeIf(entry -> 
initTableProps.get(entry.getKey()) != null
-          && initTableProps.get(entry.getKey()).equals(entry.getValue()));
-      defaultIterSettings.forEach((setting, scopes) -> {
+      for (var defaultIterSetting : defaultIterSettings.entrySet()) {
+        var setting = defaultIterSetting.getKey();
+        var scopes = defaultIterSetting.getValue();
         try {
-          TableOperationsHelper.checkIteratorConflicts(noDefaultsPropMap, 
setting, scopes);
+          TableOperationsHelper.checkIteratorConflicts(propertyMap, setting, 
scopes);
         } catch (AccumuloException e) {
-          throw new IllegalStateException(String.format(
+          throw new AccumuloException(String.format(
               "conflict with default table iterator: scopes: %s setting: %s", 
scopes, setting), e);
         }
-      });
+      }
 
       // check the properties for conflicts with default properties 
(non-iterator)
       var nonIterDefaults = IteratorConfigUtil.getInitialTableProperties();
       
nonIterDefaults.keySet().removeAll(IteratorConfigUtil.getInitialTableIterators().keySet());
-      nonIterDefaults.forEach((dk, dv) -> {
+      for (var nonIterDefault : nonIterDefaults.entrySet()) {
+        var dk = nonIterDefault.getKey();
+        var dv = nonIterDefault.getValue();
         var valInPropMap = propertyMap.get(dk);
-        Preconditions.checkState(valInPropMap == null || 
valInPropMap.equals(dv), String.format(
-            "conflict for property %s : %s (default val) != %s (set val)", dk, 
dv, valInPropMap));
-      });
+        if (valInPropMap != null && !valInPropMap.equals(dv)) {
+          throw new AccumuloException(String.format(
+              "conflict for property %s : %s (default val) != %s (set val)", 
dk, dv, valInPropMap));
+        }

Review Comment:
   Resolved https://github.com/apache/accumulo/pull/6040#discussion_r2669848820



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