use of org.ow2.proactive.scheduler.common.exception.SubmissionClosedException in project scheduling by ow2-proactive.
the class SchedulerFrontendState method jobSubmitted.
synchronized void jobSubmitted(InternalJob job, UserIdentificationImpl ident) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException {
// put the job inside the frontend management list
jobs.put(job.getId(), new IdentifiedJob(job.getId(), ident, job.getGenericInformation()));
// increase number of submit for this user
ident.addSubmit();
// send update user event
usersUpdated(new NotificationData<UserIdentification>(SchedulerEvent.USERS_UPDATE, ident));
jlogger.info(job.getId(), "submitted: name '" + job.getName() + "', tasks '" + job.getTotalNumberOfTasks() + "', owner '" + job.getOwner() + "'");
try {
jlogger.info(job.getId(), job.display());
} catch (Exception e) {
jlogger.error(job.getId(), "Error while displaying the job :", e);
}
}
use of org.ow2.proactive.scheduler.common.exception.SubmissionClosedException in project scheduling by ow2-proactive.
the class SchedulerClient method submit.
@Override
public JobId submit(Job job) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException {
JobIdData jobIdData = null;
try {
InputStream is = (new Job2XMLTransformer()).jobToxml((TaskFlowJob) job);
jobIdData = restApiClient().submitXml(sid, is);
} catch (Exception e) {
throwNCEOrPEOrSCEOrJCE(e);
}
return jobId(jobIdData);
}
use of org.ow2.proactive.scheduler.common.exception.SubmissionClosedException in project scheduling by ow2-proactive.
the class AbstractSmartProxy method submit.
/**
* Submits a job to the scheduler and handle data transfer via the SmartProxy
*
* @param job job to submit
* @param localInputFolderPath path to the local directory containing input files
* @param pushUrl url of the dataspace server used to push input files to
* @param localOutputFolderPath path to the local directory which will contain output files
* @param pullUrl url of the dataspace server used to pull output files from
* @param isolateTaskOutputs if set to true, output files from each tasks will be isolated from each other in the dataspace server (to prevent overlapping)
* @param automaticTransfer if set to true, output files will be automatically transferred from the dataspace server to the local machine as soon as the task is finished.
* If set to false, the files will not be automatically transferred and a call to pullData must be done to transfer files
* @return the new job id
* @throws Exception
* @throws SubmissionClosedException
* @throws JobCreationException
*/
public JobId submit(TaskFlowJob job, String localInputFolderPath, String pushUrl, String localOutputFolderPath, String pullUrl, boolean isolateTaskOutputs, boolean automaticTransfer) throws Exception, SubmissionClosedException, JobCreationException {
checkInitialized();
if (isNullOrEmpty(pushUrl)) {
pushUrl = getLocalUserSpace();
}
if (isNullOrEmpty(pullUrl)) {
pullUrl = getLocalUserSpace();
}
String newFolderName = createNewFolderName();
String pushUrlUpdate = prepareJobInput(job, localInputFolderPath, pushUrl, newFolderName);
String pullUrlUpdate = prepareJobOutput(job, localOutputFolderPath, pullUrl, newFolderName, isolateTaskOutputs);
uploadInputfiles(job, localInputFolderPath);
JobId id = null;
try {
id = submit(job);
} catch (Exception e) {
log.error("Error while submitting job", e);
try {
removeJobIO(job, pushUrl, pullUrl, newFolderName);
} catch (Exception e2) {
log.error("Error while removing job IO", e2);
}
propagateIfInstanceOf(e, NotConnectedException.class);
propagateIfInstanceOf(e, PermissionException.class);
propagateIfInstanceOf(e, SubmissionClosedException.class);
propagateIfInstanceOf(e, JobCreationException.class);
propagateIfInstanceOf(e, RuntimeException.class);
propagate(e);
}
HashMap<String, AwaitedTask> awaitedTaskMap = new HashMap<>();
for (Task t : job.getTasks()) {
awaitedTaskMap.put(t.getName(), new AwaitedTask(t.getName(), t.getOutputFilesList()));
}
AwaitedJob awaitedJob = new AwaitedJob(id.toString(), localInputFolderPath, job.getInputSpace(), pushUrlUpdate, localOutputFolderPath, job.getOutputSpace(), pullUrlUpdate, isolateTaskOutputs, automaticTransfer, awaitedTaskMap);
jobTracker.putAwaitedJob(id.toString(), awaitedJob);
return id;
}
Aggregations