kevinrr888 commented on code in PR #6040:
URL: https://github.com/apache/accumulo/pull/6040#discussion_r2674074182
##########
core/src/main/java/org/apache/accumulo/core/client/admin/NewTableConfiguration.java:
##########
@@ -73,8 +72,25 @@ public class NewTableConfiguration {
private Map<String,String> summarizerProps = Collections.emptyMap();
private Map<String,String> localityProps = Collections.emptyMap();
private final Map<String,String> iteratorProps = new HashMap<>();
+ private final Map<String,String> inheritedIteratorProps = new HashMap<>();
private SortedSet<Text> splitProps = Collections.emptySortedSet();
+ /**
+ * Configures the {@link NewTableConfiguration} with iterators inherited
from the parent
+ * namespace. This is used internally in table creation - no need to call
directly.
+ *
+ * @param props the parent namespace config
+ */
+ public void configureInheritedIteratorProps(Map<String,String> props) {
Review Comment:
Yes, working on doing the validation server side (which removes the need for
this method). I started working on this change because getting the namespace
properties within TableOperations.create() results in requiring the user to
have the ALTER_NAMESPACE permission, which we don't want for a create() table
call
##########
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);
}
Review Comment:
I figured there would be an issue with this change. Ill change to
IllegalArgumentException
--
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]