hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kih...@apache.org
Subject git commit: HDFS-7217. Better batching of IBRs. Contributed by Kihwal Lee.
Date Thu, 09 Oct 2014 17:08:34 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 8d7c54967 -> db71bb54b


HDFS-7217. Better batching of IBRs. Contributed by Kihwal Lee.


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

Branch: refs/heads/trunk
Commit: db71bb54bcc75b71c5841b25ceb03fb0218c6d4f
Parents: 8d7c549
Author: Kihwal Lee <kihwal@apache.org>
Authored: Thu Oct 9 12:07:51 2014 -0500
Committer: Kihwal Lee <kihwal@apache.org>
Committed: Thu Oct 9 12:07:51 2014 -0500

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt               |  2 ++
 .../hadoop/hdfs/server/datanode/BPOfferService.java       |  4 ++--
 .../hadoop/hdfs/server/datanode/BPServiceActor.java       | 10 +++++++---
 .../hdfs/server/datanode/TestIncrementalBlockReports.java |  2 +-
 4 files changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/db71bb54/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index e2c278e..8fc4fc72 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -660,6 +660,8 @@ Release 2.6.0 - UNRELEASED
 
     HDFS-7169. Add SE_BAD_FIELD to findbugsExcludeFile.xml.  (szetszwo)
 
+    HDFS-7217. Better batching of IBRs. (kihwal)
+
   OPTIMIZATIONS
 
     HDFS-6690. Deduplicate xattr names in memory. (wang)

http://git-wip-us.apache.org/repos/asf/hadoop/blob/db71bb54/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 25e89ff..4a54bed 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
@@ -236,7 +236,7 @@ class BPOfferService {
         delHint);
 
     for (BPServiceActor actor : bpServices) {
-      actor.notifyNamenodeBlockImmediately(bInfo, storageUuid);
+      actor.notifyNamenodeBlock(bInfo, storageUuid, true);
     }
   }
 
@@ -264,7 +264,7 @@ class BPOfferService {
        block.getLocalBlock(), BlockStatus.RECEIVING_BLOCK, null);
     
     for (BPServiceActor actor : bpServices) {
-      actor.notifyNamenodeBlockImmediately(bInfo, storageUuid);
+      actor.notifyNamenodeBlock(bInfo, storageUuid, false);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/db71bb54/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 7d30688..2961698 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
@@ -368,13 +368,17 @@ class BPServiceActor implements Runnable {
    * till namenode is informed before responding with success to the
    * client? For now we don't.
    */
-  void notifyNamenodeBlockImmediately(
-      ReceivedDeletedBlockInfo bInfo, String storageUuid) {
+  void notifyNamenodeBlock(ReceivedDeletedBlockInfo bInfo,
+      String storageUuid, boolean now) {
     synchronized (pendingIncrementalBRperStorage) {
       addPendingReplicationBlockInfo(
           bInfo, dn.getFSDataset().getStorage(storageUuid));
       sendImmediateIBR = true;
-      pendingIncrementalBRperStorage.notifyAll();
+      // If now is true, the report is sent right away.
+      // Otherwise, it will be sent out in the next heartbeat.
+      if (now) {
+        pendingIncrementalBRperStorage.notifyAll();
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/db71bb54/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestIncrementalBlockReports.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestIncrementalBlockReports.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestIncrementalBlockReports.java
index 81dc13c..b5aa93f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestIncrementalBlockReports.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestIncrementalBlockReports.java
@@ -84,7 +84,7 @@ public class TestIncrementalBlockReports {
   private void injectBlockReceived() {
     ReceivedDeletedBlockInfo rdbi = new ReceivedDeletedBlockInfo(
         getDummyBlock(), BlockStatus.RECEIVED_BLOCK, null);
-    actor.notifyNamenodeBlockImmediately(rdbi, storageUuid);
+    actor.notifyNamenodeBlock(rdbi, storageUuid, true);
   }
 
   /**


Mime
View raw message