hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject [09/50] [abbrv] hadoop git commit: HDFS-8484. Erasure coding: Two contiguous blocks occupy IDs belong to same striped group. Contributed by Walter Su.
Date Thu, 20 Aug 2015 06:27:33 GMT
HDFS-8484. Erasure coding: Two contiguous blocks occupy IDs belong to same striped group. Contributed
by Walter Su.


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

Branch: refs/heads/HDFS-7285-merge
Commit: e692c7dd92c0d0fef50ce08edd972000151a9fe4
Parents: 2470a7b
Author: Jing Zhao <jing9@apache.org>
Authored: Thu Jul 9 14:07:37 2015 -0700
Committer: Jing Zhao <jing9@apache.org>
Committed: Thu Jul 9 14:07:37 2015 -0700

----------------------------------------------------------------------
 .../hadoop-hdfs/CHANGES-HDFS-EC-7285.txt        |  3 +++
 .../server/blockmanagement/BlockManager.java    | 20 +++++++++++---------
 2 files changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e692c7dd/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt
index 7db7f15..90f6732 100755
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt
@@ -338,3 +338,6 @@
 
     HDFS-8563. Erasure Coding: fsck handles file smaller than a full stripe.
     (Walter Su via jing9)
+
+    HDFS-8484. Erasure coding: Two contiguous blocks occupy IDs belong to same
+    striped group. (Walter Su via jing9)

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e692c7dd/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
index c98bdb0..968dc0c 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
@@ -3690,17 +3690,19 @@ public class BlockManager {
   }
 
   public BlockInfo getStoredBlock(Block block) {
-    BlockInfo info = null;
-    if (BlockIdManager.isStripedBlockID(block.getBlockId())) {
-      info = blocksMap.getStoredBlock(
+    if (!BlockIdManager.isStripedBlockID(block.getBlockId())) {
+      return blocksMap.getStoredBlock(block);
+    }
+    if (!hasNonEcBlockUsingStripedID) {
+      return blocksMap.getStoredBlock(
           new Block(BlockIdManager.convertToStripedID(block.getBlockId())));
-      if ((info == null) && hasNonEcBlockUsingStripedID){
-        info = blocksMap.getStoredBlock(block);
-      }
-    } else {
-      info = blocksMap.getStoredBlock(block);
     }
-    return info;
+    BlockInfo info = blocksMap.getStoredBlock(block);
+    if (info != null) {
+      return info;
+    }
+    return blocksMap.getStoredBlock(
+        new Block(BlockIdManager.convertToStripedID(block.getBlockId())));
   }
 
   /** updates a block in under replication queue */


Mime
View raw message