Ignore:
Timestamp:
10/31/12 13:52:06 (12 years ago)
Author:
wojtekp
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/trunk/build/classes/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java

    r477 r539  
    11package example.localplugin; 
    22 
    3 import gridsim.Gridlet; 
     3import gridsim.dcworms.DCWormsTags; 
    44 
    55import java.util.ArrayList; 
     
    3030import schedframe.scheduling.tasks.WorkloadUnit; 
    3131 
    32 public class FCFSNodePowerManagementClusterLocalPlugin extends BaseLocalPlugin { 
     32public class FCFSNodePowerManagementClusterLocalPlugin extends BaseLocalSchedulingPlugin { 
    3333 
    3434        public FCFSNodePowerManagementClusterLocalPlugin () { 
    3535        } 
    3636 
    37         public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry, 
     37        public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry, 
    3838                        ResourceManager resManager, ModuleList modules) { 
    3939 
    4040                ClusterResourceManager resourceManager = (ClusterResourceManager) resManager; 
    4141                SchedulingPlan plan = new SchedulingPlan(); 
    42                 // chose the events types to serve. 
    43                 // Different actions for different events are possible. 
     42 
    4443                switch (event.getType()) { 
    4544                case START_TASK_EXECUTION: 
    4645                case TASK_FINISHED: 
    47                         // our tasks are placed only in first queue (see 
    48                         // BaseLocalPlugin.placeJobsInQueues() method) 
     46 
    4947                        TaskQueue q = queues.get(0); 
    50                         // check all tasks in queue 
    5148 
    5249                        for (int i = 0; i < q.size(); i++) { 
    53                                 WorkloadUnit<?> job = q.get(i); 
     50                                WorkloadUnit job = q.get(i); 
    5451                                TaskInterface<?> task = (TaskInterface<?>) job; 
    55                                 // if status of the tasks in READY 
    56                                 if (task.getStatus() == Gridlet.READY) { 
     52                                if (task.getStatus() == DCWormsTags.READY) { 
    5753 
    5854                                        Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task); 
     
    6561                                } 
    6662                        } 
    67  
    6863                        turnOffIdleNodes(resourceManager.getComputingNodes()); 
    69  
    7064                        break; 
    7165                } 
     
    151145                return cpuRequest > 0 ? false : true; 
    152146        } 
    153          
    154         public String getName() { 
    155                 return getClass().getName(); 
    156         } 
    157  
    158147 
    159148} 
Note: See TracChangeset for help on using the changeset viewer.