hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomwh...@apache.org
Subject svn commit: r949818 - in /hadoop/mapreduce/branches/branch-0.21: ./ src/benchmarks/gridmix2/src/java/org/apache/hadoop/mapreduce/ src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/ src/contrib/index/src/java/org/apache/hadoop/contrib/index/...
Date Mon, 31 May 2010 17:47:49 GMT
Author: tomwhite
Date: Mon May 31 17:47:48 2010
New Revision: 949818

URL: http://svn.apache.org/viewvc?rev=949818&view=rev
Log:
Merge -r 949814:949815 from trunk to 0.21 branch. Fixes: MAPREDUCE-1535

Modified:
    hadoop/mapreduce/branches/branch-0.21/CHANGES.txt
    hadoop/mapreduce/branches/branch-0.21/src/benchmarks/gridmix2/src/java/org/apache/hadoop/mapreduce/GenericMRLoadJobCreator.java
    hadoop/mapreduce/branches/branch-0.21/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/FilePool.java
    hadoop/mapreduce/branches/branch-0.21/src/contrib/index/src/java/org/apache/hadoop/contrib/index/lucene/FileSystemDirectory.java
    hadoop/mapreduce/branches/branch-0.21/src/contrib/index/src/java/org/apache/hadoop/contrib/index/main/UpdateIndex.java
    hadoop/mapreduce/branches/branch-0.21/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java
    hadoop/mapreduce/branches/branch-0.21/src/contrib/streaming/src/java/org/apache/hadoop/streaming/DumpTypedBytes.java
    hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/FileInputFormat.java
    hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/FileOutputCommitter.java
    hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/SequenceFileInputFormat.java
    hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/TaskRunner.java
    hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/input/FileInputFormat.java
    hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/input/NLineInputFormat.java
    hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/input/SequenceFileInputFormat.java
    hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java
    hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/fs/DistributedFSCheck.java
    hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/GenericMRLoadGenerator.java
    hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/TestMapRed.java
    hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapreduce/GenericMRLoadGenerator.java
    hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduce.java
    hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/tools/TestDistCh.java
    hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/DistCh.java
    hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/DistCp.java
    hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/HadoopArchives.java
    hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/rumen/Folder.java
    hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/rumen/HadoopLogsAnalyzer.java
    hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/rumen/TraceBuilder.java

Modified: hadoop/mapreduce/branches/branch-0.21/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/CHANGES.txt?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/CHANGES.txt (original)
+++ hadoop/mapreduce/branches/branch-0.21/CHANGES.txt Mon May 31 17:47:48 2010
@@ -734,6 +734,9 @@ Release 0.21.0 - Unreleased
     MAPREDUCE-1751. Change MapReduce to depend on Hadoop 'common' artifacts
     instead of 'core'. (tomwhite)
 
+    MAPREDUCE-1535.  Replace usage of FileStatus#isDir().  (Eli Collins via
+    tomwhite)
+
   OPTIMIZATIONS
 
     MAPREDUCE-270. Fix the tasktracker to optionally send an out-of-band

