This is an automated email from the ASF dual-hosted git repository. ctubbsii pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo.git
commit ab8e2f518887a2505cad9dbc02e82197babfc1bd Author: Christopher Tubbs <ctubb...@apache.org> AuthorDate: Thu Jan 26 12:02:17 2023 -0500 Remove some unused code to get rid of warnings --- .../core/spi/compaction/DefaultCompactionPlanner.java | 4 ---- .../core/util/compaction/CompactionServicesConfig.java | 6 +----- .../accumulo/server/conf/CheckCompactionConfig.java | 2 +- .../accumulo/tserver/compactions/CompactionManager.java | 15 ++------------- .../apache/accumulo/tserver/tablet/CompactableUtils.java | 9 --------- 5 files changed, 4 insertions(+), 32 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 781ae4e4ed..5465b85c74 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 @@ -32,8 +32,6 @@ import java.util.Set; import org.apache.accumulo.core.client.admin.compaction.CompactableFile; import org.apache.accumulo.core.conf.ConfigurationTypeHelper; import org.apache.accumulo.core.util.compaction.CompactionJobPrioritizer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import com.google.common.base.Preconditions; import com.google.gson.Gson; @@ -112,8 +110,6 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; public class DefaultCompactionPlanner implements CompactionPlanner { - private static final Logger log = LoggerFactory.getLogger(DefaultCompactionPlanner.class); - public static class ExecutorConfig { String type; String name; diff --git a/core/src/main/java/org/apache/accumulo/core/util/compaction/CompactionServicesConfig.java b/core/src/main/java/org/apache/accumulo/core/util/compaction/CompactionServicesConfig.java index 011e1b02f7..c6e1cea55d 100644 --- a/core/src/main/java/org/apache/accumulo/core/util/compaction/CompactionServicesConfig.java +++ b/core/src/main/java/org/apache/accumulo/core/util/compaction/CompactionServicesConfig.java @@ -21,7 +21,6 @@ package org.apache.accumulo.core.util.compaction; import java.util.HashMap; import java.util.Map; import java.util.Objects; -import java.util.function.Consumer; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.ConfigurationTypeHelper; @@ -42,7 +41,6 @@ public class CompactionServicesConfig { private final Map<String,Long> rateLimits = new HashMap<>(); private final Map<String,Map<String,String>> options = new HashMap<>(); long defaultRateLimit; - private final Consumer<String> deprecationWarningConsumer; public static final CompactionServiceId DEFAULT_SERVICE = CompactionServiceId.of("default"); @@ -55,9 +53,7 @@ public class CompactionServicesConfig { return aconf.getAllPropertiesWithPrefix(Property.TSERV_COMPACTION_SERVICE_PREFIX); } - public CompactionServicesConfig(AccumuloConfiguration aconf, - Consumer<String> deprecationWarningConsumer) { - this.deprecationWarningConsumer = deprecationWarningConsumer; + public CompactionServicesConfig(AccumuloConfiguration aconf) { Map<String,String> configs = getConfiguration(aconf); configs.forEach((prop, val) -> { diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/CheckCompactionConfig.java b/server/base/src/main/java/org/apache/accumulo/server/conf/CheckCompactionConfig.java index 314565384f..e297168e51 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/conf/CheckCompactionConfig.java +++ b/server/base/src/main/java/org/apache/accumulo/server/conf/CheckCompactionConfig.java @@ -92,7 +92,7 @@ public class CheckCompactionConfig implements KeywordExecutable { } AccumuloConfiguration config = SiteConfiguration.fromFile(path.toFile()).build(); - var servicesConfig = new CompactionServicesConfig(config, log::warn); + var servicesConfig = new CompactionServicesConfig(config); ServiceEnvironment senv = createServiceEnvironment(config); Set<String> defaultServices = Set.of(DEFAULT, META, ROOT); 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 654af77da0..f39df6789f 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 @@ -75,8 +75,6 @@ public class CompactionManager { private CompactionExecutorsMetrics ceMetrics; - private String lastDeprecationWarning = ""; - private Map<CompactionExecutorId,ExternalCompactionExecutor> externalExecutors; private Map<ExternalCompactionId,ExtCompInfo> runningExternalCompactions; @@ -91,13 +89,6 @@ public class CompactionManager { } } - private void warnAboutDeprecation(String warning) { - if (!warning.equals(lastDeprecationWarning)) { - log.warn(warning); - lastDeprecationWarning = warning; - } - } - private void mainLoop() { long lastCheckAllTime = System.nanoTime(); @@ -184,8 +175,7 @@ public class CompactionManager { CompactionExecutorsMetrics ceMetrics) { this.compactables = compactables; - this.currentCfg = - new CompactionServicesConfig(context.getConfiguration(), this::warnAboutDeprecation); + this.currentCfg = new CompactionServicesConfig(context.getConfiguration()); this.context = context; @@ -232,8 +222,7 @@ public class CompactionManager { lastConfigCheckTime = System.nanoTime(); - var tmpCfg = - new CompactionServicesConfig(context.getConfiguration(), this::warnAboutDeprecation); + var tmpCfg = new CompactionServicesConfig(context.getConfiguration()); if (!currentCfg.equals(tmpCfg)) { Map<CompactionServiceId,CompactionService> tmpServices = new HashMap<>(); 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 8e414b4a5e..195625c32d 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 @@ -83,20 +83,11 @@ import org.apache.accumulo.tserver.tablet.CompactableImpl.CompactionHelper; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; import com.google.common.collect.Collections2; public class CompactableUtils { - private static final Logger log = LoggerFactory.getLogger(CompactableUtils.class); - - private final static Cache<TableId,Boolean> strategyWarningsCache = - CacheBuilder.newBuilder().maximumSize(1000).build(); - public static Map<StoredTabletFile,Pair<Key,Key>> getFirstAndLastKeys(Tablet tablet, Set<StoredTabletFile> allFiles) throws IOException { final Map<StoredTabletFile,Pair<Key,Key>> result = new HashMap<>();