- Timestamp:
- 10/31/12 13:52:06 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/trunk/build/classes/example/localplugin/FCFS_BFLocalPlugin.java
r477 r539 1 1 package example.localplugin; 2 2 3 import gridsim. Gridlet;3 import gridsim.dcworms.DCWormsTags; 4 4 import schedframe.events.scheduling.SchedulingEvent; 5 5 import schedframe.scheduling.manager.resources.ResourceManager; 6 6 import schedframe.scheduling.manager.tasks.JobRegistry; 7 import schedframe.scheduling.plan.SchedulingPlanInterface;8 7 import schedframe.scheduling.plan.impl.SchedulingPlan; 9 8 import schedframe.scheduling.plugin.grid.ModuleList; … … 13 12 import schedframe.scheduling.tasks.WorkloadUnit; 14 13 15 public class FCFS_BFLocalPlugin extends BaseLocal Plugin {14 public class FCFS_BFLocalPlugin extends BaseLocalSchedulingPlugin { 16 15 17 public SchedulingPlan Interface<?>schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,16 public SchedulingPlan schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry, 18 17 ResourceManager resManager, ModuleList modules) { 19 18 20 19 SchedulingPlan plan = new SchedulingPlan(); 21 // chose the events types to serve. 22 // Different actions for different events are possible. 20 // Chose the events types to serve. Different actions for different events are possible. 23 21 switch (event.getType()) { 24 22 case START_TASK_EXECUTION: 25 23 case TASK_FINISHED: 26 //case TIMER:24 27 25 // our tasks are placed only in first queue (see BaseLocalPlugin.placeJobsInQueues() method) 26 TaskQueue q = queues.get(0); 28 27 29 TaskQueue q = queues.get(0);30 28 // check all tasks in queue 31 29 for (int i = 0; i < q.size(); i++) { 32 WorkloadUnit <?>job = q.get(i);30 WorkloadUnit job = q.get(i); 33 31 TaskInterface<?> task = (TaskInterface<?>) job; 34 32 35 33 // if status of the tasks in READY 36 if (task.getStatus() == Gridlet.READY) {34 if (task.getStatus() == DCWormsTags.READY) { 37 35 addToSchedulingPlan(plan, task); 38 36 } … … 43 41 } 44 42 45 public String getName() {46 return getClass().getName();47 }48 49 50 43 } 51 44
Note: See TracChangeset
for help on using the changeset viewer.