hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szets...@apache.org
Subject hadoop git commit: HDFS-11947. When constructing a thread name, BPOfferService may print a bogus warning message. Contributed by Weiwei Yang
Date Tue, 13 Jun 2017 01:54:49 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 eda4bf519 -> 670224ae5


HDFS-11947. When constructing a thread name, BPOfferService may print a bogus warning message.
Contributed by Weiwei Yang


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

Branch: refs/heads/branch-2
Commit: 670224ae59f69bb2fdc7b988bf6641dd95958e5a
Parents: eda4bf5
Author: Tsz-Wo Nicholas Sze <szetszwo@hortonworks.com>
Authored: Tue Jun 13 09:45:10 2017 +0800
Committer: Tsz-Wo Nicholas Sze <szetszwo@hortonworks.com>
Committed: Tue Jun 13 09:47:14 2017 +0800

----------------------------------------------------------------------
 .../hadoop/hdfs/server/datanode/BPOfferService.java     | 12 +++++++++---
 .../hadoop/hdfs/server/datanode/BPServiceActor.java     |  4 ++--
 2 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/670224ae/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPOfferService.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPOfferService.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPOfferService.java
index 5466f1f..ccc39a6 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPOfferService.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPOfferService.java
@@ -181,14 +181,16 @@ class BPOfferService {
     return nameserviceId;
   }
 
-  String getBlockPoolId() {
+  String getBlockPoolId(boolean quiet) {
     readLock();
     try {
       if (bpNSInfo != null) {
         return bpNSInfo.getBlockPoolID();
       } else {
-        LOG.warn("Block pool ID needed, but service not yet registered with " +
-                "NN, trace:", new Exception());
+        if (!quiet) {
+          LOG.warn("Block pool ID needed, but service not yet registered with "
+              + "NN, trace:", new Exception());
+        }
         return null;
       }
     } finally {
@@ -196,6 +198,10 @@ class BPOfferService {
     }
   }
 
+  String getBlockPoolId() {
+    return getBlockPoolId(false);
+  }
+
   boolean hasBlockPoolId() {
     return getNamespaceInfo() != null;
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/670224ae/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
index aedfc70..c260272 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
@@ -553,8 +553,8 @@ class BPServiceActor implements Runnable {
   private String formatThreadName(
       final String action,
       final InetSocketAddress addr) {
-    final String prefix = bpos.getBlockPoolId() != null ? bpos.getBlockPoolId()
-        : bpos.getNameserviceId();
+    String bpId = bpos.getBlockPoolId(true);
+    final String prefix = bpId != null ? bpId : bpos.getNameserviceId();
     return prefix + " " + action + " to " + addr;
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message