[477] | 1 | package schedframe.scheduling.tasks; |
---|
| 2 | |
---|
| 3 | import java.util.List; |
---|
| 4 | |
---|
| 5 | import org.joda.time.DateTime; |
---|
| 6 | import org.joda.time.ReadableDuration; |
---|
| 7 | |
---|
[539] | 8 | import schedframe.DescriptionContainer; |
---|
[477] | 9 | import schedframe.scheduling.tasks.requirements.ResourceParameterName; |
---|
| 10 | |
---|
| 11 | |
---|
| 12 | /** |
---|
| 13 | * |
---|
| 14 | * @author Marcin Krystek |
---|
| 15 | * |
---|
| 16 | */ |
---|
[539] | 17 | public interface TaskInterface<T> extends WorkloadUnit, DescriptionContainer<T> { |
---|
[477] | 18 | |
---|
| 19 | /** |
---|
| 20 | * |
---|
| 21 | * @return task identifier |
---|
| 22 | */ |
---|
[539] | 23 | //public abstract String getId(); |
---|
[477] | 24 | |
---|
| 25 | /** |
---|
| 26 | * |
---|
| 27 | * @return job identifier. This is the id of the job which contains this task |
---|
| 28 | */ |
---|
| 29 | public abstract String getJobId(); |
---|
| 30 | |
---|
| 31 | /** |
---|
| 32 | * |
---|
| 33 | * @return user identifier. This is id (distinguish name) of the user who has |
---|
| 34 | * submitted this task. |
---|
| 35 | */ |
---|
[539] | 36 | public abstract String getUserDN(); |
---|
[477] | 37 | |
---|
| 38 | /** |
---|
| 39 | * |
---|
| 40 | * @return time when this task was submitted |
---|
| 41 | */ |
---|
| 42 | public abstract DateTime getSubmissionTimeToBroker(); |
---|
| 43 | |
---|
| 44 | /** |
---|
| 45 | * |
---|
| 46 | * @return the earliest time when the execution of this task can be started |
---|
| 47 | * @throws NoSuchFieldException if value is not specified |
---|
| 48 | */ |
---|
| 49 | public abstract DateTime getExecutionStartTime() throws NoSuchFieldException; |
---|
| 50 | |
---|
| 51 | /** |
---|
| 52 | * |
---|
| 53 | * @return the latest time when the execution of this task must be ended |
---|
| 54 | * @throws NoSuchFieldException if value is not specified |
---|
| 55 | */ |
---|
| 56 | public abstract DateTime getExecutionEndTime() throws NoSuchFieldException; |
---|
| 57 | |
---|
| 58 | /** |
---|
| 59 | * |
---|
| 60 | * @return user expectation about how long it will take to execute this task |
---|
| 61 | * @throws NoSuchFieldException if value is not specified |
---|
| 62 | */ |
---|
| 63 | public abstract ReadableDuration getExpectedDuration() throws NoSuchFieldException; |
---|
| 64 | |
---|
| 65 | /** |
---|
| 66 | * |
---|
| 67 | * @param parameterName name of the task resource requirement |
---|
| 68 | * @return value of the numeral parameter which describes task resource requirement |
---|
| 69 | * @throws NoSuchFieldException if such parameter is not defined |
---|
| 70 | * @throws IllegalArgumentException if requested parameter is String value |
---|
| 71 | */ |
---|
| 72 | public abstract double getParameterDoubleValue(ResourceParameterName parameterName) |
---|
| 73 | throws NoSuchFieldException, IllegalArgumentException; |
---|
| 74 | |
---|
| 75 | /** |
---|
| 76 | * |
---|
| 77 | * @param parameterName name of the task resource requirement |
---|
| 78 | * @return value of the String parameter which describes task resource requirement |
---|
| 79 | * @throws NoSuchFieldException if such parameter is not defined |
---|
| 80 | * @throws IllegalArgumentException if requested parameter is Double value |
---|
| 81 | */ |
---|
| 82 | public abstract String getParameterStringValue(ResourceParameterName parameterName) |
---|
| 83 | throws NoSuchFieldException, IllegalArgumentException; |
---|
| 84 | |
---|
| 85 | /** |
---|
| 86 | * |
---|
| 87 | * @return length measured in instructions. |
---|
| 88 | */ |
---|
| 89 | public long getLength(); |
---|
[539] | 90 | |
---|
[477] | 91 | /** |
---|
| 92 | * |
---|
| 93 | * @return constant which represent current task status |
---|
| 94 | */ |
---|
[539] | 95 | //public int getStatus(); |
---|
[477] | 96 | |
---|
| 97 | |
---|
| 98 | public List<AbstractProcessesGroup> getProcessesGroups(); |
---|
| 99 | |
---|
| 100 | public List<AbstractProcesses> getProcesses(); |
---|
| 101 | |
---|
| 102 | public List<AbstractProcesses> getProcesses(AbstractProcessesGroup processGroup); |
---|
| 103 | |
---|
[539] | 104 | //public void setStatus(int status) throws Exception; |
---|
[477] | 105 | |
---|
| 106 | public double getCpuCntRequest() throws NoSuchFieldException; |
---|
| 107 | |
---|
| 108 | public double getMemoryRequest() throws NoSuchFieldException; |
---|
| 109 | |
---|
| 110 | public long getWorkloadLogWaitTime(); |
---|
[539] | 111 | |
---|
[477] | 112 | |
---|
| 113 | } |
---|