hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hair...@apache.org
Subject svn commit: r753367 - in /hadoop/core/branches/branch-0.18: ./ CHANGES.txt src/hdfs/org/apache/hadoop/dfs/DataNode.java
Date Fri, 13 Mar 2009 19:54:56 GMT
Author: hairong
Date: Fri Mar 13 19:54:53 2009
New Revision: 753367

URL: http://svn.apache.org/viewvc?rev=753367&view=rev
Log:
Merge -r 753345:753346 to move the change of HADOOP-5465 from trunk to branch 0.18.

Modified:
    hadoop/core/branches/branch-0.18/   (props changed)
    hadoop/core/branches/branch-0.18/CHANGES.txt   (contents, props changed)
    hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/DataNode.java

Propchange: hadoop/core/branches/branch-0.18/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar 13 19:54:53 2009
@@ -1,2 +1,2 @@
 /hadoop/core/branches/branch-0.19:704733
-/hadoop/core/trunk:699517,700163,704701,704732,705420,705430,707258,709040,720602,723460,723831,723918,743892
+/hadoop/core/trunk:699517,700163,704701,704732,705420,705430,707258,709040,720602,723460,723831,723918,743892,753346

Modified: hadoop/core/branches/branch-0.18/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/CHANGES.txt?rev=753367&r1=753366&r2=753367&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.18/CHANGES.txt Fri Mar 13 19:54:53 2009
@@ -16,6 +16,10 @@
     HADOOP-5412. Simulated DataNode should not write to a block that's being
     written by another thread. (hairong)
 
+    HADOOP-5414. Fix the problem of blocks remaining under-replicated by
+    providing synchronized modification to the counter xmitsInProgress in
+    DataNode. (hairong)
+
 Release 0.18.3 - 2009-01-27
 
   IMPROVEMENTS

Propchange: hadoop/core/branches/branch-0.18/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar 13 19:54:53 2009
@@ -1 +1 @@
-/hadoop/core/trunk/CHANGES.txt:699517,700163,700923,704701,705420,705430,707258,709040,720602,723460,723831,723918,732572,741703,743892
+/hadoop/core/trunk/CHANGES.txt:699517,700163,700923,704701,705420,705430,707258,709040,720602,723460,723831,723918,732572,741703,743892,753346

Modified: hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/DataNode.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/DataNode.java?rev=753367&r1=753366&r2=753367&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/DataNode.java (original)
+++ hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/DataNode.java Fri Mar
13 19:54:53 2009
@@ -45,6 +45,7 @@
 import java.nio.channels.ServerSocketChannel;
 import java.nio.channels.SocketChannel;
 import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.Semaphore;
 import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
@@ -108,7 +109,7 @@
   private LinkedList<Block> receivedBlockList = new LinkedList<Block>();
   private LinkedList<String> delHints = new LinkedList<String>();
   final static String EMPTY_DEL_HINT = "";
-  int xmitsInProgress = 0;
+  AtomicInteger xmitsInProgress = new AtomicInteger();
   Daemon dataXceiveServer = null;
   ThreadGroup threadGroup = null;
   long blockReportInterval;
@@ -694,7 +695,7 @@
                                                        data.getCapacity(),
                                                        data.getDfsUsed(),
                                                        data.getRemaining(),
-                                                       xmitsInProgress,
+                                                       xmitsInProgress.get(),
                                                        getXceiverCount());
           myMetrics.heartbeats.inc(now() - startTime);
           //LOG.info("Just sent heartbeat, with name " + localName);
@@ -2897,7 +2898,7 @@
      * Do the deed, write the bytes
      */
     public void run() {
-      xmitsInProgress++;
+      xmitsInProgress.getAndIncrement();
       Socket sock = null;
       DataOutputStream out = null;
       BlockSender blockSender = null;
@@ -2945,10 +2946,10 @@
         LOG.warn(dnRegistration + ":Failed to transfer " + b + " to " + targets[0].getName()
             + " got " + StringUtils.stringifyException(ie));
       } finally {
+        xmitsInProgress.getAndDecrement();
         IOUtils.closeStream(blockSender);
         IOUtils.closeStream(out);
         IOUtils.closeSocket(sock);
-        xmitsInProgress--;
       }
     }
   }
@@ -3078,7 +3079,7 @@
       "data=" + data +
       ", localName='" + dnRegistration.getName() + "'" +
       ", storageID='" + dnRegistration.getStorageID() + "'" +
-      ", xmitsInProgress=" + xmitsInProgress +
+      ", xmitsInProgress=" + xmitsInProgress.get() +
       "}";
   }
   



Mime
View raw message