hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r425337 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/FSDataset.java src/java/org/apache/hadoop/fs/DF.java src/java/org/apache/hadoop/fs/LocalFileSystem.java src/java/org/apache/hadoop/mapred/TaskTracker.java
Date Tue, 25 Jul 2006 09:01:13 GMT
Author: cutting
Date: Tue Jul 25 02:01:13 2006
New Revision: 425337

URL: http://svn.apache.org/viewvc?rev=425337&view=rev
Log:
HADOOP-344.  Fix some Windows-related problems with DF.  Contributed by Konstantin.

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
    lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/LocalFileSystem.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?rev=425337&r1=425336&r2=425337&view=diff
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Tue Jul 25 02:01:13 2006
@@ -73,6 +73,9 @@
     tasks whose names match a regular expression, to facilliate
     debugging.  (omalley via cutting)
 
+21. HADOOP-344.  Fix some Windows-related problems with DF.
+   (Konstantin Shvachko via cutting)
+
 
 Release 0.4.0 - 2006-06-28
 

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=425337&r1=425336&r2=425337&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 Tue Jul 25 02:01:13
2006
@@ -213,7 +213,7 @@
     public FSDataset(File dir, Configuration conf) throws IOException {
     		this.reserved = conf.getLong("dfs.datanode.du.reserved", 0);
     		this.usableDiskPct = conf.getFloat("dfs.datanode.du.pct", (float) USABLE_DISK_PCT_DEFAULT);
-        diskUsage = new DF( dir.getCanonicalPath(), conf); 
+        diskUsage = new DF( dir, conf); 
         this.data = new File(dir, "data");
         if (! data.exists()) {
             data.mkdirs();

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?rev=425337&r1=425336&r2=425337&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/DF.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/DF.java Tue Jul 25 02:01:13 2006
@@ -15,6 +15,7 @@
  */
 package org.apache.hadoop.fs;
 
+import java.io.File;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.BufferedReader;
@@ -39,12 +40,24 @@
   private int percentUsed;
   private String mount;
   
+  /** @deprecated
+   */
   public DF(String path, Configuration conf ) throws IOException {
-    this( path, conf.getLong( "dfs.df.interval", DF.DF_INTERVAL_DEFAULT ));
+    this( new File(path), conf );
   }
 
+  /** @deprecated
+   */
   public DF(String path, long dfInterval) throws IOException {
-    this.dirPath = path;
+    this( new File(path), dfInterval );
+  }
+  
+  public DF(File path, Configuration conf ) throws IOException {
+    this( path, conf.getLong( "dfs.df.interval", DF.DF_INTERVAL_DEFAULT ));
+  }
+
+  public DF(File path, long dfInterval) throws IOException {
+    this.dirPath = path.getCanonicalPath();
     this.dfInterval = dfInterval;
     lastDF = ( dfInterval < 0 ) ? 0 : -dfInterval;
     this.doDF();
@@ -145,6 +158,6 @@
     if( args.length > 0 )
       path = args[0];
 
-    System.out.println(new DF(path, DF_INTERVAL_DEFAULT).toString());
+    System.out.println(new DF(new File(path), DF_INTERVAL_DEFAULT).toString());
   }
 }

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/LocalFileSystem.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/LocalFileSystem.java?rev=425337&r1=425336&r2=425337&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/LocalFileSystem.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/LocalFileSystem.java Tue Jul 25 02:01:13
2006
@@ -345,7 +345,7 @@
         File f = pathToFile(p).getCanonicalFile();
       
         // find highest writable parent dir of f on the same device
-        String device = new DF(f.toString(), getConf()).getMount();
+        String device = new DF(f, getConf()).getMount();
         File parent = f.getParentFile();
         File dir;
         do {

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java?rev=425337&r1=425336&r2=425337&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java Tue Jul 25 02:01:13
2006
@@ -544,7 +544,7 @@
         if (localDirsDf.containsKey(localDirs[i])) {
           df = (DF) localDirsDf.get(localDirs[i]);
         } else {
-          df = new DF(localDirs[i], fConf);
+          df = new DF(new File(localDirs[i]), fConf);
           localDirsDf.put(localDirs[i], df);
         }
 



Mime
View raw message