Search in sources :

Example 1 with TaskIdImpl

use of org.ow2.proactive.scheduler.task.TaskIdImpl in project scheduling by ow2-proactive.

the class TaskIdImpl method makeTaskId.

/**
 * Make a new TaskId with the given arguments.
 *
 * @param str the string on which to base the id.
 * @return the new taskId
 */
public static TaskId makeTaskId(String str) {
    String[] strSplitted = str.split("t");
    if (!str.contains("t") || strSplitted.length != 2) {
        throw new IllegalArgumentException("A valid task id must be supplied");
    }
    JobId jobId = JobIdImpl.makeJobId(strSplitted[0]);
    long taskId = Long.parseLong(strSplitted[1]);
    return new TaskIdImpl(jobId, taskId);
}
Also used : JobId(org.ow2.proactive.scheduler.common.job.JobId)

Aggregations

JobId (org.ow2.proactive.scheduler.common.job.JobId)1