Skip to content

Commit

Permalink
Revert "Fix bug in compaction props (apache#4092)"
Browse files Browse the repository at this point in the history
This reverts commit 67fd967.

Reverting in favor of apache#4117
  • Loading branch information
ctubbsii committed Dec 23, 2023
1 parent a12f517 commit d4a7a89
Show file tree
Hide file tree
Showing 4 changed files with 176 additions and 214 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
* configuration
*/
public class ConfigurationCopy extends AccumuloConfiguration {

AccumuloConfiguration parent = null;
private long updateCount = 0;
final Map<String,String> copy = Collections.synchronizedMap(new HashMap<>());

Expand All @@ -44,17 +42,6 @@ public ConfigurationCopy(Map<String,String> config) {
this(config.entrySet());
}

/**
* Creates a new configuration
*
* @param config - configuration property key/value pairs to copy
* @param parent - Higher level accumulo config to allow for property overrides
*/
public ConfigurationCopy(Map<String,String> config, AccumuloConfiguration parent) {
this(config.entrySet());
this.parent = parent;
}

/**
* Creates a new configuration.
*
Expand Down Expand Up @@ -82,20 +69,11 @@ public ConfigurationCopy() {

@Override
public String get(Property property) {
if (copy.containsKey(property.getKey())) {
return copy.get(property.getKey());
} else if (parent != null) {
return parent.get(property);
} else {
return null;
}
return copy.get(property.getKey());
}

@Override
public void getProperties(Map<String,String> props, Predicate<String> filter) {
if (parent != null) {
parent.getProperties(props, filter);
}
for (Entry<String,String> entry : copy.entrySet()) {
if (filter.test(entry.getKey())) {
props.put(entry.getKey(), entry.getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,7 @@ private void determineMaxFilesToCompact(InitParameters params) {
this.maxFilesToCompact = Integer.parseInt(params.getServiceEnvironment().getConfiguration()
.get(Property.TSERV_MAJC_THREAD_MAXOPEN.getKey()));
} else {
this.maxFilesToCompact = Integer.parseInt(params.getOptions().getOrDefault("maxOpen",
Property.TSERV_COMPACTION_SERVICE_DEFAULT_MAX_OPEN.getDefaultValue()));
this.maxFilesToCompact = Integer.parseInt(params.getOptions().getOrDefault("maxOpen", "10"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public Map<String,String> getOptions() {

@Override
public String getFullyQualifiedOption(String key) {
return Property.TSERV_COMPACTION_SERVICE_PREFIX.getKey() + serviceId + ".planner.opts." + key;
return Property.TSERV_COMPACTION_SERVICE_PREFIX.getKey() + serviceId + ".opts." + key;
}

@Override
Expand Down
Loading

0 comments on commit d4a7a89

Please sign in to comment.