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 02:02:20 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8.2 889ff2e6f -> f8737937a


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/f8737937
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/f8737937
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/f8737937

Branch: refs/heads/branch-2.8.2
Commit: f8737937a359a6912fb9ff034ca1137096f6cfac
Parents: 889ff2e
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 10:02:12 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/f8737937/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/f8737937/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 297a4a7..f83a295 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
@@ -490,8 +490,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