Modified: hadoop/mapreduce/branches/branch-0.21/src/benchmarks/gridmix2/src/java/org/apache/hadoop/mapreduce/GenericMRLoadJobCreator.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/benchmarks/gridmix2/src/java/org/apache/hadoop/mapreduce/GenericMRLoadJobCreator.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/benchmarks/gridmix2/src/java/org/apache/hadoop/mapreduce/GenericMRLoadJobCreator.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/benchmarks/gridmix2/src/java/org/apache/hadoop/mapreduce/GenericMRLoadJobCreator.java
Mon May 31 17:47:48 2010
@@ -75,7 +75,7 @@ public class GenericMRLoadJobCreator ext
           pathstack.push(p);
           while (!pathstack.empty()) {
             for (FileStatus stat : fs.listStatus(pathstack.pop())) {
-              if (stat.isDir()) {
+              if (stat.isDirectory()) {
                 if (!stat.getPath().getName().startsWith("_")) {
                   pathstack.push(stat.getPath());
                 }

Modified: hadoop/mapreduce/branches/branch-0.21/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/FilePool.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/FilePool.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/FilePool.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/FilePool.java
Mon May 31 17:47:48 2010
@@ -271,7 +271,7 @@ class FilePool {
       final ArrayList<FileStatus> curFiles = new ArrayList<FileStatus>();
       final ArrayList<FileStatus> curDirs = new ArrayList<FileStatus>();
       for (FileStatus stat : fs.listStatus(thisDir.getPath())) {
-        if (stat.isDir()) {
+        if (stat.isDirectory()) {
           curDirs.add(stat);
         } else if (filter.accept(stat)) {
           curFiles.add(stat);

Modified: hadoop/mapreduce/branches/branch-0.21/src/contrib/index/src/java/org/apache/hadoop/contrib/index/lucene/FileSystemDirectory.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/contrib/index/src/java/org/apache/hadoop/contrib/index/lucene/FileSystemDirectory.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/contrib/index/src/java/org/apache/hadoop/contrib/index/lucene/FileSystemDirectory.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/contrib/index/src/java/org/apache/hadoop/contrib/index/lucene/FileSystemDirectory.java
Mon May 31 17:47:48 2010
@@ -66,7 +66,7 @@ public class FileSystemDirectory extends
     try {
       FileStatus status = fs.getFileStatus(directory);
       if (status != null) {
-        isDir = status.isDir();
+        isDir = status.isDirectory();
       }
     } catch (IOException e) {
       // file does not exist, isDir already set to false
@@ -85,7 +85,7 @@ public class FileSystemDirectory extends
     try {
       FileStatus status = fs.getFileStatus(directory);
       if (status != null) {
-        isDir = status.isDir();
+        isDir = status.isDirectory();
       }
     } catch (IOException e) {
       // file does not exist, isDir already set to false

Modified: hadoop/mapreduce/branches/branch-0.21/src/contrib/index/src/java/org/apache/hadoop/contrib/index/main/UpdateIndex.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/contrib/index/src/java/org/apache/hadoop/contrib/index/main/UpdateIndex.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/contrib/index/src/java/org/apache/hadoop/contrib/index/main/UpdateIndex.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/contrib/index/src/java/org/apache/hadoop/contrib/index/main/UpdateIndex.java
Mon May 31 17:47:48 2010
@@ -111,7 +111,7 @@ public class UpdateIndex {
       String[] shardNames = new String[fileStatus.length];
       int count = 0;
       for (int i = 0; i < fileStatus.length; i++) {
-        if (fileStatus[i].isDir()) {
+        if (fileStatus[i].isDirectory()) {
           shardNames[count] = fileStatus[i].getPath().getName();
           count++;
         }

Modified: hadoop/mapreduce/branches/branch-0.21/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java
Mon May 31 17:47:48 2010
@@ -607,7 +607,7 @@ public class RaidNode implements RaidPro
     // src file and the src file has not been modified
     // recently, then that file is a candidate for RAID.
 
-    if (!src.isDir()) {      // a file
+    if (src.isFile()) {
 
       // if the source file has fewer than or equal to 2 blocks, then no need to RAID
       long blockSize = src.getBlockSize();
@@ -1245,7 +1245,7 @@ public class RaidNode implements RaidPro
         return;
       }
       
-      if (dest.isDir()) {
+      if (dest.isDirectory()) {
         FileStatus[] files = null;
         files = destFs.listStatus(destPath);
         if (files != null) {
@@ -1361,7 +1361,7 @@ public class RaidNode implements RaidPro
   private void recurseHar(FileSystem destFs, FileStatus dest, long cutoff, String tmpHarPath)
     throws IOException {
 
-    if (!dest.isDir()) {
+    if (dest.isFile()) {
       return;
     }
     
@@ -1378,7 +1378,7 @@ public class RaidNode implements RaidPro
     if (files != null) {
       shouldHar = files.length > 0;
       for (FileStatus one: files) {
-        if (one.isDir()){
+        if (one.isDirectory()){
           recurseHar(destFs, one, cutoff, tmpHarPath);
           shouldHar = false;
         } else if (one.getModificationTime() > cutoff ) {

Modified: hadoop/mapreduce/branches/branch-0.21/src/contrib/streaming/src/java/org/apache/hadoop/streaming/DumpTypedBytes.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/contrib/streaming/src/java/org/apache/hadoop/streaming/DumpTypedBytes.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/contrib/streaming/src/java/org/apache/hadoop/streaming/DumpTypedBytes.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/contrib/streaming/src/java/org/apache/hadoop/streaming/DumpTypedBytes.java
Mon May 31 17:47:48 2010
@@ -74,7 +74,7 @@ public class DumpTypedBytes implements T
     for (Path p : FileUtil.stat2Paths(fs.globStatus(pattern), pattern)) {
       List<FileStatus> inputFiles = new ArrayList<FileStatus>();
       FileStatus status = fs.getFileStatus(p);
-      if (status.isDir()) {
+      if (status.isDirectory()) {
         FileStatus[] files = fs.listStatus(p);
         Collections.addAll(inputFiles, files);
       } else {

Modified: hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/FileInputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/FileInputFormat.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/FileInputFormat.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/FileInputFormat.java
Mon May 31 17:47:48 2010
@@ -164,7 +164,7 @@ public abstract class FileInputFormat<K,
       FileSystem fs, Path path, PathFilter inputFilter) 
       throws IOException {
     for(FileStatus stat: fs.listStatus(path, inputFilter)) {
-      if (stat.isDir()) {
+      if (stat.isDirectory()) {
         addInputPathRecursively(result, fs, stat.getPath(), inputFilter);
       } else {
         result.add(stat);
@@ -214,10 +214,10 @@ public abstract class FileInputFormat<K,
         errors.add(new IOException("Input Pattern " + p + " matches 0 files"));
       } else {
         for (FileStatus globStat: matches) {
-          if (globStat.isDir()) {
+          if (globStat.isDirectory()) {
             for(FileStatus stat: fs.listStatus(globStat.getPath(),
                 inputFilter)) {
-              if (recursive && stat.isDir()) {
+              if (recursive && stat.isDirectory()) {
                 addInputPathRecursively(result, fs, stat.getPath(), inputFilter);
               } else {
                 result.add(stat);
@@ -257,7 +257,7 @@ public abstract class FileInputFormat<K,
     job.setLong(NUM_INPUT_FILES, files.length);
     long totalSize = 0;                           // compute total size
     for (FileStatus file: files) {                // check we have valid files
-      if (file.isDir()) {
+      if (file.isDirectory()) {
         throw new IOException("Not a file: "+ file.getPath());
       }
       totalSize += file.getLen();

Modified: hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/FileOutputCommitter.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/FileOutputCommitter.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/FileOutputCommitter.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/FileOutputCommitter.java
Mon May 31 17:47:48 2010
@@ -163,7 +163,7 @@ public class FileOutputCommitter extends
         }
       }
       LOG.debug("Moved " + taskOutput + " to " + finalOutputPath);
-    } else if(fs.getFileStatus(taskOutput).isDir()) {
+    } else if(fs.getFileStatus(taskOutput).isDirectory()) {
       FileStatus[] paths = fs.listStatus(taskOutput);
       Path finalOutputPath = getFinalPath(jobOutputDir, taskOutput, 
 	          getTempTaskOutputPath(context));

Modified: hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/SequenceFileInputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/SequenceFileInputFormat.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/SequenceFileInputFormat.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/SequenceFileInputFormat.java
Mon May 31 17:47:48 2010
@@ -48,7 +48,7 @@ public class SequenceFileInputFormat<K, 
     FileStatus[] files = super.listStatus(job);
     for (int i = 0; i < files.length; i++) {
       FileStatus file = files[i];
-      if (file.isDir()) {     // it's a MapFile
+      if (file.isDirectory()) {     // it's a MapFile
         Path dataFile = new Path(file.getPath(), MapFile.DATA_FILE_NAME);
         FileSystem fs = file.getPath().getFileSystem(job);
         // use the data file

Modified: hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/TaskRunner.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/TaskRunner.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/TaskRunner.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapred/TaskRunner.java
Mon May 31 17:47:48 2010
@@ -512,7 +512,7 @@ abstract class TaskRunner extends Thread
       tmpDir = new Path(workDir.toString(), tmp);
 
       FileSystem localFs = FileSystem.getLocal(conf);
-      if (!localFs.mkdirs(tmpDir) && !localFs.getFileStatus(tmpDir).isDir()) {
+      if (!localFs.mkdirs(tmpDir) && localFs.getFileStatus(tmpDir).isFile()) {
         throw new IOException("Mkdirs failed to create " + tmpDir.toString());
       }
     }

Modified: hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/input/FileInputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/input/FileInputFormat.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/input/FileInputFormat.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/input/FileInputFormat.java
Mon May 31 17:47:48 2010
@@ -229,7 +229,7 @@ public abstract class FileInputFormat<K,
         errors.add(new IOException("Input Pattern " + p + " matches 0 files"));
       } else {
         for (FileStatus globStat: matches) {
-          if (globStat.isDir()) {
+          if (globStat.isDirectory()) {
             for(FileStatus stat: fs.listStatus(globStat.getPath(),
                 inputFilter)) {
               result.add(stat);

Modified: hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/input/NLineInputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/input/NLineInputFormat.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/input/NLineInputFormat.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/input/NLineInputFormat.java
Mon May 31 17:47:48 2010
@@ -90,7 +90,7 @@ public class NLineInputFormat extends Fi
       Configuration conf, int numLinesPerSplit) throws IOException {
     List<FileSplit> splits = new ArrayList<FileSplit> ();
     Path fileName = status.getPath();
-    if (status.isDir()) {
+    if (status.isDirectory()) {
       throw new IOException("Not a file: " + fileName);
     }
     FileSystem  fs = fileName.getFileSystem(conf);

Modified: hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/input/SequenceFileInputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/input/SequenceFileInputFormat.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/input/SequenceFileInputFormat.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/input/SequenceFileInputFormat.java
Mon May 31 17:47:48 2010
@@ -60,7 +60,7 @@ public class SequenceFileInputFormat<K, 
     int len = files.size();
     for(int i=0; i < len; ++i) {
       FileStatus file = files.get(i);
-      if (file.isDir()) {     // it's a MapFile
+      if (file.isDirectory()) {     // it's a MapFile
         Path p = file.getPath();
         FileSystem fs = p.getFileSystem(job.getConfiguration());
         // use the data file

Modified: hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java
Mon May 31 17:47:48 2010
@@ -205,7 +205,7 @@ public class FileOutputCommitter extends
         }
       }
       LOG.debug("Moved " + taskOutput + " to " + finalOutputPath);
-    } else if(fs.getFileStatus(taskOutput).isDir()) {
+    } else if(fs.getFileStatus(taskOutput).isDirectory()) {
       FileStatus[] paths = fs.listStatus(taskOutput);
       Path finalOutputPath = getFinalPath(jobOutputDir, taskOutput, workPath);
       fs.mkdirs(finalOutputPath);

Modified: hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/fs/DistributedFSCheck.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/fs/DistributedFSCheck.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/fs/DistributedFSCheck.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/fs/DistributedFSCheck.java
Mon May 31 17:47:48 2010
@@ -123,7 +123,7 @@ public class DistributedFSCheck extends 
                            SequenceFile.Writer writer
                            ) throws IOException {
     Path rootFile = rootStatus.getPath();
-    if (!rootStatus.isDir()) {
+    if (rootStatus.isFile()) {
       nrFiles++;
       // For a regular file generate <fName,offset> pairs
       long blockSize = fs.getDefaultBlockSize();

Modified: hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/GenericMRLoadGenerator.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/GenericMRLoadGenerator.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/GenericMRLoadGenerator.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/GenericMRLoadGenerator.java
Mon May 31 17:47:48 2010
@@ -160,7 +160,7 @@ public class GenericMRLoadGenerator exte
           pathstack.push(p);
           while (!pathstack.empty()) {
             for (FileStatus stat : fs.listStatus(pathstack.pop())) {
-              if (stat.isDir()) {
+              if (stat.isDirectory()) {
                 if (!stat.getPath().getName().startsWith("_")) {
                   pathstack.push(stat.getPath());
                 }

Modified: hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/TestMapRed.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/TestMapRed.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/TestMapRed.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/TestMapRed.java
Mon May 31 17:47:48 2010
@@ -690,7 +690,7 @@ public class TestMapRed extends Configur
     FileSystem fs = dir.getFileSystem(conf);
     for(FileStatus f: fs.listStatus(dir)) {
       System.out.println("Reading " + f.getPath() + ": ");
-      if (f.isDir()) {
+      if (f.isDirectory()) {
         System.out.println("  it is a map file.");
         printSequenceFile(fs, new Path(f.getPath(), "data"), conf);
       } else if (isSequenceFile(fs, f.getPath())) {

Modified: hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapreduce/GenericMRLoadGenerator.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapreduce/GenericMRLoadGenerator.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapreduce/GenericMRLoadGenerator.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapreduce/GenericMRLoadGenerator.java
Mon May 31 17:47:48 2010
@@ -166,7 +166,7 @@ public class GenericMRLoadGenerator exte
           pathstack.push(p);
           while (!pathstack.empty()) {
             for (FileStatus stat : fs.listStatus(pathstack.pop())) {
-              if (stat.isDir()) {
+              if (stat.isDirectory()) {
                 if (!stat.getPath().getName().startsWith("_")) {
                   pathstack.push(stat.getPath());
                 }

Modified: hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduce.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduce.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduce.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduce.java
Mon May 31 17:47:48 2010
@@ -467,7 +467,7 @@ public class TestMapReduce extends TestC
     FileSystem fs = dir.getFileSystem(conf);
     for(FileStatus f: fs.listStatus(dir)) {
       System.out.println("Reading " + f.getPath() + ": ");
-      if (f.isDir()) {
+      if (f.isDirectory()) {
         System.out.println("  it is a map file.");
         printSequenceFile(fs, new Path(f.getPath(), "data"), conf);
       } else if (isSequenceFile(fs, f.getPath())) {

Modified: hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/tools/TestDistCh.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/tools/TestDistCh.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/tools/TestDistCh.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/tools/TestDistCh.java
Mon May 31 17:47:48 2010
@@ -89,7 +89,7 @@ public class TestDistCh extends junit.fr
 
     Path mkdir(Path dir) throws IOException {
       assertTrue(fs.mkdirs(dir));
-      assertTrue(fs.getFileStatus(dir).isDir());
+      assertTrue(fs.getFileStatus(dir).isDirectory());
       return dir;
     }
     
@@ -191,7 +191,7 @@ public class TestDistCh extends junit.fr
     assertEquals(expected.getUserName(), actual.getOwner());
     assertEquals(expected.getGroupName(), actual.getGroup());
     FsPermission perm = expected.getPermission(); 
-    if (!actual.isDir()) {
+    if (actual.isFile()) {
       perm = perm.applyUMask(UMASK);
     }
     assertEquals(perm, actual.getPermission());

Modified: hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/DistCh.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/DistCh.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/DistCh.java (original)
+++ hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/DistCh.java Mon
May 31 17:47:48 2010
@@ -175,7 +175,7 @@ public class DistCh extends DistTool {
       }
       if (permission != null) {
         FsPermission orig = original.getPermission();
-        return original.isDir()? !permission.equals(orig):
+        return original.isDirectory()? !permission.equals(orig):
           !permission.applyUMask(FILE_UMASK).equals(orig);
       }
       return false;
@@ -460,7 +460,7 @@ public class DistCh extends DistTool {
           FileOperation.class, SequenceFile.CompressionType.NONE);
       for(FileOperation op : ops) {
         FileStatus srcstat = fs.getFileStatus(op.src); 
-        if (srcstat.isDir() && op.isDifferent(srcstat)) {
+        if (srcstat.isDirectory() && op.isDifferent(srcstat)) {
           ++opCount;
           opWriter.append(new Text(op.src.toString()), op);
         }
@@ -468,7 +468,7 @@ public class DistCh extends DistTool {
         Stack<Path> pathstack = new Stack<Path>();
         for(pathstack.push(op.src); !pathstack.empty(); ) {
           for(FileStatus stat : fs.listStatus(pathstack.pop())) {
-            if (stat.isDir()) {
+            if (stat.isDirectory()) {
               pathstack.push(stat.getPath());
             }
 

Modified: hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/DistCp.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/DistCp.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/DistCp.java (original)
+++ hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/DistCp.java Mon
May 31 17:47:48 2010
@@ -492,15 +492,15 @@ public class DistCp implements Tool {
         // destination file rather than destination directory
         Path dstparent = absdst.getParent();
         if (!(destFileSys.exists(dstparent) &&
-              destFileSys.getFileStatus(dstparent).isDir())) {
+              destFileSys.getFileStatus(dstparent).isDirectory())) {
           absdst = dstparent;
         }
       }
       
       // if a directory, ensure created even if empty
-      if (srcstat.isDir()) {
+      if (srcstat.isDirectory()) {
         if (destFileSys.exists(absdst)) {
-          if (!destFileSys.getFileStatus(absdst).isDir()) {
+          if (destFileSys.getFileStatus(absdst).isFile()) {
             throw new IOException("Failed to mkdirs: " + absdst+" is a file.");
           }
         }
@@ -531,7 +531,7 @@ public class DistCp implements Tool {
       }
       else {
         if (destFileSys.exists(absdst) &&
-            destFileSys.getFileStatus(absdst).isDir()) {
+            destFileSys.getFileStatus(absdst).isDirectory()) {
           throw new IOException(absdst + " is a directory");
         }
         if (!destFileSys.mkdirs(absdst.getParent())) {
@@ -1178,7 +1178,7 @@ public class DistCp implements Tool {
     }catch (FileNotFoundException e) {
       return false;
     }
-    if (!status.isDir()) {
+    if (status.isFile()) {
       throw new FileAlreadyExistsException("Not a dir: " + dst+" is a file.");
     }
     return true;
@@ -1236,7 +1236,7 @@ public class DistCp implements Tool {
     boolean dstExists = dstfs.exists(args.dst);
     boolean dstIsDir = false;
     if (dstExists) {
-      dstIsDir = dstfs.getFileStatus(args.dst).isDir();
+      dstIsDir = dstfs.getFileStatus(args.dst).isDirectory();
     }
 
     // default logPath
@@ -1305,9 +1305,9 @@ public class DistCp implements Tool {
         final Path src = srcItr.next();
         FileSystem srcfs = src.getFileSystem(conf);
         FileStatus srcfilestat = srcfs.getFileStatus(src);
-        Path root = special && srcfilestat.isDir()? src: src.getParent();
+        Path root = special && srcfilestat.isDirectory()? src: src.getParent();
         if (dstExists && !dstIsDir &&
-            (args.srcs.size() > 1 || srcfilestat.isDir())) {
+            (args.srcs.size() > 1 || srcfilestat.isDirectory())) {
           // destination should not be a file
           throw new IOException("Destination " + args.dst + " should be a dir" +
                                 " if multiple source paths are there OR if" +
@@ -1339,7 +1339,7 @@ public class DistCp implements Tool {
           }
         }
         
-        if (srcfilestat.isDir()) {
+        if (srcfilestat.isDirectory()) {
           ++srcCount;
           final String dst = makeRelative(root,src);
           if (!update || !dirExists(conf, new Path(args.dst, dst))) {
@@ -1360,7 +1360,7 @@ public class DistCp implements Tool {
             final String dst = makeRelative(root, child.getPath());
             ++srcCount;
 
-            if (child.isDir()) {
+            if (child.isDirectory()) {
               pathstack.push(child);
               if (!update || !dirExists(conf, new Path(args.dst, dst))) {
                 ++dirCount;
@@ -1371,13 +1371,13 @@ public class DistCp implements Tool {
             }
             else {
               Path destPath = new Path(args.dst, dst);
-              if (!cur.isDir() && (args.srcs.size() == 1)) {
+              if (cur.isFile() && (args.srcs.size() == 1)) {
                 // Copying a single file; use dst path provided by user as
                 // destination file rather than destination directory
                 Path dstparent = destPath.getParent();
                 FileSystem destFileSys = destPath.getFileSystem(jobConf);
                 if (!(destFileSys.exists(dstparent) &&
-                    destFileSys.getFileStatus(dstparent).isDir())) {
+                    destFileSys.getFileStatus(dstparent).isDirectory())) {
                   destPath = dstparent;
                 }
               }
@@ -1415,7 +1415,7 @@ public class DistCp implements Tool {
             }
 
             if (!skipPath) {
-              src_writer.append(new LongWritable(child.isDir()? 0: child.getLen()),
+              src_writer.append(new LongWritable(child.isDirectory()? 0: child.getLen()),
                   new FilePair(child, dst));
             }
 
@@ -1423,7 +1423,7 @@ public class DistCp implements Tool {
                 new Text(child.getPath().toString()));
           }
 
-          if (cur.isDir()) {
+          if (cur.isDirectory()) {
             String dst = makeRelative(root, cur.getPath());
             dir_writer.append(new Text(dst), new FilePair(cur, dst));
             if (++dirsyn > SYNC_FILE_MAX) {
@@ -1564,7 +1564,7 @@ public class DistCp implements Tool {
       FileSystem dstfs, FileStatus dstroot, Path dstsorted,
       FileSystem jobfs, Path jobdir, JobConf jobconf, Configuration conf
       ) throws IOException {
-    if (!dstroot.isDir()) {
+    if (dstroot.isFile()) {
       throw new IOException("dst must be a directory when option "
           + Options.DELETE.cmd + " is set, but dst (= " + dstroot.getPath()
           + ") is not a directory.");
@@ -1580,7 +1580,7 @@ public class DistCp implements Tool {
       final Stack<FileStatus> lsrstack = new Stack<FileStatus>();
       for(lsrstack.push(dstroot); !lsrstack.isEmpty(); ) {
         final FileStatus status = lsrstack.pop();
-        if (status.isDir()) {
+        if (status.isDirectory()) {
           for(FileStatus child : dstfs.listStatus(status.getPath())) {
             String relative = makeRelative(dstroot.getPath(), child.getPath());
             writer.append(new Text(relative), NullWritable.get());

Modified: hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/HadoopArchives.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/HadoopArchives.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/HadoopArchives.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/HadoopArchives.java
Mon May 31 17:47:48 2010
@@ -142,7 +142,7 @@ public class HadoopArchives implements T
    */
   private void recursivels(FileSystem fs, FileStatusDir fdir, List<FileStatusDir> out)

   throws IOException {
-    if (!fdir.getFileStatus().isDir()) {
+    if (fdir.getFileStatus().isFile()) {
       out.add(fdir);
       return;
     }
@@ -509,10 +509,10 @@ public class HadoopArchives implements T
         recursivels(fs, fdir, allFiles);
         for (FileStatusDir statDir: allFiles) {
           FileStatus stat = statDir.getFileStatus();
-          long len = stat.isDir()? 0:stat.getLen();
+          long len = stat.isDirectory()? 0:stat.getLen();
           final Path path = relPathToRoot(stat.getPath(), parentPath);
           final String[] children;
-          if (stat.isDir()) {
+          if (stat.isDirectory()) {
             //get the children 
             FileStatus[] list = statDir.getChildren();
             children = new String[list.length];

Modified: hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/rumen/Folder.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/rumen/Folder.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/rumen/Folder.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/rumen/Folder.java
Mon May 31 17:47:48 2010
@@ -193,7 +193,7 @@ public class Folder extends Configured i
           tempDirName == null ? outPath.getParent() : new Path(tempDirName);
 
       FileSystem fs = tempDir.getFileSystem(getConf());
-      if (!fs.getFileStatus(tempDir).isDir()) {
+      if (!fs.getFileStatus(tempDir).isDirectory()) {
         throw new IOException("Your temp directory is not a directory");
       }
 

Modified: hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/rumen/HadoopLogsAnalyzer.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/rumen/HadoopLogsAnalyzer.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/rumen/HadoopLogsAnalyzer.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/rumen/HadoopLogsAnalyzer.java
Mon May 31 17:47:48 2010
@@ -304,7 +304,7 @@ public class HadoopLogsAnalyzer extends 
 
   private boolean pathIsDirectory(Path p) throws IOException {
     FileSystem fs = p.getFileSystem(getConf());
-    return fs.getFileStatus(p).isDir();
+    return fs.getFileStatus(p).isDirectory();
   }
 
   /**

Modified: hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/rumen/TraceBuilder.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/rumen/TraceBuilder.java?rev=949818&r1=949817&r2=949818&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/rumen/TraceBuilder.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/tools/org/apache/hadoop/tools/rumen/TraceBuilder.java
Mon May 31 17:47:48 2010
@@ -98,13 +98,13 @@ public class TraceBuilder extends Config
         Path thisPath = new Path(args[i]);
 
         FileSystem fs = thisPath.getFileSystem(conf);
-        if (fs.getFileStatus(thisPath).isDir()) {
+        if (fs.getFileStatus(thisPath).isDirectory()) {
           FileStatus[] statuses = fs.listStatus(thisPath);
 
           List<String> dirNames = new ArrayList<String>();
 
           for (FileStatus s : statuses) {
-            if (s.isDir()) continue;
+            if (s.isDirectory()) continue;
             String name = s.getPath().getName();
 
             if (!(name.endsWith(".crc") || name.startsWith("."))) {



Mime
View raw message