accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlmar...@apache.org
Subject [accumulo] branch main updated: Modify default compaction planner opts to include internal type (#2140)
Date Mon, 07 Jun 2021 12:22:38 GMT
This is an automated email from the ASF dual-hosted git repository.

dlmarion pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
     new 7cc8607  Modify default compaction planner opts to include internal type (#2140)
7cc8607 is described below

commit 7cc8607a7ba36d8637034fbaa45a340d6f42ba1f
Author: Dave Marion <dlmarion@apache.org>
AuthorDate: Mon Jun 7 08:22:28 2021 -0400

    Modify default compaction planner opts to include internal type (#2140)
    
    Modify default compaction planner opts to include internal type. This was
    causing CompactionIT to fail as seen in #2137
    
    
    Co-authored-by: Christopher Tubbs <ctubbsii@apache.org>
---
 .../accumulo/core/spi/compaction/DefaultCompactionPlanner.java     | 7 +++++--
 .../org/apache/accumulo/tserver/compactions/CompactionManager.java | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/spi/compaction/DefaultCompactionPlanner.java
b/core/src/main/java/org/apache/accumulo/core/spi/compaction/DefaultCompactionPlanner.java
index 2e1ae90..2cd1b96 100644
--- a/core/src/main/java/org/apache/accumulo/core/spi/compaction/DefaultCompactionPlanner.java
+++ b/core/src/main/java/org/apache/accumulo/core/spi/compaction/DefaultCompactionPlanner.java
@@ -161,8 +161,11 @@ public class DefaultCompactionPlanner implements CompactionPlanner {
 
       CompactionExecutorId ceid;
 
-      Objects.requireNonNull(executorConfig.type,
-          "'type' is a required and must be 'internal' or 'external'");
+      // If not supplied, GSON will leave type null. Default to internal
+      if (executorConfig.type == null) {
+        executorConfig.type = "internal";
+      }
+
       switch (executorConfig.type) {
         case "internal":
           Preconditions.checkArgument(null == executorConfig.queue,
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/CompactionManager.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/CompactionManager.java
index a15684e..ae567b8 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/CompactionManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/CompactionManager.java
@@ -148,7 +148,7 @@ public class CompactionManager {
           Map<String,String> defaultServiceConfigs =
               Map.of(defaultServicePrefix + "planner", DefaultCompactionPlanner.class.getName(),
                   defaultServicePrefix + "planner.opts.executors",
-                  "[{'name':'deprecated','numThreads':" + numThreads + "}]");
+                  "[{'name':'deprecated', 'numThreads':" + numThreads + "}]");
 
           configsCopy.putAll(defaultServiceConfigs);
 

Mime
View raw message