You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2014/10/08 19:29:19 UTC

[1/3] git commit: ACCUMULO-3212 Do not load defaults into new Configuration objects for CredentialProvider

Repository: accumulo
Updated Branches:
  refs/heads/1.6 4a5bd7ef6 -> 9b3bc30fe
  refs/heads/master f6b83ee50 -> e30594a65


ACCUMULO-3212 Do not load defaults into new Configuration objects for CredentialProvider

Formatter fixed up some non-complaint whitespace too.


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

Branch: refs/heads/1.6
Commit: 9b3bc30fe7a0f5f28306d4a3703811524c0cf5e7
Parents: 4a5bd7e
Author: Josh Elser <el...@apache.org>
Authored: Wed Oct 8 13:17:23 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Wed Oct 8 13:17:23 2014 -0400

----------------------------------------------------------------------
 .../tokens/CredentialProviderToken.java         |  4 +--
 .../conf/CredentialProviderFactoryShim.java     |  2 +-
 .../accumulo/core/conf/SiteConfiguration.java   | 28 ++++++++++----------
 3 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/9b3bc30f/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java
index fa5bb33..99a3dbb 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java
@@ -44,7 +44,7 @@ public class CredentialProviderToken extends PasswordToken {
   }
 
   protected void setWithCredentialProviders(String name, String credentialProviders) throws IOException {
-    final Configuration conf = new Configuration();
+    final Configuration conf = new Configuration(false);
     conf.set(CredentialProviderFactoryShim.CREDENTIAL_PROVIDER_PATH, credentialProviders);
 
     char[] password = CredentialProviderFactoryShim.getValueFromCredentialProvider(conf, name);
@@ -53,7 +53,7 @@ public class CredentialProviderToken extends PasswordToken {
       throw new IOException("No password could be extracted from CredentialProvider(s) with " + name);
     }
 
-    setPassword(CharBuffer.wrap(password));    
+    setPassword(CharBuffer.wrap(password));
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9b3bc30f/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java b/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
index aa3d195..28805fd 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
@@ -311,7 +311,7 @@ public class CredentialProviderFactoryShim {
    */
   public static Configuration getConfiguration(String credentialProviders) {
     Preconditions.checkNotNull(credentialProviders);
-    final Configuration conf = new Configuration();
+    final Configuration conf = new Configuration(false);
     conf.set(CredentialProviderFactoryShim.CREDENTIAL_PROVIDER_PATH, credentialProviders);
     return conf;
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9b3bc30f/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
----------------------------------------------------------------------
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 12f3ad2..9b65e7d 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
@@ -31,10 +31,10 @@ import org.apache.log4j.Logger;
  */
 public class SiteConfiguration extends AccumuloConfiguration {
   private static final Logger log = Logger.getLogger(SiteConfiguration.class);
-  
+
   private static AccumuloConfiguration parent = null;
   private static SiteConfiguration instance = null;
-  
+
   private static Configuration xmlConfig;
 
   /**
@@ -43,7 +43,7 @@ public class SiteConfiguration extends AccumuloConfiguration {
   SiteConfiguration(AccumuloConfiguration parent) {
     SiteConfiguration.parent = parent;
   }
-  
+
   synchronized public static SiteConfiguration getInstance(AccumuloConfiguration parent) {
     if (instance == null) {
       instance = new SiteConfiguration(parent);
@@ -51,12 +51,12 @@ public class SiteConfiguration extends AccumuloConfiguration {
     }
     return instance;
   }
-  
+
   synchronized private static Configuration getXmlConfig() {
     String configFile = System.getProperty("org.apache.accumulo.config.file", "accumulo-site.xml");
     if (xmlConfig == null) {
       xmlConfig = new Configuration(false);
-      
+
       if (SiteConfiguration.class.getClassLoader().getResource(configFile) == null)
         log.warn(configFile + " not found on classpath", new Throwable());
       else
@@ -64,7 +64,7 @@ public class SiteConfiguration extends AccumuloConfiguration {
     }
     return xmlConfig;
   }
-  
+
   @Override
   public String get(Property property) {
     String key = property.getKey();
@@ -86,7 +86,7 @@ public class SiteConfiguration extends AccumuloConfiguration {
     }
 
     String value = getXmlConfig().get(key);
-    
+
     if (value == null || !property.getType().isValidFormat(value)) {
       if (value != null)
         log.error("Using default value for " + key + " due to improperly formatted " + property.getType() + ": " + value);
@@ -94,7 +94,7 @@ public class SiteConfiguration extends AccumuloConfiguration {
     }
     return value;
   }
-  
+
   @Override
   public void getProperties(Map<String,String> props, PropertyFilter filter) {
     parent.getProperties(props, filter);
@@ -108,7 +108,7 @@ public class SiteConfiguration extends AccumuloConfiguration {
     if (null != hadoopConf) {
       try {
         for (String key : CredentialProviderFactoryShim.getKeys(hadoopConf)) {
-          if (!Property.isValidPropertyKey(key) || !Property.isSensitive(key)) { 
+          if (!Property.isValidPropertyKey(key) || !Property.isSensitive(key)) {
             continue;
           }
 
@@ -132,7 +132,7 @@ public class SiteConfiguration extends AccumuloConfiguration {
     if (null != credProviderPathsValue) {
       // We have configuration for a CredentialProvider
       // Try to pull the sensitive password from there
-      Configuration conf = new Configuration();
+      Configuration conf = new Configuration(false);
       conf.set(CredentialProviderFactoryShim.CREDENTIAL_PROVIDER_PATH, credProviderPathsValue);
       return conf;
     }
@@ -153,8 +153,8 @@ public class SiteConfiguration extends AccumuloConfiguration {
   public void clear() {
     getXmlConfig().clear();
   }
-  
-  
+
+
   /**
    * method here to support testing, do not call
    */
@@ -164,14 +164,14 @@ public class SiteConfiguration extends AccumuloConfiguration {
       xmlConfig = null;
     }
   }
-  
+
   /**
    * method here to support testing, do not call
    */
   public void set(Property property, String value) {
     set(property.getKey(), value);
   }
-  
+
   /**
    * method here to support testing, do not call
    */


[2/3] git commit: ACCUMULO-3212 Do not load defaults into new Configuration objects for CredentialProvider

Posted by el...@apache.org.
ACCUMULO-3212 Do not load defaults into new Configuration objects for CredentialProvider

Formatter fixed up some non-complaint whitespace too.


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

Branch: refs/heads/master
Commit: 9b3bc30fe7a0f5f28306d4a3703811524c0cf5e7
Parents: 4a5bd7e
Author: Josh Elser <el...@apache.org>
Authored: Wed Oct 8 13:17:23 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Wed Oct 8 13:17:23 2014 -0400

----------------------------------------------------------------------
 .../tokens/CredentialProviderToken.java         |  4 +--
 .../conf/CredentialProviderFactoryShim.java     |  2 +-
 .../accumulo/core/conf/SiteConfiguration.java   | 28 ++++++++++----------
 3 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/9b3bc30f/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java
index fa5bb33..99a3dbb 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java
@@ -44,7 +44,7 @@ public class CredentialProviderToken extends PasswordToken {
   }
 
   protected void setWithCredentialProviders(String name, String credentialProviders) throws IOException {
-    final Configuration conf = new Configuration();
+    final Configuration conf = new Configuration(false);
     conf.set(CredentialProviderFactoryShim.CREDENTIAL_PROVIDER_PATH, credentialProviders);
 
     char[] password = CredentialProviderFactoryShim.getValueFromCredentialProvider(conf, name);
@@ -53,7 +53,7 @@ public class CredentialProviderToken extends PasswordToken {
       throw new IOException("No password could be extracted from CredentialProvider(s) with " + name);
     }
 
-    setPassword(CharBuffer.wrap(password));    
+    setPassword(CharBuffer.wrap(password));
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9b3bc30f/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java b/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
index aa3d195..28805fd 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
@@ -311,7 +311,7 @@ public class CredentialProviderFactoryShim {
    */
   public static Configuration getConfiguration(String credentialProviders) {
     Preconditions.checkNotNull(credentialProviders);
-    final Configuration conf = new Configuration();
+    final Configuration conf = new Configuration(false);
     conf.set(CredentialProviderFactoryShim.CREDENTIAL_PROVIDER_PATH, credentialProviders);
     return conf;
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9b3bc30f/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
----------------------------------------------------------------------
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 12f3ad2..9b65e7d 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
@@ -31,10 +31,10 @@ import org.apache.log4j.Logger;
  */
 public class SiteConfiguration extends AccumuloConfiguration {
   private static final Logger log = Logger.getLogger(SiteConfiguration.class);
-  
+
   private static AccumuloConfiguration parent = null;
   private static SiteConfiguration instance = null;
-  
+
   private static Configuration xmlConfig;
 
   /**
@@ -43,7 +43,7 @@ public class SiteConfiguration extends AccumuloConfiguration {
   SiteConfiguration(AccumuloConfiguration parent) {
     SiteConfiguration.parent = parent;
   }
-  
+
   synchronized public static SiteConfiguration getInstance(AccumuloConfiguration parent) {
     if (instance == null) {
       instance = new SiteConfiguration(parent);
@@ -51,12 +51,12 @@ public class SiteConfiguration extends AccumuloConfiguration {
     }
     return instance;
   }
-  
+
   synchronized private static Configuration getXmlConfig() {
     String configFile = System.getProperty("org.apache.accumulo.config.file", "accumulo-site.xml");
     if (xmlConfig == null) {
       xmlConfig = new Configuration(false);
-      
+
       if (SiteConfiguration.class.getClassLoader().getResource(configFile) == null)
         log.warn(configFile + " not found on classpath", new Throwable());
       else
@@ -64,7 +64,7 @@ public class SiteConfiguration extends AccumuloConfiguration {
     }
     return xmlConfig;
   }
-  
+
   @Override
   public String get(Property property) {
     String key = property.getKey();
@@ -86,7 +86,7 @@ public class SiteConfiguration extends AccumuloConfiguration {
     }
 
     String value = getXmlConfig().get(key);
-    
+
     if (value == null || !property.getType().isValidFormat(value)) {
       if (value != null)
         log.error("Using default value for " + key + " due to improperly formatted " + property.getType() + ": " + value);
@@ -94,7 +94,7 @@ public class SiteConfiguration extends AccumuloConfiguration {
     }
     return value;
   }
-  
+
   @Override
   public void getProperties(Map<String,String> props, PropertyFilter filter) {
     parent.getProperties(props, filter);
@@ -108,7 +108,7 @@ public class SiteConfiguration extends AccumuloConfiguration {
     if (null != hadoopConf) {
       try {
         for (String key : CredentialProviderFactoryShim.getKeys(hadoopConf)) {
-          if (!Property.isValidPropertyKey(key) || !Property.isSensitive(key)) { 
+          if (!Property.isValidPropertyKey(key) || !Property.isSensitive(key)) {
             continue;
           }
 
@@ -132,7 +132,7 @@ public class SiteConfiguration extends AccumuloConfiguration {
     if (null != credProviderPathsValue) {
       // We have configuration for a CredentialProvider
       // Try to pull the sensitive password from there
-      Configuration conf = new Configuration();
+      Configuration conf = new Configuration(false);
       conf.set(CredentialProviderFactoryShim.CREDENTIAL_PROVIDER_PATH, credProviderPathsValue);
       return conf;
     }
@@ -153,8 +153,8 @@ public class SiteConfiguration extends AccumuloConfiguration {
   public void clear() {
     getXmlConfig().clear();
   }
-  
-  
+
+
   /**
    * method here to support testing, do not call
    */
@@ -164,14 +164,14 @@ public class SiteConfiguration extends AccumuloConfiguration {
       xmlConfig = null;
     }
   }
-  
+
   /**
    * method here to support testing, do not call
    */
   public void set(Property property, String value) {
     set(property.getKey(), value);
   }
-  
+
   /**
    * method here to support testing, do not call
    */


[3/3] git commit: Merge branch '1.6'

Posted by el...@apache.org.
Merge branch '1.6'

Conflicts:
	core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java


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

Branch: refs/heads/master
Commit: e30594a65ceb43dd9f4a3c69b087301a28342816
Parents: f6b83ee 9b3bc30
Author: Josh Elser <el...@apache.org>
Authored: Wed Oct 8 13:28:59 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Wed Oct 8 13:28:59 2014 -0400

----------------------------------------------------------------------
 .../tokens/CredentialProviderToken.java         |  4 ++--
 .../conf/CredentialProviderFactoryShim.java     |  2 +-
 .../accumulo/core/conf/SiteConfiguration.java   | 24 ++++++++++----------
 3 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/e30594a6/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
index 55f69bd,9b65e7d..2d121c7
--- a/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
@@@ -173,12 -153,10 +173,12 @@@ public class SiteConfiguration extends 
    public void clear() {
      getXmlConfig().clear();
    }
-   
-   
+ 
+ 
    /**
 -   * method here to support testing, do not call
 +   * Clears the configuration properties in this configuration (but not the
 +   * parent) and nulls it. This method supports testing and should not be
 +   * called.
     */
    public synchronized void clearAndNull() {
      if (xmlConfig != null) {
@@@ -186,22 -164,16 +186,22 @@@
        xmlConfig = null;
      }
    }
-   
+ 
    /**
 -   * method here to support testing, do not call
 +   * Sets a property. This method supports testing and should not be called.
 +   *
 +   * @param property property to set
 +   * @param value property value
     */
    public void set(Property property, String value) {
      set(property.getKey(), value);
    }
-   
+ 
    /**
 -   * method here to support testing, do not call
 +   * Sets a property. This method supports testing and should not be called.
 +   *
 +   * @param key key of property to set
 +   * @param value property value
     */
    public void set(String key, String value) {
      getXmlConfig().set(key, value);