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:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to