This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/2.1 by this push:
     new 914f73630d sets default for compaction strategy to empty string (#3976)
914f73630d is described below

commit 914f73630dd40b86636f7539a5b91797eca3415e
Author: Keith Turner <ktur...@apache.org>
AuthorDate: Mon Nov 27 17:31:49 2023 -0500

    sets default for compaction strategy to empty string (#3976)
---
 core/src/main/java/org/apache/accumulo/core/conf/Property.java      | 3 +--
 .../java/org/apache/accumulo/tserver/tablet/CompactableImpl.java    | 4 +++-
 .../java/org/apache/accumulo/tserver/tablet/CompactableUtils.java   | 6 +++---
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/conf/Property.java 
b/core/src/main/java/org/apache/accumulo/core/conf/Property.java
index b03418e36a..c65545dc77 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java
@@ -1071,8 +1071,7 @@ public enum Property {
       "Options for the table compaction configuror.", "2.1.0"),
   @Deprecated(since = "2.1.0", forRemoval = true)
   @ReplacedBy(property = TABLE_COMPACTION_SELECTOR)
-  TABLE_COMPACTION_STRATEGY("table.majc.compaction.strategy",
-      "org.apache.accumulo.tserver.compaction.DefaultCompactionStrategy", 
PropertyType.CLASSNAME,
+  TABLE_COMPACTION_STRATEGY("table.majc.compaction.strategy", "", 
PropertyType.CLASSNAME,
       "See {% jlink -f org.apache.accumulo.core.spi.compaction %}.", "1.6.0"),
   @Deprecated(since = "2.1.0", forRemoval = true)
   @ReplacedBy(property = TABLE_COMPACTION_SELECTOR_OPTS)
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
index 11722c100f..cb055d080c 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
@@ -1099,7 +1099,9 @@ public class CompactableImpl implements Compactable {
 
   @SuppressWarnings("removal")
   private boolean isCompactionStratConfigured() {
-    return 
tablet.getTableConfiguration().isPropertySet(Property.TABLE_COMPACTION_STRATEGY);
+    var strategyClass = 
tablet.getTableConfiguration().get(Property.TABLE_COMPACTION_STRATEGY);
+    return 
tablet.getTableConfiguration().isPropertySet(Property.TABLE_COMPACTION_STRATEGY)
+        && strategyClass != null && !strategyClass.isBlank();
   }
 
   @Override
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableUtils.java
 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableUtils.java
index 84b862f990..e2aab70256 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableUtils.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableUtils.java
@@ -490,9 +490,9 @@ public class CompactableUtils {
 
       CompactionStrategyConfig stratCfg = null;
 
-      if (cselCfg == null && 
tconf.isPropertySet(Property.TABLE_COMPACTION_STRATEGY)) {
-        var stratClassName = tconf.get(Property.TABLE_COMPACTION_STRATEGY);
-
+      var stratClassName = tconf.get(Property.TABLE_COMPACTION_STRATEGY);
+      if (cselCfg == null && 
tconf.isPropertySet(Property.TABLE_COMPACTION_STRATEGY)
+          && stratClassName != null && !stratClassName.isBlank()) {
         try {
           strategyWarningsCache.get(tablet.getExtent().tableId(), () -> {
             log.warn(

Reply via email to