- Timestamp:
- 11/26/13 11:56:07 (11 years ago)
- Location:
- DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Job.java
r1159 r1207 7 7 import org.qcg.broker.schemas.resreqs.types.TaskStatesName; 8 8 9 import gridsim.dcworms.DCWormsTags;10 9 11 10 import java.io.StringWriter; -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Task.java
r1194 r1207 4 4 import java.io.StringWriter; 5 5 import java.util.ArrayList; 6 import java.util.LinkedList;7 6 import java.util.List; 8 7 … … 22 21 import org.qcg.broker.schemas.resreqs.ProcessesResourceRequirements; 23 22 import org.qcg.broker.schemas.resreqs.Requirements; 24 import org.qcg.broker.schemas.resreqs.ResourceConsumptionType;25 23 import org.qcg.broker.schemas.resreqs.TaskResourceRequirements; 26 24 import org.qcg.broker.schemas.resreqs.TimePeriod; … … 31 29 import schedframe.scheduling.WorkloadUnitHandler; 32 30 import schedframe.scheduling.manager.tasks.JobRegistryImpl; 33 import schedframe.scheduling.tasks.phases.ResourceConsumption;34 import schedframe.scheduling.tasks.phases.ResourceConsumptionProfile;35 31 import schedframe.scheduling.tasks.requirements.ResourceParameterName; 36 32 … … 75 71 private long workloadLogWaitTime; 76 72 77 private ResourceConsumptionProfile resourceConsumptionProfile;78 73 79 74 public Task(org.qcg.broker.schemas.resreqs.Task task){ … … 96 91 } 97 92 98 private void preparePhases() { 99 LinkedList<ResourceConsumption> resourceConsumptionList = new LinkedList<ResourceConsumption>(); 100 101 if(task.getExecution() == null || task.getExecution().getResourceConsumptionProfile() == null){ 102 ResourceConsumption resConsumption = null; 103 try { 104 resConsumption = new ResourceConsumption(this.length, getComputingResourceRequirements()); 105 } catch (NoSuchFieldException e) { 106 // TODO Auto-generated catch block 107 e.printStackTrace(); 108 } 109 resourceConsumptionList.add(resConsumption); 110 } 111 else{ 112 for(ResourceConsumptionType resConsumption: task.getExecution().getResourceConsumptionProfile().getResourceConsumption()){ 113 ResourceConsumption resourceConsumption = new ResourceConsumption(resConsumption); 114 resourceConsumptionList.add(resourceConsumption); 115 } 116 } 117 this.resourceConsumptionProfile = new ResourceConsumptionProfile(resourceConsumptionList); 118 119 // System.out.println("======"+task.getExecution().getExecutable().getApplication().getName()); 120 } 93 121 94 122 95 public DateTime getExecutionStartTime() throws NoSuchFieldException { … … 310 283 } 311 284 312 p rotectedComputingResourceBaseTypeItem[] getComputingResourceRequirements() throws NoSuchFieldException{285 public ComputingResourceBaseTypeItem[] getComputingResourceRequirements() throws NoSuchFieldException{ 313 286 314 287 Requirements req = this.task.getRequirements(); … … 450 423 public void setLength(long length) { 451 424 this.length = length; 452 preparePhases();453 425 } 454 426 … … 515 487 wuh.handleTask(this); 516 488 } 517 518 public ResourceConsumptionProfile getResourceConsumptionProfile(){ 519 return resourceConsumptionProfile; 520 } 521 489 522 490 public String getApplicationName(){ 523 491 try{ -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/TaskInterface.java
r1190 r1207 7 7 8 8 import schedframe.DescriptionContainer; 9 import schedframe.scheduling.tasks.phases.ResourceConsumptionProfile;10 9 import schedframe.scheduling.tasks.requirements.ResourceParameterName; 11 10 … … 111 110 public long getWorkloadLogWaitTime(); 112 111 113 public ResourceConsumptionProfile getResourceConsumptionProfile();112 //public ResourceConsumptionProfile getResourceConsumptionProfile(); 114 113 115 114 public String getApplicationName(); -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ResourceConsumption.java
r1129 r1207 9 9 import org.qcg.broker.schemas.resreqs.ComputingResourceParameterType; 10 10 import org.qcg.broker.schemas.resreqs.PhaseBehaviourType; 11 import org.qcg.broker.schemas.resreqs.ReferenceType; 11 import org.qcg.broker.schemas.resreqs.StringParameterType; 12 12 13 import org.qcg.broker.schemas.resreqs.ResourceConsumptionType; 13 14 … … 36 37 if(resConsumptionType.getReferenceHardware() != null){ 37 38 for (int i = 0; i < resConsumptionType.getReferenceHardware().getReference().length; i++){ 38 ReferenceType rt = resConsumptionType.getReferenceHardware().getReference(i);39 referenceHardware.put( rt.getName(), rt.getContent());39 StringParameterType spt = resConsumptionType.getReferenceHardware().getReference(i); 40 referenceHardware.put(spt.getName(), spt.getContent()); 40 41 } 41 42 } -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ResourceConsumptionProfile.java
r896 r1207 2 2 3 3 import java.util.LinkedList; 4 import java.util.List;5 4 6 5 public class ResourceConsumptionProfile { 7 6 8 7 protected LinkedList<ResourceConsumption> resourceConsumptionList; 9 protected int currentPhase; 8 protected long usefulWork; 9 private int currentPhase; 10 10 11 11 public ResourceConsumptionProfile() { … … 37 37 this.currentPhase = currentPhase; 38 38 } 39 40 public long getUsefulWork() { 41 return usefulWork; 42 } 43 44 public void setUsefulWork(long usefulWork) { 45 this.usefulWork = usefulWork; 46 } 39 47 }
Note: See TracChangeset
for help on using the changeset viewer.