提交 91f7d160 编写于 作者: A Alexander Alexandrov 提交者: StephanEwen

Minor changes in RemoteExecutor.java and LocalExecutor.java. Removed obsolete...

Minor changes in RemoteExecutor.java and LocalExecutor.java. Removed obsolete null-value check in the finally clauses in LocalExecutor.java. Returning proper exit code in RemoteExecutor.java.
上级 eeae6877
......@@ -64,7 +64,7 @@ public class LocalExecutor implements PlanExecutor {
this.nephele.start();
}
}
/**
* Stop the local executor instance. You should not call executePlan after this.
*/
......@@ -101,7 +101,7 @@ public class LocalExecutor implements PlanExecutor {
return jobClient.submitJobAndWait();
}
}
/**
* Returns a JSON dump of the optimized plan.
*
......@@ -121,7 +121,7 @@ public class LocalExecutor implements PlanExecutor {
return gen.getOptimizerPlanAsJSON(op);
}
/**
* Executes the program described by the given plan assembler.
*
......@@ -151,12 +151,10 @@ public class LocalExecutor implements PlanExecutor {
exec.start();
return exec.executePlan(plan);
} finally {
if (exec != null) {
exec.stop();
}
exec.stop();
}
}
/**
* Returns a JSON dump of the optimized plan.
*
......@@ -175,12 +173,10 @@ public class LocalExecutor implements PlanExecutor {
return gen.getOptimizerPlanAsJSON(op);
} finally {
if (exec != null) {
exec.stop();
}
exec.stop();
}
}
/**
* Return unoptimized plan as JSON.
* @return
......
......@@ -9,10 +9,11 @@ import eu.stratosphere.pact.client.nephele.api.PlanWithJars;
import eu.stratosphere.pact.common.plan.Plan;
public class RemoteExecutor implements PlanExecutor {
private Client client;
private List<String> jarFiles;
public RemoteExecutor(String hostname, int port, List<String> jarFiles) {
this.client = new Client(new InetSocketAddress(hostname, port));
this.jarFiles = jarFiles;
......@@ -25,8 +26,7 @@ public class RemoteExecutor implements PlanExecutor {
@Override
public long executePlan(Plan plan) throws Exception {
PlanWithJars p = new PlanWithJars(plan, jarFiles);
client.run(p, true);
return 0;
PlanWithJars p = new PlanWithJars(plan, this.jarFiles);
return this.client.run(p, true);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册