You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/08/14 17:04:15 UTC

[GitHub] [hadoop] jojochuang commented on a change in pull request #1252: HDFS-14678. Allow triggerBlockReport to a specific namenode.

jojochuang commented on a change in pull request #1252: HDFS-14678. Allow triggerBlockReport to a specific namenode.
URL: https://github.com/apache/hadoop/pull/1252#discussion_r313981645
 
 

 ##########
 File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
 ##########
 @@ -3311,10 +3311,13 @@ public ReconfigurationTaskStatus getReconfigurationStatus() throws IOException {
   public void triggerBlockReport(BlockReportOptions options)
       throws IOException {
     checkSuperuserPrivilege();
+    InetSocketAddress namenodeAddr = options.getNamenodeAddr();
     for (BPOfferService bpos : blockPoolManager.getAllNamenodeThreads()) {
       if (bpos != null) {
         for (BPServiceActor actor : bpos.getBPServiceActors()) {
-          actor.triggerBlockReport(options);
+          if (namenodeAddr == null || namenodeAddr.equals(actor.nnAddr)) {
 
 Review comment:
   Can we make this condition more readable? 
   Like create a boolean shouldTriggerBlockReportForAllNameNodes = (namenodeAddr == null)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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