[ 
https://issues.apache.org/jira/browse/HDFS-6564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14589939#comment-14589939
 ] 

Sean Busbey commented on HDFS-6564:
-----------------------------------

{code}
diff --git 
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/CachePoolInfo.java
 
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/CachePoolInfo.java
index 61bbe38..31850dc 100644
--- 
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/CachePoolInfo.java
+++ 
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/CachePoolInfo.java
@@ -24,13 +24,13 @@
 
 import org.apache.commons.lang.builder.EqualsBuilder;
 import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceStability;
 import org.apache.hadoop.fs.InvalidRequestException;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.hdfs.protocol.CacheDirectiveInfo.Expiration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * CachePoolInfo describes a cache pool.
@@ -41,7 +41,8 @@
 @InterfaceAudience.Public
 @InterfaceStability.Evolving
 public class CachePoolInfo {
-  public static final Log LOG = LogFactory.getLog(CachePoolInfo.class);
+  public static final Logger LOG = LoggerFactory
+      .getLogger(CachePoolInfo.class);
{code}

This is a binary and source incompatible change to public API. Please be sure 
to flag the jira as such and provide release notes.

{code}
@@ -733,9 +723,7 @@ final T getResponse(HttpURLConnection conn) throws 
IOException {
       } catch (Exception e) { // catch json parser errors
         final IOException ioe =
             new IOException("Response decoding failure: "+e.toString(), e);
-        if (LOG.isDebugEnabled()) {
-          LOG.debug(ioe);
-        }
+        LOG.debug("Response decoding failure: {}", e.toString(), e);
         throw ioe;
{code}

nit: it's possible, though unlikely, that this e.toString call is still 
expensive and worth guarding with isDebugEnabled.

> Use slf4j instead of common-logging in hdfs-client
> --------------------------------------------------
>
>                 Key: HDFS-6564
>                 URL: https://issues.apache.org/jira/browse/HDFS-6564
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Haohui Mai
>            Assignee: Rakesh R
>         Attachments: HDFS-6564-01.patch
>
>
> hdfs-client should depends on slf4j instead of common-logging.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to