Browse Source

HADOOP-2814. Fix for NPE in datanode in unit test TestDataTransferProtocol.
(Raghu Angadi via dhruba)



git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@627944 13f79535-47bb-0310-9956-ffa450edef68

Dhruba Borthakur 17 years ago
parent
commit
a9f25de2d5
2 changed files with 9 additions and 6 deletions
  1. 5 2
      CHANGES.txt
  2. 4 4
      src/java/org/apache/hadoop/dfs/DataNode.java

+ 5 - 2
CHANGES.txt

@@ -88,8 +88,11 @@ Release 0.16.1 - Unrelease
     HADOOP-2808. Minor fix to FileUtil::copy to mind the overwrite
     formal. (cdouglas)
 
-		HADOOP-2683. Moving UGI out of the RPC Server.
-		(Tsz Wo (Nicholas), SZE via shv)
+    HADOOP-2683. Moving UGI out of the RPC Server.
+    (Tsz Wo (Nicholas), SZE via shv)
+
+    HADOOP-2814. Fix for NPE in datanode in unit test TestDataTransferProtocol.
+    (Raghu Angadi via dhruba)
 
 Release 0.16.0 - 2008-02-07
 

+ 4 - 4
src/java/org/apache/hadoop/dfs/DataNode.java

@@ -1968,15 +1968,15 @@ public class DataNode implements FSConstants, Runnable {
         this.block = block;
         this.in = in;
         this.inAddr = inAddr;
-        this.checksum = DataChecksum.newDataChecksum(in);
-        this.bytesPerChecksum = checksum.getBytesPerChecksum();
-        this.checksumSize = checksum.getChecksumSize();
-        this.buf = new byte[bytesPerChecksum + checksumSize];
         this.isRecovery = isRecovery;
         this.clientName = clientName;
         this.offsetInBlock = 0;
         this.currentWriteLock = new Object();
         this.currentWrite = false;
+        this.checksum = DataChecksum.newDataChecksum(in);
+        this.bytesPerChecksum = checksum.getBytesPerChecksum();
+        this.checksumSize = checksum.getChecksumSize();
+        this.buf = new byte[bytesPerChecksum + checksumSize];
         //
         // Open local disk out
         //