use of org.ow2.proactive.scripting.TaskScript in project scheduling by ow2-proactive.
the class TestDataspaceConcurrentKilling method createJobWithFileTransfers.
public Job createJobWithFileTransfers() throws UserException, InvalidScriptException {
TaskFlowJob job = new TaskFlowJob();
job.setName(JOB_NAME);
job.setOnTaskError(OnTaskError.CONTINUE_JOB_EXECUTION);
for (int i = 0; i < NB_TASKS; i++) {
ScriptTask st = new ScriptTask();
st.setName(TASK_NAME + i);
st.setScript(new TaskScript(new SimpleScript("new File(localspace, \"" + FILE_NAME + i + "\").createNewFile(); java.lang.Thread.sleep(1000)", "groovy")));
st.addOutputFiles(FILE_NAME + i, OutputAccessMode.TransferToUserSpace);
job.addTask(st);
}
return job;
}
use of org.ow2.proactive.scripting.TaskScript in project scheduling by ow2-proactive.
the class TestKillTaskWhileExecutingScripts method killEndlessScriptTask.
public void killEndlessScriptTask() throws Throwable {
log("Test : killing an Endless Script Task...");
String tname = "killEndlessScriptTask";
// pre script interruption
TaskFlowJob job = new TaskFlowJob();
job.setName(this.getClass().getSimpleName() + "_" + tname);
ScriptTask task1 = new ScriptTask();
task1.setName(tname);
task1.setScript(new TaskScript(endlessScript));
job.addTask(task1);
submitAndCheckJob(job, tname);
}
use of org.ow2.proactive.scripting.TaskScript in project scheduling by ow2-proactive.
the class RunningTaskRecoveryWithDownNodeTest method submitJob.
private JobId submitJob() throws Exception {
TaskFlowJob job = new TaskFlowJob();
job.setName("JOB-" + RunningTaskRecoveryWithDownNodeTest.class.getSimpleName());
for (int i = 0; i < NUMBER_OF_TASKS; i++) {
ScriptTask st1 = new ScriptTask();
st1.setName(TASK_BASE_NAME + i);
st1.setScript(new TaskScript(new SimpleScript("Thread.sleep(60000)", "groovy")));
job.addTask(st1);
}
JobId jobid = schedulerHelper.submitJob(job);
schedulerHelper.waitForEventJobRunning(jobid);
return jobid;
}
Aggregations