hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rang...@apache.org
Subject svn commit: r708723 - in /hadoop/core/trunk: CHANGES.txt src/hdfs/org/apache/hadoop/hdfs/DFSClient.java
Date Tue, 28 Oct 2008 23:31:34 GMT
Author: rangadi
Date: Tue Oct 28 16:31:33 2008
New Revision: 708723

URL: http://svn.apache.org/viewvc?rev=708723&view=rev
Log:
HADOOP-4499. DFSClient should invoke checksumOk only once. (Raghu Angadi)

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=708723&r1=708722&r2=708723&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Tue Oct 28 16:31:33 2008
@@ -1042,6 +1042,8 @@
     HADOOP-4525. Fix ipc.server.ipcnodelay originally missed in in HADOOP-2232.
     (cdouglas via Clint Morgan)
 
+    HADOOP-4499. DFSClient should invoke checksumOk only once. (Raghu Angadi)
+
 Release 0.18.2 - Unreleased
 
   BUG FIXES

Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java?rev=708723&r1=708722&r2=708723&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java (original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java Tue Oct 28 16:31:33 2008
@@ -1024,7 +1024,6 @@
     private int bytesPerChecksum;
     private int checksumSize;
     private boolean gotEOS = false;
-    private boolean sentChecksumOk = false;
     
     byte[] skipBuf = null;
     ByteBuffer checksumBytes = null;
@@ -1057,17 +1056,13 @@
         }
       }
       
+      boolean eosBefore = gotEOS;
       int nRead = super.read(buf, off, len);
-      if (nRead >= 0 && gotEOS && needChecksum()) {
-        if (sentChecksumOk) {
-           // this should not happen; log the error for the debugging purpose
-           LOG.info(StringUtils.stringifyException(new IOException(
-             "Checksum ok was sent and should not be sent again")));  
-        } else {
-          //checksum is verified and there are no errors.
-          checksumOk(dnSock);
-          sentChecksumOk = true;
-       }
+      
+      // if gotEOS was set in the previous read and checksum is enabled :
+      if (gotEOS && !eosBefore && nRead >= 0 && needChecksum())
{
+        //checksum is verified and there are no errors.
+        checksumOk(dnSock);
       }
       return nRead;
     }



Mime
View raw message