You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by mw...@apache.org on 2018/12/21 16:29:28 UTC

[accumulo] branch master updated: Add validation to SiteConfiguration (#852)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new dbfbfe8  Add validation to SiteConfiguration (#852)
dbfbfe8 is described below

commit dbfbfe88f4e1e5d2c1ccd96bbde988d4c16b34b6
Author: Mike Walch <mw...@apache.org>
AuthorDate: Fri Dec 21 11:29:23 2018 -0500

    Add validation to SiteConfiguration (#852)
---
 .../src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java | 1 +
 .../test/java/org/apache/accumulo/core/conf/SiteConfigurationTest.java | 3 ++-
 core/src/test/resources/accumulo2.properties                           | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

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 96e6d85..5a84f42 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
@@ -80,6 +80,7 @@ public class SiteConfiguration extends AccumuloConfiguration {
 
   public SiteConfiguration(URL accumuloPropsLocation, Map<String,String> overrides) {
     config = createMap(accumuloPropsLocation, overrides);
+    ConfigSanityCheck.validate(config.entrySet());
   }
 
   @SuppressFBWarnings(value = "URLCONNECTION_SSRF_FD",
diff --git a/core/src/test/java/org/apache/accumulo/core/conf/SiteConfigurationTest.java b/core/src/test/java/org/apache/accumulo/core/conf/SiteConfigurationTest.java
index ee412f5..ada7c55 100644
--- a/core/src/test/java/org/apache/accumulo/core/conf/SiteConfigurationTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/conf/SiteConfigurationTest.java
@@ -90,7 +90,8 @@ public class SiteConfigurationTest {
     assertEquals("hdfs://localhost:8020/accumulo123", conf.get(Property.INSTANCE_VOLUMES));
     assertEquals("123s", conf.get(Property.GENERAL_RPC_TIMEOUT));
     assertEquals("256M", conf.get(Property.TSERV_WALOG_MAX_SIZE));
-    assertEquals("DummyService", conf.get(Property.INSTANCE_CRYPTO_SERVICE));
+    assertEquals("org.apache.accumulo.core.cryptoImpl.AESCryptoService",
+        conf.get(Property.INSTANCE_CRYPTO_SERVICE));
   }
 
   @Test
diff --git a/core/src/test/resources/accumulo2.properties b/core/src/test/resources/accumulo2.properties
index 71de2bd..126604c 100644
--- a/core/src/test/resources/accumulo2.properties
+++ b/core/src/test/resources/accumulo2.properties
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 general.rpc.timeout=123s
-instance.crypto.service=DummyService
+instance.crypto.service=org.apache.accumulo.core.cryptoImpl.AESCryptoService
 instance.secret=mysecret
 instance.volumes=hdfs://localhost:8020/accumulo123
 instance.zookeeper.host=myhost123:2181