* template gets deleted, this needs to be taken into account in this\r
* class design!\r
*/\r
-public class JobRunner implements SyncExecutor {\r
+public class ClusterRunner implements SyncExecutor {\r
\r
final JobTemplate jobtempl;\r
static ClusterSession clustSession = ClusterSession.getInstance();\r
static Session session = clustSession.getSession();\r
- static final Logger log = Logger.getLogger(JobRunner.class);\r
+ static final Logger log = Logger.getLogger(ClusterRunner.class);\r
final ConfiguredExecutable<?> confExecutable;\r
private final String workDirectory;\r
String jobId;\r
\r
- public JobRunner(ConfiguredExecutable<?> confExec)\r
+ public ClusterRunner(ConfiguredExecutable<?> confExec)\r
throws JobSubmissionException {\r
try {\r
String command = confExec.getCommand(ExecProvider.Cluster);\r
// Tell the job where to get/put things\r
jobtempl.setWorkingDirectory(this.workDirectory);\r
\r
- /*\r
- * Set environment variables for the process if any\r
- */\r
+ // Set environment variables for the process if any\r
Map<String, String> jobEnv = confExec.getEnvironment();\r
if (jobEnv != null && !jobEnv.isEmpty()) {\r
setJobEnvironmentVariables(jobEnv);\r
jobtempl.setArgs(args);\r
}\r
\r
- /*\r
- * If executable need in/out data to be piped into it\r
- */\r
+ //If executable need in/out data to be piped into it\r
if (confExec.getExecutable() instanceof PipedExecutable<?>) {\r
setPipes(confExec);\r
}\r
\r
- /*\r
- * If executable require special cluster configuration parameters to\r
- * be set e.g. queue, ram, time etc\r
- */\r
+ // If executable require special cluster configuration parameters to\r
+ // be set e.g. queue, ram, time etc\r
setNativeSpecs(confExec.getExecutable());\r
\r
-\r
log.trace("using arguments: " + jobtempl.getArgs());\r
this.confExecutable = confExec;\r
// Save run configuration\r
public ConfiguredExecutable<?> waitForResult() throws JobExecutionException {\r
ConfiguredExecutable<?> confExec;\r
try {\r
- confExec = new AsyncJobRunner().getResults(this.jobId);\r
+ confExec = new AsyncClusterRunner().getResults(this.jobId);\r
if (confExec == null) {\r
log.warn("Could not find results of job " + this.jobId);\r
}\r
return getJobStatus(this.jobId);\r
}\r
\r
- public static JobRunner getInstance(ConfiguredExecutable<?> executable)\r
+ public static ClusterRunner getInstance(ConfiguredExecutable<?> executable)\r
throws JobSubmissionException {\r
- return new JobRunner(executable);\r
+ return new ClusterRunner(executable);\r
}\r
\r
} // class end\r