You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by so...@apache.org on 2021/12/21 12:14:52 UTC
[hadoop] branch branch-3.2 updated: HDFS-16391. Avoid evaluation of LOG.debug statement in NameNodeHeartbeatService (#3820)
This is an automated email from the ASF dual-hosted git repository.
sodonnell pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.2 by this push:
new c66bae3 HDFS-16391. Avoid evaluation of LOG.debug statement in NameNodeHeartbeatService (#3820)
c66bae3 is described below
commit c66bae3fc3bdcd550dd0ee5370c8a5a8f8bd8ac6
Author: wangzhaohui <32...@users.noreply.github.com>
AuthorDate: Tue Dec 21 19:28:57 2021 +0800
HDFS-16391. Avoid evaluation of LOG.debug statement in NameNodeHeartbeatService (#3820)
(cherry picked from commit 8d251bd629c2db33f03c80e93c7e54fceedbfbe6)
---
.../server/federation/router/NamenodeHeartbeatService.java | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/NamenodeHeartbeatService.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/NamenodeHeartbeatService.java
index a1adf77..455dfcd 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/NamenodeHeartbeatService.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/NamenodeHeartbeatService.java
@@ -208,12 +208,16 @@ public class NamenodeHeartbeatService extends PeriodicService {
LOG.error("Namenode is not operational: {}", getNamenodeDesc());
} else if (report.haStateValid()) {
// block and HA status available
- LOG.debug("Received service state: {} from HA namenode: {}",
- report.getState(), getNamenodeDesc());
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Received service state: {} from HA namenode: {}",
+ report.getState(), getNamenodeDesc());
+ }
} else if (localTarget == null) {
// block info available, HA status not expected
- LOG.debug(
- "Reporting non-HA namenode as operational: " + getNamenodeDesc());
+ if (LOG.isDebugEnabled()) {
+ LOG.debug(
+ "Reporting non-HA namenode as operational: {}", getNamenodeDesc());
+ }
} else {
// block info available, HA status should be available, but was not
// fetched do nothing and let the current state stand
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org