hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhr...@apache.org
Subject svn commit: r627942 - /hadoop/core/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java
Date Fri, 15 Feb 2008 04:40:21 GMT
Author: dhruba
Date: Thu Feb 14 20:40:15 2008
New Revision: 627942

URL: http://svn.apache.org/viewvc?rev=627942&view=rev
Log:
HADOOP-2832. Remove tabs from code of DFSClient for better
indentation. (dhruba)

Modified:
    hadoop/core/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java

Modified: hadoop/core/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java?rev=627942&r1=627941&r2=627942&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java Thu Feb 14 20:40:15 2008
@@ -1721,67 +1721,66 @@
         while (!closed && clientRunning && !lastPacketInBlock) {
           // process responses from datanodes.
           try {
-              // verify seqno from datanode
-              int numTargets = -1;
-              long seqno = blockReplyStream.readLong();
-              LOG.debug("DFSClient received ack for seqno " + seqno);
-              if (seqno == -1) {
-                continue;
-              } else if (seqno == -2) {
-                // no nothing
-              } else {
-                Packet one = null;
-                synchronized (ackQueue) {
-                  one = ackQueue.getFirst();
-                }
-                if (one.seqno != seqno) {
-                  throw new IOException("Responseprocessor: Expecting seqno " + 
-                                        " for block " + block +
-                                        one.seqno + " but received " + seqno);
-                }
-                lastPacketInBlock = one.lastPacketInBlock;
-              }
-
-              // processes response status from all datanodes.
-              for (int i = 0; i < targets.length && clientRunning; i++) {
-                short reply = blockReplyStream.readShort();
-                if (reply != OP_STATUS_SUCCESS) {
-                  errorIndex = i; // first bad datanode
-                  throw new IOException("Bad response " + reply +
-                                        " for block " + block +
-                                        " from datanode " + 
-                                        targets[i].getName());
-                }
-              }
-
+            // verify seqno from datanode
+            long seqno = blockReplyStream.readLong();
+            LOG.debug("DFSClient received ack for seqno " + seqno);
+            if (seqno == -1) {
+              continue;
+            } else if (seqno == -2) {
+              // no nothing
+            } else {
+              Packet one = null;
               synchronized (ackQueue) {
-                ackQueue.removeFirst();
-                ackQueue.notifyAll();
+                one = ackQueue.getFirst();
               }
-            } catch (Exception e) {
-              if (!closed) {
-                hasError = true;
-                LOG.warn("DFSOutputStream ResponseProcessor exception " + 
-                         " for block " + block +
-                          StringUtils.stringifyException(e));
-                closed = true;
+              if (one.seqno != seqno) {
+                throw new IOException("Responseprocessor: Expecting seqno " + 
+                                      " for block " + block +
+                                      one.seqno + " but received " + seqno);
               }
+              lastPacketInBlock = one.lastPacketInBlock;
             }
 
-            synchronized (dataQueue) {
-              dataQueue.notifyAll();
+            // processes response status from all datanodes.
+            for (int i = 0; i < targets.length && clientRunning; i++) {
+              short reply = blockReplyStream.readShort();
+              if (reply != OP_STATUS_SUCCESS) {
+                errorIndex = i; // first bad datanode
+                throw new IOException("Bad response " + reply +
+                                      " for block " + block +
+                                      " from datanode " + 
+                                      targets[i].getName());
+              }
             }
+
             synchronized (ackQueue) {
+              ackQueue.removeFirst();
               ackQueue.notifyAll();
             }
+          } catch (Exception e) {
+            if (!closed) {
+              hasError = true;
+              LOG.warn("DFSOutputStream ResponseProcessor exception " + 
+                       " for block " + block +
+                        StringUtils.stringifyException(e));
+              closed = true;
+            }
           }
-        }
 
-        void close() {
-          closed = true;
-          this.interrupt();
+          synchronized (dataQueue) {
+            dataQueue.notifyAll();
+          }
+          synchronized (ackQueue) {
+            ackQueue.notifyAll();
+          }
         }
       }
+
+      void close() {
+        closed = true;
+        this.interrupt();
+      }
+    }
 
     // If this stream has encountered any errors so far, shutdown 
     // threads and mark stream as closed.



Mime
View raw message