DomGarguilo commented on code in PR #5540: URL: https://github.com/apache/accumulo/pull/5540#discussion_r2101002011
########## core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java: ########## @@ -1862,37 +1852,31 @@ private void doTableFateOperation(String tableOrNamespaceName, } } - private void clearSamplerOptions(String tableName) - throws AccumuloException, TableNotFoundException, AccumuloSecurityException { - EXISTING_TABLE_NAME.validate(tableName); - - String prefix = Property.TABLE_SAMPLER_OPTS.getKey(); - for (Entry<String,String> entry : getProperties(tableName)) { - String property = entry.getKey(); - if (property.startsWith(prefix)) { - removeProperty(tableName, property); - } - } - } - @Override public void setSamplerConfiguration(String tableName, SamplerConfiguration samplerConfiguration) throws AccumuloException, TableNotFoundException, AccumuloSecurityException { EXISTING_TABLE_NAME.validate(tableName); - clearSamplerOptions(tableName); Map<String,String> props = new SamplerConfigurationImpl(samplerConfiguration).toTablePropertiesMap(); - modifyProperties(tableName, properties -> properties.putAll(props)); + + modifyProperties(tableName, properties -> { + properties.keySet() + .removeIf(property -> property.startsWith(Property.TABLE_SAMPLER_OPTS.getKey())); + properties.putAll(props); + }); } @Override public void clearSamplerConfiguration(String tableName) - throws AccumuloException, TableNotFoundException, AccumuloSecurityException { + throws AccumuloException, AccumuloSecurityException { Review Comment: Nothing in this method throws `TableNotFoundException` anymore I guess. In the old code, `clearSamplerOptions()` threw it when it called `getProperties()` but all of that has been replaced with the `modifyProperties()` block which does not throw `TableNotFoundException`. -- 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