hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r430085 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/DataNode.java src/java/org/apache/hadoop/dfs/FSDataset.java src/java/org/apache/hadoop/util/DiskChecker.java
Date Wed, 09 Aug 2006 16:26:02 GMT
Author: cutting
Date: Wed Aug  9 09:25:58 2006
New Revision: 430085

URL: http://svn.apache.org/viewvc?rev=430085&view=rev
Log:
HADOOP-324.  Fix datanode to not exit when a disk is full, but simply to fail writes.  Contributed
by Wendy Chien.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DataNode.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/util/DiskChecker.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?rev=430085&r1=430084&r2=430085&view=diff
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Wed Aug  9 09:25:58 2006
@@ -16,6 +16,9 @@
     available).  Also, tasks are better load-balanced among nodes.
     (omalley via cutting)
 
+ 4. HADOOP-324.  Fix datanode to not exit when a disk is full, but
+    rather simply to fail writes.  (Wendy Chien via cutting)
+
 
 Release 0.5.0 - 2006-08-04
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DataNode.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DataNode.java?rev=430085&r1=430084&r2=430085&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DataNode.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DataNode.java Wed Aug  9 09:25:58 2006
@@ -22,6 +22,7 @@
 import org.apache.hadoop.metrics.Metrics;
 import org.apache.hadoop.util.*;
 import org.apache.hadoop.util.DiskChecker.DiskErrorException;
+import org.apache.hadoop.util.DiskChecker.DiskOutOfSpaceException;
 import org.apache.hadoop.mapred.StatusHttpServer;
 
 import java.io.*;
@@ -726,8 +727,12 @@
                       out.write(buf, 0, bytesRead);
                       myMetrics.wroteBytes(bytesRead);
                     } catch (IOException iex) {
-                      shutdown();
-                      throw iex;
+                      if (iex.getMessage().startsWith("No space left on device")) {
+                    	  throw new DiskOutOfSpaceException("No space left on device");
+                      } else {
+                        shutdown();
+                        throw iex;
+                      }
                     }
                     if (out2 != null) {
                       try {

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java?rev=430085&r1=430084&r2=430085&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java Wed Aug  9 09:25:58
2006
@@ -21,6 +21,7 @@
 import org.apache.hadoop.fs.*;
 import org.apache.hadoop.util.DiskChecker;
 import org.apache.hadoop.util.DiskChecker.DiskErrorException;
+import org.apache.hadoop.util.DiskChecker.DiskOutOfSpaceException;
 import org.apache.hadoop.conf.*;
 
 /**************************************************
@@ -302,7 +303,7 @@
             // Check if we have too little space
             //
             if (getRemaining() < blockSize) {
-                throw new IOException("Insufficient space for an additional block");
+                throw new DiskOutOfSpaceException("Insufficient space for an additional block");
             }
 
             //

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/util/DiskChecker.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/util/DiskChecker.java?rev=430085&r1=430084&r2=430085&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/util/DiskChecker.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/util/DiskChecker.java Wed Aug  9 09:25:58
2006
@@ -16,6 +16,12 @@
       }
     }
     
+    public static class DiskOutOfSpaceException extends IOException {
+        public DiskOutOfSpaceException(String msg) {
+          super(msg);
+        }
+      }
+      
     public static void checkDir( File dir ) throws DiskErrorException {
         if( !dir.exists() && !dir.mkdirs() )
             throw new DiskErrorException( "can not create directory: " 



Mime
View raw message