[accumulo] branch main updated: Improve error message in CompactionService. Closes #2311 (#2315)

2021-10-13 Thread mmiller
This is an automated email from the ASF dual-hosted git repository.

mmiller 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 eaa8268  Improve error message in CompactionService. Closes #2311 
(#2315)
eaa8268 is described below

commit eaa8268f3835733283f8a1ffcabdf5101135a4f3
Author: Mike Miller 
AuthorDate: Wed Oct 13 13:45:52 2021 -0400

Improve error message in CompactionService. Closes #2311 (#2315)
---
 .../org/apache/accumulo/tserver/compactions/CompactionService.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/CompactionService.java
 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/CompactionService.java
index 43f1363..c5ea507 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/CompactionService.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/CompactionService.java
@@ -132,7 +132,8 @@ public class CompactionService {
 @Override
 public CompactionExecutorId getExternalExecutor(String name) {
   var ceid = CompactionExecutorIdImpl.externalId(name);
-  
Preconditions.checkArgument(!requestedExternalExecutors.contains(ceid));
+  
Preconditions.checkArgument(!requestedExternalExecutors.contains(ceid),
+  "Duplicate external executor for queue " + name);
   requestedExternalExecutors.add(ceid);
   return ceid;
 }


[accumulo] branch main updated: Rename config check classes (#2314)

2021-10-13 Thread mmiller
This is an automated email from the ASF dual-hosted git repository.

mmiller 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 0357c9b  Rename config check classes (#2314)
0357c9b is described below

commit 0357c9b66e0fcd49cc8778c3e51d91a60b494e38
Author: Mike Miller 
AuthorDate: Wed Oct 13 08:26:57 2021 -0400

Rename config check classes (#2314)

* Rename classes that check configuration to more specific names
* Rename ConfigSanityCheck to CheckServerConfig to match keyword
---
 ...ConfigSanityCheck.java => ConfigCheckUtil.java} | 14 ++--
 .../accumulo/core/conf/SiteConfiguration.java  |  2 +-
 ...nityCheckTest.java => ConfigCheckUtilTest.java} | 26 +++---
 .../core/conf/DefaultConfigurationTest.java|  2 +-
 ...nfigSanityCheck.java => CheckServerConfig.java} |  2 +-
 .../server/conf/ServerConfigurationFactory.java|  8 +++
 .../conf/ServerConfigurationFactoryTest.java   |  2 +-
 .../apache/accumulo/test/start/KeywordStartIT.java |  4 ++--
 8 files changed, 30 insertions(+), 30 deletions(-)

diff --git 
a/core/src/main/java/org/apache/accumulo/core/conf/ConfigSanityCheck.java 
b/core/src/main/java/org/apache/accumulo/core/conf/ConfigCheckUtil.java
similarity index 94%
rename from 
core/src/main/java/org/apache/accumulo/core/conf/ConfigSanityCheck.java
rename to core/src/main/java/org/apache/accumulo/core/conf/ConfigCheckUtil.java
index fada2ba..b0bc099 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/ConfigSanityCheck.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/ConfigCheckUtil.java
@@ -31,9 +31,9 @@ import com.google.common.base.Preconditions;
 /**
  * A utility class for validating {@link AccumuloConfiguration} instances.
  */
-public class ConfigSanityCheck {
+public class ConfigCheckUtil {
 
-  private static final Logger log = 
LoggerFactory.getLogger(ConfigSanityCheck.class);
+  private static final Logger log = 
LoggerFactory.getLogger(ConfigCheckUtil.class);
   private static final String PREFIX = "BAD CONFIG ";
 
   /**
@@ -44,7 +44,7 @@ public class ConfigSanityCheck {
*
* @param entries
*  iterable through configuration keys and values
-   * @throws SanityCheckException
+   * @throws ConfigCheckException
*   if a fatal configuration error is found
*/
   public static void validate(Iterable> entries) {
@@ -126,15 +126,15 @@ public class ConfigSanityCheck {
   }
 
   /**
-   * The exception thrown when {@link ConfigSanityCheck#validate(Iterable)} 
fails.
+   * The exception thrown when {@link ConfigCheckUtil#validate(Iterable)} 
fails.
*/
-  public static class SanityCheckException extends RuntimeException {
+  public static class ConfigCheckException extends RuntimeException {
 private static final long serialVersionUID = 1L;
 
 /**
  * Creates a new exception with the given message.
  */
-public SanityCheckException(String msg) {
+public ConfigCheckException(String msg) {
   super(msg);
 }
   }
@@ -143,7 +143,7 @@ public class ConfigSanityCheck {
 // ACCUMULO-3651 Level changed from fatal to error and FATAL added to 
message for slf4j
 // compatibility
 log.error("FATAL: {}", msg);
-throw new SanityCheckException(msg);
+throw new ConfigCheckException(msg);
   }
 
   /**
diff --git 
a/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java 
b/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
index 35bda16..63c5c28 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
@@ -206,7 +206,7 @@ public class SiteConfiguration extends 
AccumuloConfiguration {
   private final Map config;
 
   private SiteConfiguration(Map config) {
-ConfigSanityCheck.validate(config.entrySet());
+ConfigCheckUtil.validate(config.entrySet());
 this.config = config;
   }
 
diff --git 
a/core/src/test/java/org/apache/accumulo/core/conf/ConfigSanityCheckTest.java 
b/core/src/test/java/org/apache/accumulo/core/conf/ConfigCheckUtilTest.java
similarity index 78%
rename from 
core/src/test/java/org/apache/accumulo/core/conf/ConfigSanityCheckTest.java
rename to 
core/src/test/java/org/apache/accumulo/core/conf/ConfigCheckUtilTest.java
index 30f99dd..9574e15 100644
--- 
a/core/src/test/java/org/apache/accumulo/core/conf/ConfigSanityCheckTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/conf/ConfigCheckUtilTest.java
@@ -20,11 +20,11 @@ package org.apache.accumulo.core.conf;
 
 import java.util.Map;
 
-import org.apache.accumulo.core.conf.ConfigSanityCheck.SanityCheckException;
+import org.apache.accumulo.core.conf.ConfigCheckUtil.ConfigCheckException;
 import org.junit.Before;
 import org.junit.Test;
 
-public class ConfigSanityCheckTest {
+public class ConfigCheckUtil