[jira] [Updated] (HDFS-8971) Remove guards when calling LOG.debug() and LOG.trace() in client package
[ https://issues.apache.org/jira/browse/HDFS-8971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mingliang Liu updated HDFS-8971: Attachment: HDFS-8971.001.patch The v1 patch addresses the whitespace and checkstyle warnings. Some existing (and independent) warning can be addressed separately as they are not related to this issue. > 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 > 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} > 724if (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} > 724LOG.trace("{}: found waitable for {}", this, key); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-8971) Remove guards when calling LOG.debug() and LOG.trace() in client package
[ https://issues.apache.org/jira/browse/HDFS-8971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Haohui Mai updated HDFS-8971: - Resolution: Fixed Fix Version/s: 2.8.0 Status: Resolved (was: Patch Available) I've committed the patch to trunk and branch-2. Thanks [~liuml07] for the contribution. > 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 > > 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} > 724if (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} > 724LOG.trace("{}: found waitable for {}", this, key); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-8971) Remove guards when calling LOG.debug() and LOG.trace() in client package
[ https://issues.apache.org/jira/browse/HDFS-8971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mingliang Liu updated HDFS-8971: Attachment: HDFS-8971.000.patch The v0 patch removes the guards when calling {{LOG.trace}} and {{LOG.debug}} for the slf4j logger, and uses placeholders for passing parameters. The code to change was found by script: {code} find hadoop-hdfs-project/hadoop-hdfs-client -name "*.java" |xargs egrep "LOG.isTraceEnabled|LOG.isDebugEnabled" -n {code} Some of the existing usage of the {{is\{Trace,Debug\}Enabled}} was not removed because it's necessary, largely because of the overhead of calculating the parameters. Those excluded guards are for {{Arrays.asList()}}, {{StringUtils.getStackTrace(Thread.currentThread()))}} and user-defined methods. For example, {code:title=LeaseRenewer.java} if (LOG.isDebugEnabled()) { LOG.debug("Lease renewer daemon for " + clientsString() + " with renew id " + id + " exited"); } /** Get the names of all clients */ private synchronized String clientsString() { if (dfsclients.isEmpty()) { return "[]"; } else { final StringBuilder b = new StringBuilder("[").append( dfsclients.get(0).getClientName()); for(int i = 1; i < dfsclients.size(); i++) { b.append(", ").append(dfsclients.get(i).getClientName()); } return b.append("]").toString(); } } {code} The {{clientString()}} is considered time-consuming and we should not simply remove the guard when calling the {{LOG.isDebugEnabled()}}. > 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 > Attachments: HDFS-8971.000.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} > 724if (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} > 724LOG.trace("{}: found waitable for {}", this, key); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-8971) Remove guards when calling LOG.debug() and LOG.trace() in client package
[ https://issues.apache.org/jira/browse/HDFS-8971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mingliang Liu updated HDFS-8971: Status: Patch Available (was: Open) > 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 > Attachments: HDFS-8971.000.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} > 724if (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} > 724LOG.trace("{}: found waitable for {}", this, key); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-8971) Remove guards when calling LOG.debug() and LOG.trace() in client package
[ https://issues.apache.org/jira/browse/HDFS-8971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mingliang Liu updated HDFS-8971: Description: 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} 724if (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} 724LOG.trace("{}: found waitable for {}", this, key); {code} was: 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} 724if (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. > 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 > > 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} > 724if (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} > 724LOG.trace("{}: found waitable for {}", this, key); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-8971) Remove guards when calling LOG.debug() and LOG.trace() in client package
[ https://issues.apache.org/jira/browse/HDFS-8971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mingliang Liu updated HDFS-8971: Summary: Remove guards when calling LOG.debug() and LOG.trace() in client package (was: Remove guards when calling LOG.debug() and LOG.trace() in shortcircuit package) 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 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]. Meanwhile, we also replaced the _log4j_ log with _slf4j_ logger. There were existing code in the {{shortcircuit}} package to guard the log when calling {{LOG.debug()}} and {{LOG.trace()}}, e.g. in {{ShortCircuitCache.java}}, we have code like this: {code} 724if (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. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-8971) Remove guards when calling LOG.debug() and LOG.trace() in client package
[ https://issues.apache.org/jira/browse/HDFS-8971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mingliang Liu updated HDFS-8971: Description: 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} 724if (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. was: 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]. Meanwhile, we also replaced the _log4j_ log with _slf4j_ logger. There were existing code in the {{shortcircuit}} package to guard the log when calling {{LOG.debug()}} and {{LOG.trace()}}, e.g. in {{ShortCircuitCache.java}}, we have code like this: {code} 724if (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. 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 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} 724if (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. -- This message was sent by Atlassian JIRA (v6.3.4#6332)