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


The following commit(s) were added to refs/heads/main by this push:
     new 6286a2542d Rename GENERAL_SIMPLETIMER_THREADPOOL_SIZE (#2712)
6286a2542d is described below

commit 6286a2542d30dc04647f402b1e32963358b80ff3
Author: kitswas <90329875+kits...@users.noreply.github.com>
AuthorDate: Wed May 25 07:48:48 2022 +0530

    Rename GENERAL_SIMPLETIMER_THREADPOOL_SIZE (#2712)
    
    * Added property with new name, `GENERAL_THREADPOOL_SIZE`
    * Marked old property as Deprecated
    * Reconcile which property is used, depending on which the
      user has set in the configuration
    * Updated usages
    
    Co-authored-by: Christopher Tubbs <ctubb...@apache.org>
---
 core/src/main/java/org/apache/accumulo/core/conf/Property.java |  4 ++++
 .../org/apache/accumulo/core/util/threads/ThreadPools.java     |  9 +++++++--
 .../accumulo/test/compaction/ExternalCompactionTestUtils.java  |  2 +-
 .../java/org/apache/accumulo/test/fate/zookeeper/FateIT.java   | 10 +++++-----
 4 files changed, 17 insertions(+), 8 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 e8631762b2..3c31a2fc60 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
@@ -244,6 +244,10 @@ public enum Property {
   GENERAL_OPENTELEMETRY_ENABLED("general.opentelemetry.enabled", "false", 
PropertyType.BOOLEAN,
       "Enables tracing functionality using OpenTelemetry (assuming 
OpenTelemetry is configured).",
       "2.1.0"),
+  GENERAL_THREADPOOL_SIZE("general.server.threadpool.size", "1", 
PropertyType.COUNT,
+      "The number of threads to use for server-internal scheduled tasks", 
"2.1.0"),
+  @Deprecated(since = "2.1.0")
+  @ReplacedBy(property = GENERAL_THREADPOOL_SIZE)
   
GENERAL_SIMPLETIMER_THREADPOOL_SIZE("general.server.simpletimer.threadpool.size",
 "1",
       PropertyType.COUNT, "The number of threads to use for server-internal 
scheduled tasks",
       "1.7.0"),
diff --git 
a/core/src/main/java/org/apache/accumulo/core/util/threads/ThreadPools.java 
b/core/src/main/java/org/apache/accumulo/core/util/threads/ThreadPools.java
index 548852a409..c81d421573 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/threads/ThreadPools.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/threads/ThreadPools.java
@@ -266,6 +266,9 @@ public class ThreadPools {
       case GENERAL_SIMPLETIMER_THREADPOOL_SIZE:
         return createScheduledExecutorService(conf.getCount(p), "SimpleTimer",
             emitThreadPoolMetrics);
+      case GENERAL_THREADPOOL_SIZE:
+        return createScheduledExecutorService(conf.getCount(p), 
"GeneralExecutor",
+            emitThreadPoolMetrics);
       case MANAGER_BULK_THREADPOOL_SIZE:
         return createFixedThreadPool(conf.getCount(p),
             conf.getTimeInMillis(Property.MANAGER_BULK_THREADPOOL_TIMEOUT), 
MILLISECONDS,
@@ -514,8 +517,10 @@ public class ThreadPools {
    */
   public ScheduledThreadPoolExecutor
       createGeneralScheduledExecutorService(AccumuloConfiguration conf) {
-    return (ScheduledThreadPoolExecutor) createExecutorService(conf,
-        Property.GENERAL_SIMPLETIMER_THREADPOOL_SIZE, true);
+    @SuppressWarnings("deprecation")
+    Property oldProp = Property.GENERAL_SIMPLETIMER_THREADPOOL_SIZE;
+    Property prop = conf.resolve(Property.GENERAL_THREADPOOL_SIZE, oldProp);
+    return (ScheduledThreadPoolExecutor) createExecutorService(conf, prop, 
true);
   }
 
   /**
diff --git 
a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompactionTestUtils.java
 
b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompactionTestUtils.java
index 6c10ab2d9a..8e53ca8012 100644
--- 
a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompactionTestUtils.java
+++ 
b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompactionTestUtils.java
@@ -233,7 +233,7 @@ public class ExternalCompactionTestUtils {
     
cfg.setProperty(Property.COMPACTION_COORDINATOR_TSERVER_COMPACTION_CHECK_INTERVAL,
 "3s");
     cfg.setProperty(Property.COMPACTION_COORDINATOR_THRIFTCLIENT_PORTSEARCH, 
"true");
     cfg.setProperty(Property.COMPACTOR_PORTSEARCH, "true");
-    cfg.setProperty(Property.GENERAL_SIMPLETIMER_THREADPOOL_SIZE, "10");
+    cfg.setProperty(Property.GENERAL_THREADPOOL_SIZE, "10");
     cfg.setProperty(Property.MANAGER_FATE_THREADPOOL_SIZE, "10");
     // use raw local file system so walogs sync and flush will work
     coreSite.set("fs.file.impl", RawLocalFileSystem.class.getName());
diff --git 
a/test/src/main/java/org/apache/accumulo/test/fate/zookeeper/FateIT.java 
b/test/src/main/java/org/apache/accumulo/test/fate/zookeeper/FateIT.java
index e1f6453850..6210f86589 100644
--- a/test/src/main/java/org/apache/accumulo/test/fate/zookeeper/FateIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/fate/zookeeper/FateIT.java
@@ -160,7 +160,7 @@ public class FateIT {
     Fate<Manager> fate = new Fate<Manager>(manager, store, 
TraceRepo::toLogString);
     try {
       ConfigurationCopy config = new ConfigurationCopy();
-      config.set(Property.GENERAL_SIMPLETIMER_THREADPOOL_SIZE, "2");
+      config.set(Property.GENERAL_THREADPOOL_SIZE, "2");
       config.set(Property.MANAGER_FATE_THREADPOOL_SIZE, "1");
       fate.startTransactionRunners(config);
 
@@ -221,7 +221,7 @@ public class FateIT {
     Fate<Manager> fate = new Fate<Manager>(manager, store, 
TraceRepo::toLogString);
     try {
       ConfigurationCopy config = new ConfigurationCopy();
-      config.set(Property.GENERAL_SIMPLETIMER_THREADPOOL_SIZE, "2");
+      config.set(Property.GENERAL_THREADPOOL_SIZE, "2");
       config.set(Property.MANAGER_FATE_THREADPOOL_SIZE, "1");
       fate.startTransactionRunners(config);
 
@@ -260,7 +260,7 @@ public class FateIT {
 
     Fate<Manager> fate = new Fate<Manager>(manager, store, 
TraceRepo::toLogString);
     ConfigurationCopy config = new ConfigurationCopy();
-    config.set(Property.GENERAL_SIMPLETIMER_THREADPOOL_SIZE, "2");
+    config.set(Property.GENERAL_THREADPOOL_SIZE, "2");
 
     // Notice that we did not start the transaction runners
 
@@ -294,7 +294,7 @@ public class FateIT {
     Fate<Manager> fate = new Fate<Manager>(manager, store, 
TraceRepo::toLogString);
     try {
       ConfigurationCopy config = new ConfigurationCopy();
-      config.set(Property.GENERAL_SIMPLETIMER_THREADPOOL_SIZE, "2");
+      config.set(Property.GENERAL_THREADPOOL_SIZE, "2");
       config.set(Property.MANAGER_FATE_THREADPOOL_SIZE, "1");
       fate.startTransactionRunners(config);
 
@@ -336,7 +336,7 @@ public class FateIT {
     Fate<Manager> fate = new Fate<Manager>(manager, store, 
TraceRepo::toLogString);
     try {
       ConfigurationCopy config = new ConfigurationCopy();
-      config.set(Property.GENERAL_SIMPLETIMER_THREADPOOL_SIZE, "2");
+      config.set(Property.GENERAL_THREADPOOL_SIZE, "2");
       config.set(Property.MANAGER_FATE_THREADPOOL_SIZE, "1");
       fate.startTransactionRunners(config);
 

Reply via email to