ctubbsii commented on code in PR #5540:
URL: https://github.com/apache/accumulo/pull/5540#discussion_r2103799698
##########
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:
I would expect modifyProperties to throw TableNotFoundException. At least,
some error should happen if the table doesn't exist... I'm not sure what error
that is. But, I think this PR should wait until we figure that out, because
this changes the behavior, and we shouldn't change the API behavior for the
case when the table doesn't exist.
--
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]