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

keith-turner 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 bb2c5f52d2 Fixes server query (#6682)
bb2c5f52d2 is described below

commit bb2c5f52d26e180e96278e14007d2c9843766b19
Author: Keith Turner <[email protected]>
AuthorDate: Fri Nov 27 18:43:05 2026 -0500

    Fixes server query (#6682)
    
    The changes in #6676 broke server query for the case when the client
    property was not set. In this case it would get an NPE and would not
    fall back to the default value. ScannerIT was failing because of this.
---
 .../apache/accumulo/core/clientImpl/InstanceOperationsImpl.java    | 5 ++---
 .../main/java/org/apache/accumulo/core/conf/ClientProperty.java    | 7 +++++++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git 
a/core/src/main/java/org/apache/accumulo/core/clientImpl/InstanceOperationsImpl.java
 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/InstanceOperationsImpl.java
index 77159c7a5c..b8e0b64f10 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/clientImpl/InstanceOperationsImpl.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/InstanceOperationsImpl.java
@@ -57,7 +57,6 @@ import 
org.apache.accumulo.core.clientImpl.thrift.ClientService;
 import org.apache.accumulo.core.clientImpl.thrift.ConfigurationType;
 import org.apache.accumulo.core.clientImpl.thrift.TVersionedProperties;
 import org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException;
-import org.apache.accumulo.core.conf.ConfigurationTypeHelper;
 import org.apache.accumulo.core.conf.DeprecatedPropertyUtil;
 import org.apache.accumulo.core.data.InstanceId;
 import org.apache.accumulo.core.data.ResourceGroupId;
@@ -412,8 +411,8 @@ public class InstanceOperationsImpl implements 
InstanceOperations {
     } else if (servers.size() == 1) {
       executorService = MoreExecutors.newDirectExecutorService();
     } else {
-      int numThreads = Math.max(4, Math.min((servers.size()) / 10, 
ConfigurationTypeHelper
-          
.getNumThreads(context.getConfiguration().get(RPC_SERVER_QUERY_MAX_THREADS.getKey()))));
+      int numThreads = Math.max(4, Math.min((servers.size()) / 10,
+          RPC_SERVER_QUERY_MAX_THREADS.getThreads(context.properties())));
       executorService =
           
context.threadPools().getPoolBuilder(pool).numCoreThreads(numThreads).build();
     }
diff --git 
a/core/src/main/java/org/apache/accumulo/core/conf/ClientProperty.java 
b/core/src/main/java/org/apache/accumulo/core/conf/ClientProperty.java
index 96726ebd2f..5d6c82d8d4 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/ClientProperty.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/ClientProperty.java
@@ -238,6 +238,13 @@ public enum ClientProperty {
     return Boolean.parseBoolean(value);
   }
 
+  public int getThreads(Properties properties) {
+    checkState(getType() == PropertyType.COUNT,
+        "Invalid type setting bytes. Type must be " + PropertyType.COUNT + ", 
not " + getType());
+    String value = getValue(properties);
+    return ConfigurationTypeHelper.getNumThreads(value);
+  }
+
   public void setBytes(Properties properties, Long bytes) {
     checkState(getType() == PropertyType.BYTES,
         "Invalid type setting bytes. Type must be " + PropertyType.BYTES + ", 
not " + getType());

Reply via email to