hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomwh...@apache.org
Subject svn commit: r527613 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/FSDataset.java src/java/org/apache/hadoop/fs/DF.java
Date Wed, 11 Apr 2007 19:03:37 GMT
Author: tomwhite
Date: Wed Apr 11 12:03:36 2007
New Revision: 527613

URL: http://svn.apache.org/viewvc?view=rev&rev=527613
Log:
HADOOP-1189.  Fix 'No space left on device' exceptions on datanodes.  Contributed by Raghu
Angadi.

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

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=527613&r1=527612&r2=527613
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Wed Apr 11 12:03:36 2007
@@ -162,6 +162,9 @@
 49. HADOOP-971.  Improve DFS Scalability: Improve name node performance
     by adding a hostname to datanodes map.  (Hairong Kuang via tomwhite)
 
+50. HADOOP-1189.  Fix 'No space left on device' exceptions on datanodes.
+    (Raghu Angadi via tomwhite)
+
 
 Release 0.12.3 - 2007-04-06
 

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=527613&r1=527612&r2=527613
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java Wed Apr 11 12:03:36
2007
@@ -285,9 +285,9 @@
       }
       
       long getAvailable() throws IOException {
-        long freespace = (long)
-            Math.round( ( ( usableDiskPct * usage.getCapacity() )
-                          - usage.getUsed() - reserved ));
+        long capacity = usage.getCapacity();
+        long freespace = Math.round(usage.getAvailableSkipRefresh() -
+                                    capacity * (1 - usableDiskPct) - reserved); 
         return ( freespace > 0 ) ? freespace : 0;
       }
       

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/DF.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/DF.java?view=diff&rev=527613&r1=527612&r2=527613
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/DF.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/DF.java Wed Apr 11 12:03:36 2007
@@ -110,6 +110,22 @@
     return mount;
   }
   
+  public long getCapacitySkipRefresh() { 
+    return capacity; 
+  }
+  
+  public long getUsedSkipRefresh() { 
+    return used;
+  }
+  
+  public long getAvailableSkipRefresh() { 
+    return available;
+  }
+  
+  public int getPercentUsedSkipRefresh() {
+    return percentUsed;
+  }
+  
   public String toString() {
     return
       "df -k " + mount +"\n" +



Mime
View raw message