accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bil...@apache.org
Subject accumulo git commit: ACCUMULO-3742 return to setListDelimiter for configurations and test escape characters in values
Date Thu, 23 Apr 2015 20:57:50 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.7 765099f26 -> d04487be9


ACCUMULO-3742 return to setListDelimiter for configurations and test escape characters in
values


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/d04487be
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/d04487be
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/d04487be

Branch: refs/heads/1.7
Commit: d04487be92c1dbcfcfd1abb0670396e7d6a46595
Parents: 765099f
Author: Billie Rinaldi <billie@apache.org>
Authored: Thu Apr 23 13:57:33 2015 -0700
Committer: Billie Rinaldi <billie@apache.org>
Committed: Thu Apr 23 13:57:33 2015 -0700

----------------------------------------------------------------------
 .../accumulo/core/client/ClientConfiguration.java     | 14 +++++++-------
 .../accumulo/core/client/ClientConfigurationTest.java |  8 ++++----
 core/src/test/resources/multi-valued.client.conf      |  2 +-
 .../accumulo/minicluster/MiniAccumuloInstance.java    |  2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/d04487be/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java b/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
index f404bd8..b531f26 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
@@ -154,8 +154,8 @@ public class ClientConfiguration extends CompositeConfiguration {
   private ClientConfiguration(PropertiesConfiguration propertiesConfiguration, String configFile)
throws ConfigurationException {
     super(propertiesConfiguration);
     // Don't do list interpolation
-    this.setDelimiterParsingDisabled(true);
-    propertiesConfiguration.setDelimiterParsingDisabled(true);
+    this.setListDelimiter('\0');
+    propertiesConfiguration.setListDelimiter('\0');
     propertiesConfiguration.load(configFile);
   }
 
@@ -166,22 +166,22 @@ public class ClientConfiguration extends CompositeConfiguration {
   private ClientConfiguration(PropertiesConfiguration propertiesConfiguration, File configFile)
throws ConfigurationException {
     super(propertiesConfiguration);
     // Don't do list interpolation
-    this.setDelimiterParsingDisabled(true);
-    propertiesConfiguration.setDelimiterParsingDisabled(true);
+    this.setListDelimiter('\0');
+    propertiesConfiguration.setListDelimiter('\0');
     propertiesConfiguration.load(configFile);
   }
 
   public ClientConfiguration(List<? extends Configuration> configs) {
     super(configs);
     // Don't do list interpolation
-    this.setDelimiterParsingDisabled(true);
+    this.setListDelimiter('\0');
     for (Configuration c : configs) {
       if (c instanceof AbstractConfiguration) {
         AbstractConfiguration abstractConfiguration = (AbstractConfiguration) c;
         if (!abstractConfiguration.isDelimiterParsingDisabled() && abstractConfiguration.getListDelimiter()
!= '\0') {
           log.warn("Client configuration constructed with a Configuration that did not have
list delimiter disabled or overridden, multi-valued config " +
               "properties may be unavailable");
-          abstractConfiguration.setDelimiterParsingDisabled(true);
+          abstractConfiguration.setListDelimiter('\0');
         }
       }
     }
@@ -230,7 +230,7 @@ public class ClientConfiguration extends CompositeConfiguration {
 
   public static ClientConfiguration deserialize(String serializedConfig) {
     PropertiesConfiguration propConfig = new PropertiesConfiguration();
-    propConfig.setDelimiterParsingDisabled(true);
+    propConfig.setListDelimiter('\0');
     try {
       propConfig.load(new StringReader(serializedConfig));
     } catch (ConfigurationException e) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/d04487be/core/src/test/java/org/apache/accumulo/core/client/ClientConfigurationTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/ClientConfigurationTest.java
b/core/src/test/java/org/apache/accumulo/core/client/ClientConfigurationTest.java
index 3e8e0f3..6f91b0b 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/ClientConfigurationTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/ClientConfigurationTest.java
@@ -90,7 +90,7 @@ public class ClientConfigurationTest {
 
     // not the recommended way to construct a client configuration, but it works
     PropertiesConfiguration propertiesConfiguration = new PropertiesConfiguration();
-    propertiesConfiguration.setDelimiterParsingDisabled(true);
+    propertiesConfiguration.setListDelimiter('\0');
     propertiesConfiguration.addProperty(ClientProperty.INSTANCE_ZK_HOST.getKey(), val);
     propertiesConfiguration.load(new StringReader(ClientProperty.TRACE_SPAN_RECEIVERS.getKey()
+ "=" + val));
     ClientConfiguration conf = new ClientConfiguration(propertiesConfiguration);
@@ -99,10 +99,10 @@ public class ClientConfigurationTest {
     assertEquals(val, conf.get(ClientProperty.TRACE_SPAN_RECEIVERS));
     assertEquals(1, conf.getList(ClientProperty.TRACE_SPAN_RECEIVERS.getKey()).size());
 
-    // incorrect usage that results in not being able to use multi-valued properties
+    // incorrect usage that results in not being able to use multi-valued properties unless
commas are escaped
     conf = new ClientConfiguration(new PropertiesConfiguration("multi-valued.client.conf"));
-    assertNotEquals(val, conf.get(ClientProperty.INSTANCE_ZK_HOST));
-    assertEquals(3, conf.getList(ClientProperty.INSTANCE_ZK_HOST.getKey()).size());
+    assertEquals(val, conf.get(ClientProperty.INSTANCE_ZK_HOST));
+    assertEquals(1, conf.getList(ClientProperty.INSTANCE_ZK_HOST.getKey()).size());
     assertNotEquals(val, conf.get(ClientProperty.TRACE_SPAN_RECEIVERS));
     assertEquals(3, conf.getList(ClientProperty.TRACE_SPAN_RECEIVERS.getKey()).size());
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/d04487be/core/src/test/resources/multi-valued.client.conf
----------------------------------------------------------------------
diff --git a/core/src/test/resources/multi-valued.client.conf b/core/src/test/resources/multi-valued.client.conf
index b04a42e..8ccded1 100644
--- a/core/src/test/resources/multi-valued.client.conf
+++ b/core/src/test/resources/multi-valued.client.conf
@@ -13,5 +13,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-instance.zookeeper.host=comma,separated,list
+instance.zookeeper.host=comma\,separated\,list
 trace.span.receivers=comma,separated,list

http://git-wip-us.apache.org/repos/asf/accumulo/blob/d04487be/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloInstance.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloInstance.java
b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloInstance.java
index 80546bd..4681dfb 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloInstance.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloInstance.java
@@ -44,7 +44,7 @@ public class MiniAccumuloInstance extends ZooKeeperInstance {
   public static PropertiesConfiguration getConfigProperties(File directory) {
     try {
       PropertiesConfiguration conf = new PropertiesConfiguration();
-      conf.setDelimiterParsingDisabled(true);
+      conf.setListDelimiter('\0');
       conf.load(new File(new File(directory, "conf"), "client.conf"));
       return conf;
     } catch (ConfigurationException e) {


Mime
View raw message