We're some students of University of Fisciano(SA-Italy). We're wrinting a MapReduce program for a chemistry problem and we need to launch a shell command in our reduce method. This is the code:
*Process p = Runtime.getRuntime().exec("hadoop fs -cp /source/* /dest");
try
{
p.waitFor();
}
catch (Exception e)
{
e.getMessage();
}
Thi is another mode to call a shell command but we have the same negative result....
Shell.execCommand("hadoop fs -cp /projects/* /" + name_dir);
java.io.IOException: Cannot run program "hadoop fs -cp /projects/* /1": java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
at org.apache.hadoop.util.Shell.runCommand(Shell.java:149)
at org.apache.hadoop.util.Shell.run(Shell.java:134)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:286)
at org.apache.hadoop
*.util.Shell.execCommand(Shell.java:354)
at org.apache.hadoop.util.Shell.execCommand(Shell.java:337)
at cloud.yasara.MapReduceYasara$YasaraReducer.reduce(MapReduceYasara.java:95)
at cloud.yasara.MapReduceYasara$YasaraReducer.reduce(MapReduceYasara.java:1)
at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:174)
at org.apache.hadoop.mapred.Task$NewCombinerRunner.combine(Task.java:1214)
at
*org.apache.hadoop.mapred.MapTask$MapOutputBuffer.sortAndSpill(MapTask.java:1227)
at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.flush(MapTask.java:1091)
at org.apache.hadoop.mapred.MapTask$NewOutputCollector.close(MapTask.java:512)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:585)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305)
at org.apache.hadoop.mapred.Child
*.main(Child.java:170)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
... 15 more
Can someone help us???
Thanks in advance
Matteo Aprile