hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike S <mikesam...@gmail.com>
Subject fs.exists report wrong information
Date Thu, 20 Sep 2012 00:42:58 GMT
I need to check on my jar file arguments validity when the run method
is called by the ToolRunner

public int run(String[] args) throws Exception
{

Path filePath = new Path(args[3]);

FileSystem fs= path .getFileSystem(new Configuration());

if(!fs.exists(path ))
{
// Do things
}

}


The stang part is that the above code works file in my Eclipse local
run but when I move the code to the cluster, it works for the path in
hdfs but if the path (arg[3]) is on local file system like
/tmpFolder/myfile, then the above code report the file as not existing
where the file is there for sure. What I am doing wrong?

Mime
View raw message