keith-turner commented on code in PR #5994:
URL: https://github.com/apache/accumulo/pull/5994#discussion_r2578545269
##########
core/src/main/java/org/apache/accumulo/core/client/admin/compaction/ErasureCodeConfigurer.java:
##########
@@ -85,9 +85,12 @@ public Overrides override(InputParameters params) {
long inputsSum =
params.getInputFiles().stream().mapToLong(CompactableFile::getEstimatedSize).sum();
if (inputsSum >= this.ecSize) {
- overs.put(Property.TABLE_ENABLE_ERASURE_CODES.getKey(), "enable");
- if (ecPolicyName != null) {
- overs.put(Property.TABLE_ERASURE_CODE_POLICY.getKey(), ecPolicyName);
+ if (!params.getEnvironment().getConfiguration(params.getTableId())
+
.get(Property.TABLE_ENABLE_ERASURE_CODES.getKey()).equals("inherit")) {
+ overs.put(Property.TABLE_ENABLE_ERASURE_CODES.getKey(), "enable");
+ if (ecPolicyName != null) {
+ overs.put(Property.TABLE_ERASURE_CODE_POLICY.getKey(),
ecPolicyName);
+ }
Review Comment:
If a policy was set for the plugin, then probably want to always use that.
For the case where where no policy was for the plugin, could look and see if a
policy was set for the table and then set `inherit` vs `enable` based on that.
```suggestion
var tableConfig =
params.getEnvironment().getConfiguration(params.getTableId());
if(ecPolicyName != null){
overs.put(Property.TABLE_ENABLE_ERASURE_CODES.getKey(), "enable");
overs.put(Property.TABLE_ERASURE_CODE_POLICY.getKey(),
ecPolicyName);
} else
if(tableConfig.get(Property.TABLE_ERASURE_CODE_POLICY.getKey()) == null) { //
TODO maybe check for blank string in addition to null?
// Assume EC is configured at the DFS directory level, because no
policy was set in plugin or table config
overs.put(Property.TABLE_ENABLE_ERASURE_CODES.getKey(), "inherit");
} else {
// enable and use the policy set on the table
overs.put(Property.TABLE_ENABLE_ERASURE_CODES.getKey(), "enable");
```
--
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]