hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r510261 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/DFSClient.java src/java/org/apache/hadoop/dfs/FSDataset.java
Date Wed, 21 Feb 2007 22:07:51 GMT
Author: cutting
Date: Wed Feb 21 14:07:50 2007
New Revision: 510261

URL: http://svn.apache.org/viewvc?view=rev&rev=510261
Log:
HADOOP-990.  Improve HDFS support for full datanode volumes.  Contributed by Raghu.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=510261&r1=510260&r2=510261
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Wed Feb 21 14:07:50 2007
@@ -99,6 +99,10 @@
     transfers. This includes a generic retry mechanism for use
     elsewhere in Hadoop. (tomwhite)
 
+30. HADOOP-990.  Improve HDFS support for full datanode volumes.
+    (Raghu Angadi via cutting)
+
+
 Release 0.11.2 - 2007-02-16
 
  1. HADOOP-1009.  Fix an infinite loop in the HDFS namenode.

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java?view=diff&rev=510261&r1=510260&r2=510261
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java Wed Feb 21 14:07:50
2007
@@ -1032,6 +1032,9 @@
                 }
 
                 block = lb.getBlock();
+                if ( block.getNumBytes() < bytesWrittenToBlock ) {
+                  block.setNumBytes( bytesWrittenToBlock );
+                }
                 DatanodeInfo nodes[] = lb.getLocations();
 
                 //
@@ -1074,7 +1077,6 @@
                     nodes[i].write(out);
                 }
                 out.write(CHUNKED_ENCODING);
-                bytesWrittenToBlock = 0;
                 blockStream = out;
                 blockReplyStream = new DataInputStream(new BufferedInputStream(s.getInputStream()));
             } while (retry);
@@ -1274,6 +1276,7 @@
                 }
             }
 
+            bytesWrittenToBlock = 0;
             //
             // Delete local backup, start new one
             //

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?view=diff&rev=510261&r1=510260&r2=510261
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java Wed Feb 21 14:07:50
2007
@@ -221,8 +221,10 @@
       }
       
       long getAvailable() throws IOException {
-        return ((long) Math.round(usableDiskPct *
-                usage.getAvailable()) - reserved);
+        long freespace = (long)
+            Math.round( ( ( usableDiskPct * usage.getCapacity() )
+                          - usage.getUsed() - reserved ));
+        return ( freespace > 0 ) ? freespace : 0;
       }
       
       String getMount() throws IOException {
@@ -246,7 +248,6 @@
           System.out.println("Exception!  " + ie);
           throw ie;
         }
-        reserved -= b.getNumBytes();
         return f;
       }
       



Mime
View raw message