Skip to content

Commit

Permalink
fixes CompactionIT.testDeleteCompactionService() (apache#4224)
Browse files Browse the repository at this point in the history
This test was failing because it used the old config for the default
compaction planner. Updated to use the new config.
  • Loading branch information
keith-turner authored Feb 3, 2024
1 parent baefeb7 commit 5f5cbd3
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@

public class CompactionIT extends AccumuloClusterHarness {

public static final String COMPACTOR_GROUP_1 = "cg1";
public static final String COMPACTOR_GROUP_2 = "cg2";

public static class TestFilter extends Filter {

int modulus = 1;
Expand Down Expand Up @@ -228,6 +231,9 @@ public void configureMiniCluster(MiniAccumuloConfigImpl cfg, Configuration hadoo
cfg.setProperty(Property.COMPACTOR_MAX_JOB_WAIT_TIME, "1s");
// use raw local file system so walogs sync and flush will work
hadoopCoreSite.set("fs.file.impl", RawLocalFileSystem.class.getName());

cfg.getClusterServerConfiguration().addCompactorResourceGroup(COMPACTOR_GROUP_1, 1);
cfg.getClusterServerConfiguration().addCompactorResourceGroup(COMPACTOR_GROUP_2, 1);
}

private long countTablets(String tableName, Predicate<TabletMetadata> tabletTest) {
Expand Down Expand Up @@ -828,16 +834,16 @@ public void testDeleteCompactionService() throws Exception {
Property.COMPACTION_SERVICE_PREFIX.getKey() + "deleteme.planner",
DefaultCompactionPlanner.class.getName());
c.instanceOperations().setProperty(
Property.COMPACTION_SERVICE_PREFIX.getKey() + "deleteme.planner.opts.executors",
"[{'name':'all','type':'internal','numThreads':1}]".replaceAll("'", "\""));
Property.COMPACTION_SERVICE_PREFIX.getKey() + "deleteme.planner.opts.groups",
("[{'name':'" + COMPACTOR_GROUP_1 + "'}]").replaceAll("'", "\""));

// create a compaction service named keepme
c.instanceOperations().setProperty(
Property.COMPACTION_SERVICE_PREFIX.getKey() + "keepme.planner",
DefaultCompactionPlanner.class.getName());
c.instanceOperations().setProperty(
Property.COMPACTION_SERVICE_PREFIX.getKey() + "keepme.planner.opts.executors",
"[{'name':'all','type':'internal','numThreads':1}]".replaceAll("'", "\""));
Property.COMPACTION_SERVICE_PREFIX.getKey() + "keepme.planner.opts.groups",
("[{'name':'" + COMPACTOR_GROUP_2 + "'}]").replaceAll("'", "\""));

// create a table that uses the compaction service deleteme
Map<String,String> props = new HashMap<>();
Expand Down Expand Up @@ -869,15 +875,15 @@ public void testDeleteCompactionService() throws Exception {
c.instanceOperations()
.removeProperty(Property.COMPACTION_SERVICE_PREFIX.getKey() + "deleteme.planner");
c.instanceOperations().removeProperty(
Property.COMPACTION_SERVICE_PREFIX.getKey() + "deleteme.planner.opts.executors");
Property.COMPACTION_SERVICE_PREFIX.getKey() + "deleteme.planner.opts.groups");

// add a new compaction service named newcs
c.instanceOperations().setProperty(
Property.COMPACTION_SERVICE_PREFIX.getKey() + "newcs.planner",
DefaultCompactionPlanner.class.getName());
c.instanceOperations().setProperty(
Property.COMPACTION_SERVICE_PREFIX.getKey() + "newcs.planner.opts.executors",
"[{'name':'all','type':'internal','numThreads':1}]".replaceAll("'", "\""));
Property.COMPACTION_SERVICE_PREFIX.getKey() + "newcs.planner.opts.groups",
("[{'name':'" + COMPACTOR_GROUP_2 + "'}]").replaceAll("'", "\""));

// set table 1 to a compaction service newcs
c.tableOperations().setProperty(table1,
Expand Down

0 comments on commit 5f5cbd3

Please sign in to comment.