You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by cd...@apache.org on 2008/04/09 02:54:37 UTC
svn commit: r646160 - in /hadoop/core/trunk: CHANGES.txt
src/test/testshell/ExternalMapReduce.java
Author: cdouglas
Date: Tue Apr 8 17:54:29 2008
New Revision: 646160
URL: http://svn.apache.org/viewvc?rev=646160&view=rev
Log:
HADOOP-3183. Fix TestJobShell to use 'ls' instead of java.io.File::exists
since cygwin symlinks are unsupported. Contributed by Mahadev konar
Modified:
hadoop/core/trunk/CHANGES.txt
hadoop/core/trunk/src/test/testshell/ExternalMapReduce.java
Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=646160&r1=646159&r2=646160&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Tue Apr 8 17:54:29 2008
@@ -538,6 +538,10 @@
HADOOP-3018. Fix the eclipse plug-in contrib wrt removed deprecated
methods (taton)
+ HADOOP-3183. Fix TestJobShell to use 'ls' instead of java.io.File::exists
+ since cygwin symlinks are unsupported.
+ (Mahadev konar via cdouglas)
+
Release 0.16.3 - Unreleased
BUG FIXES
Modified: hadoop/core/trunk/src/test/testshell/ExternalMapReduce.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/testshell/ExternalMapReduce.java?rev=646160&r1=646159&r2=646160&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/testshell/ExternalMapReduce.java (original)
+++ hadoop/core/trunk/src/test/testshell/ExternalMapReduce.java Tue Apr 8 17:54:29 2008
@@ -63,11 +63,24 @@
if (classpath.indexOf("testjob.jar") == -1) {
throw new IOException("failed to find in the library " + classpath);
}
- File f = new File("files_tmp");
- //check for files
- if (!f.exists()) {
- throw new IOException("file file_tmpfile not found");
+ //fork off ls to see if the file exists.
+ // java file.exists() will not work on
+ // cygwin since it is a symlink
+ String[] argv = new String[2];
+ argv[0] = "ls";
+ argv[1] = "files_tmp";
+ Process p = Runtime.getRuntime().exec(argv);
+ int ret = -1;
+ try {
+ ret = p.waitFor();
+ } catch(InterruptedException ie) {
+ //do nothing here.
+ }
+ if (ret != 0) {
+ throw new IOException("files_tmp does not exist");
}
+
+ //check for files
}
public void reduce(WritableComparable key, Iterator<Writable> values,