Changeset 481 for DCWoRMS/trunk/src/example/localplugin
- Timestamp:
- 10/08/12 10:23:45 (13 years ago)
- Location:
- DCWoRMS/trunk/src/example/localplugin
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/trunk/src/example/localplugin/BaseLocalSchedulingPlugin.java
r478 r481 10 10 import schedframe.resources.units.ResourceUnit; 11 11 import schedframe.resources.units.ResourceUnitName; 12 import schedframe.scheduling. WorkloadUnitListImpl;12 import schedframe.scheduling.TaskListImpl; 13 13 import schedframe.scheduling.manager.resources.ResourceManager; 14 14 import schedframe.scheduling.manager.tasks.JobRegistryImpl; … … 22 22 import schedframe.scheduling.queue.TaskQueueList; 23 23 import schedframe.scheduling.tasks.TaskInterface; 24 import schedframe.scheduling.tasks.WorkloadUnit;25 24 import schemas.StringValueWithUnit; 26 25 … … 46 45 } 47 46 48 public int place JobsInQueues(WorkloadUnitListImpl newJobs,47 public int placeTasksInQueues(TaskListImpl newTasks, 49 48 TaskQueueList queues, 50 49 ResourceManager resourceManager, ModuleList moduleList) { … … 53 52 TaskQueue queue = queues.get(0); 54 53 55 for(int i = 0; i < new Jobs.size(); i++){56 WorkloadUnit task = newJobs.get(i);54 for(int i = 0; i < newTasks.size(); i++){ 55 TaskInterface<?> task = newTasks.get(i); 57 56 queue.add(task); 58 57 } -
DCWoRMS/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java
r478 r481 1 1 package example.localplugin; 2 2 3 import gridsim.Gridlet; 3 import gridsim.gssim.DCWormsTags; 4 import gssim.schedframe.scheduling.Executable; 4 5 5 6 import java.util.ArrayList; … … 28 29 import schedframe.scheduling.queue.TaskQueue; 29 30 import schedframe.scheduling.queue.TaskQueueList; 30 import schedframe.scheduling.tasks.SubmittedTask;31 31 import schedframe.scheduling.tasks.TaskInterface; 32 32 import schedframe.scheduling.tasks.WorkloadUnit; … … 39 39 } 40 40 41 public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,41 public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry, 42 42 ResourceManager resManager, ModuleList modules) { 43 43 … … 58 58 TaskInterface<?> task = (TaskInterface<?>) job; 59 59 // if status of the tasks in READY 60 if (task.getStatus() == Gridlet.READY) {60 if (task.getStatus() == DCWormsTags.READY) { 61 61 62 62 Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task); … … 76 76 case TASK_FINISHED: 77 77 TaskFinishedEvent finEvent = (TaskFinishedEvent) event; 78 SubmittedTask subTask = (SubmittedTask )jobRegistry.getSubmittedTask(finEvent.getJobId(), finEvent.getTaskId());79 UsedResourceList<ResourceHistoryItem> usedResourcesList = subTask.getUsedResources();78 Executable exec = (Executable) jobRegistry.getExecutable(finEvent.getJobId(), finEvent.getTaskId()); 79 UsedResourceList<ResourceHistoryItem> usedResourcesList = exec.getUsedResources(); 80 80 ProcessingElements pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(StandardResourceUnitName.PE); 81 81 List<Processor> processors = new ArrayList<Processor>(); … … 89 89 case TASK_REQUESTED_TIME_EXPIRED: 90 90 TaskRequestedTimeExpiredEvent timExpEvent = (TaskRequestedTimeExpiredEvent) event; 91 subTask = (SubmittedTask )jobRegistry.getSubmittedTask(timExpEvent.getJobId(), timExpEvent.getTaskId());92 usedResourcesList = subTask.getUsedResources();91 exec = (Executable) jobRegistry.getExecutable(timExpEvent.getJobId(), timExpEvent.getTaskId()); 92 usedResourcesList = exec.getUsedResources(); 93 93 pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(StandardResourceUnitName.PE); 94 94 processors = new ArrayList<Processor>(); … … 101 101 TaskInterface<?> task = (TaskInterface<?>) job; 102 102 // if status of the tasks in READY 103 if (task.getStatus() == Gridlet.READY) {103 if (task.getStatus() == DCWormsTags.READY) { 104 104 105 105 Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task); -
DCWoRMS/trunk/src/example/localplugin/FCFSClusterLocalPlugin.java
r478 r481 1 1 package example.localplugin; 2 2 3 import gridsim. Gridlet;3 import gridsim.gssim.DCWormsTags; 4 4 5 5 import java.util.ArrayList; … … 52 52 TaskInterface<?> task = (TaskInterface<?>) job; 53 53 // if status of the tasks in READY 54 if (task.getStatus() == Gridlet.READY) {54 if (task.getStatus() == DCWormsTags.READY) { 55 55 56 56 /****************3 ways to schedule task****************/ -
DCWoRMS/trunk/src/example/localplugin/FCFSConsolidationClusterLocalPlugin.java
r478 r481 1 1 package example.localplugin; 2 2 3 import gridsim. Gridlet;3 import gridsim.gssim.DCWormsTags; 4 4 5 5 import java.util.ArrayList; … … 35 35 } 36 36 37 public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,37 public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry, 38 38 ResourceManager resManager, ModuleList modules) { 39 39 … … 54 54 TaskInterface<?> task = (TaskInterface<?>) job; 55 55 // if status of the tasks in READY 56 if (task.getStatus() == Gridlet.READY) {56 if (task.getStatus() == DCWormsTags.READY) { 57 57 58 58 Map<ResourceUnitName, ResourceUnit> choosenResources = null; -
DCWoRMS/trunk/src/example/localplugin/FCFSEnergyAwareClusterLocalPlugin.java
r478 r481 1 1 package example.localplugin; 2 2 3 import gridsim. Gridlet;3 import gridsim.gssim.DCWormsTags; 4 4 5 5 import java.util.ArrayList; … … 26 26 } 27 27 28 public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,28 public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry, 29 29 ResourceManager resManager, ModuleList modules) { 30 30 … … 45 45 TaskInterface<?> task = (TaskInterface<?>) job; 46 46 // if status of the tasks in READY 47 if (task.getStatus() == Gridlet.READY) {47 if (task.getStatus() == DCWormsTags.READY) { 48 48 49 49 String nodeName = chooseProviderForExecution(resourceManager, task); -
DCWoRMS/trunk/src/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java
r478 r481 1 1 package example.localplugin; 2 2 3 import gridsim. Gridlet;3 import gridsim.gssim.DCWormsTags; 4 4 5 5 import java.util.ArrayList; … … 35 35 } 36 36 37 public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,37 public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry, 38 38 ResourceManager resManager, ModuleList modules) { 39 39 … … 54 54 TaskInterface<?> task = (TaskInterface<?>) job; 55 55 // if status of the tasks in READY 56 if (task.getStatus() == Gridlet.READY) {56 if (task.getStatus() == DCWormsTags.READY) { 57 57 58 58 Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task); -
DCWoRMS/trunk/src/example/localplugin/FCFSRandomClusterLocalPlugin.java
r478 r481 1 1 package example.localplugin; 2 2 3 import gridsim. Gridlet;3 import gridsim.gssim.DCWormsTags; 4 4 5 5 import java.util.List; … … 47 47 TaskInterface<?> task = (TaskInterface<?>) job; 48 48 // if status of the tasks in READY 49 if (task.getStatus() == Gridlet.READY) {49 if (task.getStatus() == DCWormsTags.READY) { 50 50 /*for(ResourceUnitName key:resManager.getSharedResourceUnits().keySet()){ 51 51 System.out.println(key.getName()); -
DCWoRMS/trunk/src/example/localplugin/FCFS_BFLocalPlugin.java
r478 r481 1 1 package example.localplugin; 2 2 3 import gridsim. Gridlet;3 import gridsim.gssim.DCWormsTags; 4 4 import schedframe.events.scheduling.SchedulingEvent; 5 5 import schedframe.scheduling.manager.resources.ResourceManager; … … 33 33 34 34 // if status of the tasks in READY 35 if (task.getStatus() == Gridlet.READY) {35 if (task.getStatus() == DCWormsTags.READY) { 36 36 addToSchedulingPlan(plan, task); 37 37 } -
DCWoRMS/trunk/src/example/localplugin/RackLocalPlugin.java
r478 r481 1 1 package example.localplugin; 2 2 3 import gridsim. Gridlet;3 import gridsim.gssim.DCWormsTags; 4 4 import schedframe.events.scheduling.SchedulingEvent; 5 5 import schedframe.scheduling.manager.resources.ClusterResourceManager; … … 19 19 } 20 20 21 public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,21 public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry, 22 22 ResourceManager resManager, ModuleList modules) { 23 23 … … 39 39 TaskInterface<?> task = (TaskInterface<?>) job; 40 40 // if status of the tasks in READY 41 if (task.getStatus() == Gridlet.READY) {41 if (task.getStatus() == DCWormsTags.READY) { 42 42 System.out.println(resourceManager.getSchedulers().get(0).get_name()); 43 43 String nodeName = resourceManager.getSchedulers().get(0).get_name();
Note: See TracChangeset
for help on using the changeset viewer.