hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [47/50] [abbrv] git commit: HDFS-6954. With crypto, no native lib systems are too verbose. Contributed by Charles Lamb.
Date Tue, 02 Sep 2014 22:59:20 GMT
HDFS-6954. With crypto, no native lib systems are too verbose. Contributed by Charles Lamb.


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

Branch: refs/heads/MR-2841
Commit: a0ccf83dfd6bff81944d6855652eae7f7f7b0ba9
Parents: faa4455
Author: Andrew Wang <wang@apache.org>
Authored: Tue Sep 2 14:22:20 2014 -0700
Committer: Andrew Wang <wang@apache.org>
Committed: Tue Sep 2 14:22:20 2014 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/crypto/CryptoCodec.java    | 19 ++++++++++++-------
 .../apache/hadoop/util/PerformanceAdvisory.java  |  7 ++++---
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt      |  4 +++-
 .../java/org/apache/hadoop/hdfs/DFSClient.java   | 10 ++++++----
 4 files changed, 25 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/a0ccf83d/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/CryptoCodec.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/CryptoCodec.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/CryptoCodec.java
index 9de7f95..9bd1846 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/CryptoCodec.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/CryptoCodec.java
@@ -24,6 +24,7 @@ import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceStability;
 import org.apache.hadoop.conf.Configurable;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.util.PerformanceAdvisory;
 import org.apache.hadoop.util.ReflectionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -48,7 +49,7 @@ public abstract class CryptoCodec implements Configurable {
    * 
    * @param conf
    *          the configuration
-   * @param CipherSuite
+   * @param cipherSuite
    *          algorithm/mode/padding
    * @return CryptoCodec the codec object. Null value will be returned if no
    *         crypto codec classes with cipher suite configured.
@@ -66,15 +67,18 @@ public abstract class CryptoCodec implements Configurable {
         CryptoCodec c = ReflectionUtils.newInstance(klass, conf);
         if (c.getCipherSuite().getName().equals(cipherSuite.getName())) {
           if (codec == null) {
-            LOG.debug("Using crypto codec {}.", klass.getName());
+            PerformanceAdvisory.LOG.debug("Using crypto codec {}.",
+                klass.getName());
             codec = c;
           }
         } else {
-          LOG.warn("Crypto codec {} doesn't meet the cipher suite {}.", 
+          PerformanceAdvisory.LOG.debug(
+              "Crypto codec {} doesn't meet the cipher suite {}.",
               klass.getName(), cipherSuite.getName());
         }
       } catch (Exception e) {
-        LOG.warn("Crypto codec {} is not available.", klass.getName());
+        PerformanceAdvisory.LOG.debug("Crypto codec {} is not available.",
+            klass.getName());
       }
     }
     
@@ -108,7 +112,8 @@ public abstract class CryptoCodec implements Configurable {
         cipherSuite.getConfigSuffix();
     String codecString = conf.get(configName);
     if (codecString == null) {
-      LOG.warn("No crypto codec classes with cipher suite configured.");
+      PerformanceAdvisory.LOG.debug(
+          "No crypto codec classes with cipher suite configured.");
       return null;
     }
     for (String c : Splitter.on(',').trimResults().omitEmptyStrings().
@@ -117,9 +122,9 @@ public abstract class CryptoCodec implements Configurable {
         Class<?> cls = conf.getClassByName(c);
         result.add(cls.asSubclass(CryptoCodec.class));
       } catch (ClassCastException e) {
-        LOG.warn("Class " + c + " is not a CryptoCodec.");
+        PerformanceAdvisory.LOG.debug("Class {} is not a CryptoCodec.", c);
       } catch (ClassNotFoundException e) {
-        LOG.warn("Crypto codec " + c + " not found.");
+        PerformanceAdvisory.LOG.debug("Crypto codec {} not found.", c);
       }
     }
     

http://git-wip-us.apache.org/repos/asf/hadoop/blob/a0ccf83d/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/PerformanceAdvisory.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/PerformanceAdvisory.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/PerformanceAdvisory.java
index 306d47c..3304ebb 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/PerformanceAdvisory.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/PerformanceAdvisory.java
@@ -16,9 +16,10 @@
  */
 package org.apache.hadoop.util;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class PerformanceAdvisory {
-  public static final Log LOG = LogFactory.getLog(PerformanceAdvisory.class);
+  public static final Logger LOG =
+      LoggerFactory.getLogger(PerformanceAdvisory.class);
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/a0ccf83d/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index ecf6782..7cfd632 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -432,6 +432,7 @@ Release 2.6.0 - UNRELEASED
 
     HDFS-6634. inotify in HDFS. (James Thomas via wang)
 
+
   OPTIMIZATIONS
 
     HDFS-6690. Deduplicate xattr names in memory. (wang)
@@ -672,7 +673,8 @@ Release 2.6.0 - UNRELEASED
       HDFS-6817. Fix findbugs and other warnings. (yliu)
   
       HDFS-6839. Fix TestCLI to expect new output. (clamb)
-    --
+
+      HDFS-6954. With crypto, no native lib systems are too verbose. (clamb via wang)
 
 Release 2.5.1 - UNRELEASED
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/a0ccf83d/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
index ce0f133..8daf912 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
@@ -606,10 +606,12 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
       cipherSuites.add(codec.getCipherSuite());
     }
     provider = DFSUtil.createKeyProviderCryptoExtension(conf);
-    if (provider == null) {
-      LOG.info("No KeyProvider found.");
-    } else {
-      LOG.info("Found KeyProvider: " + provider.toString());
+    if (LOG.isDebugEnabled()) {
+      if (provider == null) {
+        LOG.debug("No KeyProvider found.");
+      } else {
+        LOG.debug("Found KeyProvider: " + provider.toString());
+      }
     }
     int numResponseToDrop = conf.getInt(
         DFSConfigKeys.DFS_CLIENT_TEST_DROP_NAMENODE_RESPONSE_NUM_KEY,


Mime
View raw message