[21/50] [abbrv] hadoop git commit: HDFS-8217. During block recovery for truncate Log new Block Id in case of copy-on-truncate is true. (Contributed by Vinayakumar B)

2015-04-27 Thread zjshen
HDFS-8217. During block recovery for truncate Log new Block Id in case of 
copy-on-truncate is true. (Contributed by Vinayakumar B)


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

Branch: refs/heads/YARN-2928
Commit: 80cedc09e503fb9c258bf70ffe23cceaf0bdaac6
Parents: b512bad
Author: Vinayakumar B vinayakum...@apache.org
Authored: Fri Apr 24 12:16:41 2015 +0530
Committer: Zhijie Shen zjs...@apache.org
Committed: Mon Apr 27 14:18:49 2015 -0700

--
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt |  3 +++
 .../apache/hadoop/hdfs/server/datanode/DataNode.java|  4 +++-
 .../hadoop/hdfs/server/namenode/FSNamesystem.java   | 12 +++-
 3 files changed, 13 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/80cedc09/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 b0a0a50..0e00025 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -545,6 +545,9 @@ Release 2.8.0 - UNRELEASED
 
 HDFS-7993. Provide each Replica details in fsck (J.Andreina via 
vinayakumarb)
 
+HDFS-8217. During block recovery for truncate Log new Block Id in case of
+copy-on-truncate is true. (vinayakumarb)
+
 Release 2.7.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/80cedc09/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
index e81da52..23ab43a 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
@@ -2840,7 +2840,9 @@ public class DataNode extends ReconfigurableBase
 
 LOG.info(who +  calls recoverBlock( + block
 + , targets=[ + Joiner.on(, ).join(targets) + ]
-+ , newGenerationStamp= + rb.getNewGenerationStamp() + ));
++ ((rb.getNewBlock() == null) ? , newGenerationStamp=
++ rb.getNewGenerationStamp() : , newBlock= + rb.getNewBlock())
++ ));
   }
 
   @Override // ClientDataNodeProtocol

http://git-wip-us.apache.org/repos/asf/hadoop/blob/80cedc09/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
index 3599fad..4477dc4 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
@@ -4229,6 +4229,8 @@ public class FSNamesystem implements Namesystem, 
FSNamesystemMBean,
 String src = ;
 waitForLoadingFSImage();
 writeLock();
+boolean copyTruncate = false;
+BlockInfoContiguousUnderConstruction truncatedBlock = null;
 try {
   checkOperation(OperationCategory.WRITE);
   // If a DN tries to commit to the standby, the recovery will
@@ -4285,11 +4287,10 @@ public class FSNamesystem implements Namesystem, 
FSNamesystemMBean,
 return;
   }
 
-  BlockInfoContiguousUnderConstruction truncatedBlock =
-  (BlockInfoContiguousUnderConstruction) iFile.getLastBlock();
+  truncatedBlock = (BlockInfoContiguousUnderConstruction) iFile
+  .getLastBlock();
   long recoveryId = truncatedBlock.getBlockRecoveryId();
