hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hair...@apache.org
Subject svn commit: r752617 - in /hadoop/core/branches/branch-0.19: ./ CHANGES.txt src/test/org/apache/hadoop/hdfs/TestInjectionForSimulatedStorage.java src/test/org/apache/hadoop/hdfs/server/datanode/SimulatedFSDataset.java
Date Wed, 11 Mar 2009 21:05:24 GMT
Author: hairong
Date: Wed Mar 11 21:05:24 2009
New Revision: 752617

URL: http://svn.apache.org/viewvc?rev=752617&view=rev
Log:
Merge -r 752608:752609 to move the change of HADOOP-5412 from main to branch 0.19.

Modified:
    hadoop/core/branches/branch-0.19/   (props changed)
    hadoop/core/branches/branch-0.19/CHANGES.txt   (contents, props changed)
    hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/TestInjectionForSimulatedStorage.java
    hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/server/datanode/SimulatedFSDataset.java

Propchange: hadoop/core/branches/branch-0.19/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Mar 11 21:05:24 2009
@@ -1 +1 @@
-/hadoop/core/trunk:697306,698176,699056,699098,699415,699424,699444,699490,699517,700163,700628,700923,701273,701398,703923,704203,704261,704701,704703,704707,704712,704732,704748,704989,705391,705420,705430,705762,706350,706707,706719,706796,706802,707258,707262,708623,708641,708710,709040,709303,712881,713888,720602,723013,723460,723831,723918,724883,727117,727212,727217,727228,727869,732572,732777,733887,734870,736426,738697,740077,741703,741762,743745,743892,745180,746902-746903,752073
+/hadoop/core/trunk:697306,698176,699056,699098,699415,699424,699444,699490,699517,700163,700628,700923,701273,701398,703923,704203,704261,704701,704703,704707,704712,704732,704748,704989,705391,705420,705430,705762,706350,706707,706719,706796,706802,707258,707262,708623,708641,708710,709040,709303,712881,713888,720602,723013,723460,723831,723918,724883,727117,727212,727217,727228,727869,732572,732777,733887,734870,736426,738697,740077,741703,741762,743745,743892,745180,746902-746903,752073,752609

Modified: hadoop/core/branches/branch-0.19/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/CHANGES.txt?rev=752617&r1=752616&r2=752617&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.19/CHANGES.txt Wed Mar 11 21:05:24 2009
@@ -1162,6 +1162,9 @@
     HADOOP-5134. FSNamesystem#commitBlockSynchronization adds under-construction
     block locations to blocksMap. (Dhruba Borthakur via hairong)
 
+    HADOOP-5412. Simulated DataNode should not write to a block that's being
+    written by another thread. (hairong)
+
 Release 0.18.3 - 2009-01-27
 
   IMPROVEMENTS

Propchange: hadoop/core/branches/branch-0.19/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Mar 11 21:05:24 2009
@@ -1,3 +1,3 @@
 /hadoop/core/branches/branch-0.18/CHANGES.txt:727226
 /hadoop/core/branches/branch-0.20/CHANGES.txt:752591
-/hadoop/core/trunk/CHANGES.txt:697306,698176,699056,699098,699415,699424,699444,699490,699517,700163,700628,700923,701273,701398,703923,704203,704261,704701,704703,704707,704712,704732,704748,704989,705391,705420,705430,705762,706350,706707,706719,706796,706802,707258,707262,708623,708641,708710,708723,709040,709303,711717,712881,713888,720602,723013,723460,723831,723918,724883,727117,727212,727217,727228,727869,732572,732777,733887,734870,735082,736426,738697,740077,741703,741762,743296,743745,743892,745180,746902-746903,752073,752590
+/hadoop/core/trunk/CHANGES.txt:697306,698176,699056,699098,699415,699424,699444,699490,699517,700163,700628,700923,701273,701398,703923,704203,704261,704701,704703,704707,704712,704732,704748,704989,705391,705420,705430,705762,706350,706707,706719,706796,706802,707258,707262,708623,708641,708710,708723,709040,709303,711717,712881,713888,720602,723013,723460,723831,723918,724883,727117,727212,727217,727228,727869,732572,732777,733887,734870,735082,736426,738697,740077,741703,741762,743296,743745,743892,745180,746902-746903,752073,752590,752609

Modified: hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/TestInjectionForSimulatedStorage.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/TestInjectionForSimulatedStorage.java?rev=752617&r1=752616&r2=752617&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/TestInjectionForSimulatedStorage.java
(original)
+++ hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/TestInjectionForSimulatedStorage.java
Wed Mar 11 21:05:24 2009
@@ -171,7 +171,7 @@
       
       cluster = new MiniDFSCluster(0, conf, numDataNodes*2, false,
                                    true, null, null);
-      
+      cluster.waitActive();
       Set<Block> uniqueBlocks = new HashSet<Block>();
       for (int i=0; i<blocksList.length; ++i) {
         for (int j=0; j < blocksList[i].length; ++j) {

Modified: hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/server/datanode/SimulatedFSDataset.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/server/datanode/SimulatedFSDataset.java?rev=752617&r1=752616&r2=752617&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/server/datanode/SimulatedFSDataset.java
(original)
+++ hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/server/datanode/SimulatedFSDataset.java
Wed Mar 11 21:05:24 2009
@@ -275,7 +275,9 @@
   }
 
   public synchronized void unfinalizeBlock(Block b) throws IOException {
-    blockMap.remove(b);
+    if (isBeingWritten(b)) {
+      blockMap.remove(b);
+    }
   }
 
   public synchronized Block[] getBlockReport() {
@@ -365,6 +367,15 @@
     return binfo.isFinalized();
   }
 
+  /* check if a block is created but not finalized */
+  private synchronized boolean isBeingWritten(Block b) {
+    BInfo binfo = blockMap.get(b);
+    if (binfo == null) {
+      return false;
+    }
+    return !binfo.isFinalized();  
+  }
+  
   public String toString() {
     return getStorageInfo();
   }
@@ -376,6 +387,10 @@
           throw new BlockAlreadyExistsException("Block " + b + 
               " is valid, and cannot be written to.");
       }
+    if (isBeingWritten(b)) {
+        throw new BlockAlreadyExistsException("Block " + b + 
+            " is being written, and cannot be written to.");
+    }
       BInfo binfo = new BInfo(b, true);
       blockMap.put(b, binfo);
       SimulatedOutputStream crcStream = new SimulatedOutputStream();



Mime
View raw message