Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3A0EB200BE0 for ; Sat, 3 Dec 2016 01:54:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 38A64160B29; Sat, 3 Dec 2016 00:54:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 81981160B24 for ; Sat, 3 Dec 2016 01:53:59 +0100 (CET) Received: (qmail 13285 invoked by uid 500); 3 Dec 2016 00:53:58 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 13254 invoked by uid 99); 3 Dec 2016 00:53:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Dec 2016 00:53:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7B1212C2A67 for ; Sat, 3 Dec 2016 00:53:58 +0000 (UTC) Date: Sat, 3 Dec 2016 00:53:58 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-8971) Remove guards when calling LOG.debug() and LOG.trace() in client package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 03 Dec 2016 00:54:00 -0000 [ https://issues.apache.org/jira/browse/HDFS-8971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15717023#comment-15717023 ] ASF GitHub Bot commented on HDFS-8971: -------------------------------------- Github user liuml07 commented on the issue: https://github.com/apache/hadoop/pull/46 Can you create a JIRA on https://issues.apache.org/jira/browse/HDFS and change the title of this PR to link the JIRA here? See https://wiki.apache.org/hadoop/GithubIntegration for more information. For the code, the DataNode logging has switched to slf4j. Please use placeholders and guard statement like `if (LOG.isTraceEnabled())` is unnecessary. Please refer to https://issues.apache.org/jira/browse/HDFS-8971 for examples. > Remove guards when calling LOG.debug() and LOG.trace() in client package > ------------------------------------------------------------------------ > > Key: HDFS-8971 > URL: https://issues.apache.org/jira/browse/HDFS-8971 > Project: Hadoop HDFS > Issue Type: Sub-task > Components: build > Reporter: Mingliang Liu > Assignee: Mingliang Liu > Fix For: 2.8.0, 3.0.0-alpha1 > > Attachments: HDFS-8971.000.patch, HDFS-8971.001.patch > > > We moved the {{shortcircuit}} package from {{hadoop-hdfs}} to {{hadoop-hdfs-client}} module in JIRA [HDFS-8934|https://issues.apache.org/jira/browse/HDFS-8934] and [HDFS-8951|https://issues.apache.org/jira/browse/HDFS-8951], and {{BlockReader}} in [HDFS-8925|https://issues.apache.org/jira/browse/HDFS-8925]. Meanwhile, we also replaced the _log4j_ log with _slf4j_ logger. There were existing code in the client package to guard the log when calling {{LOG.debug()}} and {{LOG.trace()}}, e.g. in {{ShortCircuitCache.java}}, we have code like this: > {code:title=Trace with guards|borderStyle=solid} > 724 if (LOG.isTraceEnabled()) { > 725 LOG.trace(this + ": found waitable for " + key); > 726 } > {code} > In _slf4j_, this kind of guard is not necessary. We should clean the code by removing the guard from the client package. > {code:title=Trace without guards|borderStyle=solid} > 724 LOG.trace("{}: found waitable for {}", this, key); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org