DomGarguilo commented on code in PR #5540: URL: https://github.com/apache/accumulo/pull/5540#discussion_r2114655839
########## 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: So it turns out some of the TableOps methods wrap TableNotFoundException in AccumuloException. Created #5595 to add a bit of clarity for those methods. I am not sure why some methods do this. It seems like it would be better to just throw it directly (might avoid confusion like this scenario). Anyways, I dont think this is a blocker for this PR. -- 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