Ignore:
Timestamp:
11/26/13 11:56:07 (11 years ago)
Author:
wojtekp
Message:
 
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  
    77import org.qcg.broker.schemas.resreqs.types.TaskStatesName; 
    88 
    9 import gridsim.dcworms.DCWormsTags; 
    109 
    1110import java.io.StringWriter; 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Task.java

    r1194 r1207  
    44import java.io.StringWriter; 
    55import java.util.ArrayList; 
    6 import java.util.LinkedList; 
    76import java.util.List; 
    87 
     
    2221import org.qcg.broker.schemas.resreqs.ProcessesResourceRequirements; 
    2322import org.qcg.broker.schemas.resreqs.Requirements; 
    24 import org.qcg.broker.schemas.resreqs.ResourceConsumptionType; 
    2523import org.qcg.broker.schemas.resreqs.TaskResourceRequirements; 
    2624import org.qcg.broker.schemas.resreqs.TimePeriod; 
     
    3129import schedframe.scheduling.WorkloadUnitHandler; 
    3230import schedframe.scheduling.manager.tasks.JobRegistryImpl; 
    33 import schedframe.scheduling.tasks.phases.ResourceConsumption; 
    34 import schedframe.scheduling.tasks.phases.ResourceConsumptionProfile; 
    3531import schedframe.scheduling.tasks.requirements.ResourceParameterName; 
    3632 
     
    7571        private long workloadLogWaitTime; 
    7672         
    77         private ResourceConsumptionProfile resourceConsumptionProfile; 
    7873 
    7974        public Task(org.qcg.broker.schemas.resreqs.Task task){ 
     
    9691        } 
    9792 
    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         
    12194         
    12295        public DateTime getExecutionStartTime() throws NoSuchFieldException { 
     
    310283        } 
    311284         
    312         protected ComputingResourceBaseTypeItem[] getComputingResourceRequirements() throws NoSuchFieldException{ 
     285        public ComputingResourceBaseTypeItem[] getComputingResourceRequirements() throws NoSuchFieldException{ 
    313286                 
    314287                Requirements req = this.task.getRequirements(); 
     
    450423        public void setLength(long length) { 
    451424                this.length = length; 
    452                 preparePhases(); 
    453425        } 
    454426 
     
    515487                wuh.handleTask(this); 
    516488        } 
    517          
    518         public ResourceConsumptionProfile getResourceConsumptionProfile(){ 
    519                 return resourceConsumptionProfile; 
    520         } 
    521          
     489 
    522490        public String getApplicationName(){ 
    523491                try{ 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/TaskInterface.java

    r1190 r1207  
    77 
    88import schedframe.DescriptionContainer; 
    9 import schedframe.scheduling.tasks.phases.ResourceConsumptionProfile; 
    109import schedframe.scheduling.tasks.requirements.ResourceParameterName; 
    1110 
     
    111110        public long getWorkloadLogWaitTime(); 
    112111         
    113         public ResourceConsumptionProfile getResourceConsumptionProfile(); 
     112        //public ResourceConsumptionProfile getResourceConsumptionProfile(); 
    114113         
    115114        public String getApplicationName(); 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ResourceConsumption.java

    r1129 r1207  
    99import org.qcg.broker.schemas.resreqs.ComputingResourceParameterType; 
    1010import org.qcg.broker.schemas.resreqs.PhaseBehaviourType; 
    11 import org.qcg.broker.schemas.resreqs.ReferenceType; 
     11import org.qcg.broker.schemas.resreqs.StringParameterType; 
     12 
    1213import org.qcg.broker.schemas.resreqs.ResourceConsumptionType; 
    1314 
     
    3637        if(resConsumptionType.getReferenceHardware() != null){ 
    3738                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()); 
    4041                } 
    4142        } 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ResourceConsumptionProfile.java

    r896 r1207  
    22 
    33import java.util.LinkedList; 
    4 import java.util.List; 
    54 
    65public class ResourceConsumptionProfile { 
    76         
    87        protected LinkedList<ResourceConsumption> resourceConsumptionList; 
    9         protected int currentPhase; 
     8        protected long usefulWork; 
     9        private int currentPhase; 
    1010         
    1111        public ResourceConsumptionProfile() { 
     
    3737                this.currentPhase = currentPhase; 
    3838        } 
     39 
     40        public long getUsefulWork() { 
     41                return usefulWork; 
     42        } 
     43 
     44        public void setUsefulWork(long usefulWork) { 
     45                this.usefulWork = usefulWork; 
     46        } 
    3947} 
Note: See TracChangeset for help on using the changeset viewer.