-  boolean copyTruncate =
-  truncatedBlock.getBlockId() != storedBlock.getBlockId();
+  copyTruncate = truncatedBlock.getBlockId() != storedBlock.getBlockId();
   if(recoveryId != newgenerationstamp) {
 throw new IOException(The recovery id  + newgenerationstamp
   +  does not match current recovery id 
@@ -4382,7 +4383,8 @@ public class FSNamesystem implements Namesystem, 
FSNamesystemMBean,
 if (closeFile) {
   LOG.info(commitBlockSynchronization(oldBlock= + oldBlock
   + , file= 

hadoop git commit: HDFS-8217. During block recovery for truncate Log new Block Id in case of copy-on-truncate is true. (Contributed by Vinayakumar B)

2015-04-24 Thread vinayakumarb
Repository: hadoop
Updated Branches:
  refs/heads/trunk a8898445d - 262c1bc33


HDFS-8217. During block recovery for truncate Log new Block Id in case of 
copy-on-truncate is true. (Contributed by Vinayakumar B)


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

Branch: refs/heads/trunk
Commit: 262c1bc3398ce2ede03f9d86fc97c35ca7a8e9db
Parents: a889844
Author: Vinayakumar B vinayakum...@apache.org
Authored: Fri Apr 24 12:16:41 2015 +0530
Committer: Vinayakumar B vinayakum...@apache.org
Committed: Fri Apr 24 12:16:41 2015 +0530

--
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt |  3 +++
 .../apache/hadoop/hdfs/server/datanode/DataNode.java|  4 +++-
 .../hadoop/hdfs/server/namenode/FSNamesystem.java   | 12 +++-
 3 files changed, 13 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/262c1bc3/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 b0a0a50..0e00025 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -545,6 +545,9 @@ Release 2.8.0 - UNRELEASED
 
 HDFS-7993. Provide each Replica details in fsck (J.Andreina via 
vinayakumarb)
 
+HDFS-8217. During block recovery for truncate Log new Block Id in case of
+copy-on-truncate is true. (vinayakumarb)
+
 Release 2.7.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/262c1bc3/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
index e81da52..23ab43a 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
@@ -2840,7 +2840,9 @@ public class DataNode extends ReconfigurableBase
 
 LOG.info(who +  calls recoverBlock( + block
 + , targets=[ + Joiner.on(, ).join(targets) + ]
-+ , newGenerationStamp= + rb.getNewGenerationStamp() + ));
++ ((rb.getNewBlock() == null) ? , newGenerationStamp=
++ rb.getNewGenerationStamp() : , newBlock= + rb.getNewBlock())
++ ));
   }
 
   @Override // ClientDataNodeProtocol

http://git-wip-us.apache.org/repos/asf/hadoop/blob/262c1bc3/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
index 3599fad..4477dc4 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
@@ -4229,6 +4229,8 @@ public class FSNamesystem implements Namesystem, 
FSNamesystemMBean,
 String src = ;
 waitForLoadingFSImage();
 writeLock();
+boolean copyTruncate = false;
+BlockInfoContiguousUnderConstruction truncatedBlock = null;
 try {
   checkOperation(OperationCategory.WRITE);
   // If a DN tries to commit to the standby, the recovery will
@@ -4285,11 +4287,10 @@ public class FSNamesystem implements Namesystem, 
FSNamesystemMBean,
 return;
   }
 
-  BlockInfoContiguousUnderConstruction truncatedBlock =
-  (BlockInfoContiguousUnderConstruction) iFile.getLastBlock();
+  truncatedBlock = (BlockInfoContiguousUnderConstruction) iFile
+  .getLastBlock();
   long recoveryId = truncatedBlock.getBlockRecoveryId();
-  boolean copyTruncate =
-  truncatedBlock.getBlockId() != storedBlock.getBlockId();
+  copyTruncate = truncatedBlock.getBlockId() != storedBlock.getBlockId();
   if(recoveryId != newgenerationstamp) {
 throw new IOException(The recovery id  + newgenerationstamp
   +  does not match current recovery id 
@@ -4382,7 +4383,8 @@ public class FSNamesystem implements Namesystem, 
FSNamesystemMBean,
 if (closeFile) {
 

hadoop git commit: HDFS-8217. During block recovery for truncate Log new Block Id in case of copy-on-truncate is true. (Contributed by Vinayakumar B)

2015-04-24 Thread vinayakumarb
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 3d0385c3c - 68063cac3


HDFS-8217. During block recovery for truncate Log new Block Id in case of 
copy-on-truncate is true. (Contributed by Vinayakumar B)

(cherry picked from commit 262c1bc3398ce2ede03f9d86fc97c35ca7a8e9db)


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

Branch: refs/heads/branch-2
Commit: 68063cac3e701d84217cfae8d15ed214af398803
Parents: 3d0385c
Author: Vinayakumar B vinayakum...@apache.org
Authored: Fri Apr 24 12:16:41 2015 +0530
Committer: Vinayakumar B vinayakum...@apache.org
Committed: Fri Apr 24 12:18:04 2015 +0530

--
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt |  3 +++
 .../apache/hadoop/hdfs/server/datanode/DataNode.java|  4 +++-
 .../hadoop/hdfs/server/namenode/FSNamesystem.java   | 12 +++-
 3 files changed, 13 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/68063cac/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 b3b0607..913040f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -227,6 +227,9 @@ Release 2.8.0 - UNRELEASED
 
 HDFS-7993. Provide each Replica details in fsck (J.Andreina via 
vinayakumarb)
 
+HDFS-8217. During block recovery for truncate Log new Block Id in case of
+copy-on-truncate is true. (vinayakumarb)
+
 Release 2.7.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/68063cac/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
index a13a31f..ba02be2 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
@@ -2847,7 +2847,9 @@ public class DataNode extends ReconfigurableBase
 
 LOG.info(who +  calls recoverBlock( + block
 + , targets=[ + Joiner.on(, ).join(targets) + ]
-+ , newGenerationStamp= + rb.getNewGenerationStamp() + ));
++ ((rb.getNewBlock() == null) ? , newGenerationStamp=
++ rb.getNewGenerationStamp() : , newBlock= + rb.getNewBlock())
++ ));
   }
 
   @Override // ClientDataNodeProtocol

http://git-wip-us.apache.org/repos/asf/hadoop/blob/68063cac/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
index 4249fec..f175301 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
@@ -4225,6 +4225,8 @@ public class FSNamesystem implements Namesystem, 
FSNamesystemMBean,
 String src = ;
 waitForLoadingFSImage();
 writeLock();
+boolean copyTruncate = false;
+BlockInfoContiguousUnderConstruction truncatedBlock = null;
 try {
   checkOperation(OperationCategory.WRITE);
   // If a DN tries to commit to the standby, the recovery will
@@ -4281,11 +4283,10 @@ public class FSNamesystem implements Namesystem, 
FSNamesystemMBean,
 return;
   }
 
-  BlockInfoContiguousUnderConstruction truncatedBlock =
-  (BlockInfoContiguousUnderConstruction) iFile.getLastBlock();
+  truncatedBlock = (BlockInfoContiguousUnderConstruction) iFile
+  .getLastBlock();
   long recoveryId = truncatedBlock.getBlockRecoveryId();
-  boolean copyTruncate =
-  truncatedBlock.getBlockId() != storedBlock.getBlockId();
+  copyTruncate = truncatedBlock.getBlockId() != storedBlock.getBlockId();
   if(recoveryId != newgenerationstamp) {
 throw new IOException(The recovery id  + newgenerationstamp
   +  does not match current recovery id 
@@ -4378,7 +4379,8 @@ public class