Ignore:
Timestamp:
10/08/12 10:23:45 (13 years ago)
Author:
wojtekp
Message:
 
Location:
DCWoRMS/trunk/src/example
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/trunk/src/example/globalplugin/BaseGlobalPlugin.java

    r478 r481  
    44import schedframe.PluginConfiguration; 
    55import schedframe.events.scheduling.SchedulingEventType; 
    6 import schedframe.scheduling.WorkloadUnitListImpl; 
     6import schedframe.scheduling.TaskListImpl; 
    77import schedframe.scheduling.manager.resources.ResourceManager; 
    88import schedframe.scheduling.plugin.SchedulingPluginConfiguration; 
     
    1111import schedframe.scheduling.queue.TaskQueue; 
    1212import schedframe.scheduling.queue.TaskQueueList; 
    13 import schedframe.scheduling.tasks.WorkloadUnit; 
     13import schedframe.scheduling.tasks.TaskInterface; 
    1414import schemas.StringValueWithUnit; 
    1515 
     
    2222        } 
    2323         
    24         public int placeJobsInQueues(WorkloadUnitListImpl newJobs, TaskQueueList queues, ResourceManager resourceManager, 
     24        public int placeTasksInQueues(TaskListImpl newTasks, TaskQueueList queues, ResourceManager resourceManager, 
    2525                        ModuleList moduleList) { 
    2626 
     
    2828                TaskQueue queue = queues.get(0); 
    2929 
    30                 for (int i = 0; i < newJobs.size(); i++) { 
    31                         WorkloadUnit task = newJobs.get(i); 
     30                for (int i = 0; i < newTasks.size(); i++) { 
     31                        TaskInterface<?> task = newTasks.get(i); 
    3232                        queue.add(task); 
    3333                } 
  • DCWoRMS/trunk/src/example/globalplugin/GridFCFSLoadBalancingPlugin.java

    r478 r481  
    1919import schedframe.scheduling.plugin.grid.ModuleList; 
    2020import schedframe.scheduling.plugin.grid.ResourceDiscovery; 
     21import schedframe.scheduling.queue.QueueDescription; 
    2122import schedframe.scheduling.queue.TaskQueue; 
    22 import schedframe.scheduling.queue.QueueDescription; 
    2323import schedframe.scheduling.queue.TaskQueueList; 
    2424import schedframe.scheduling.tasks.TaskInterface; 
     
    2929        private Log log = LogFactory.getLog(GridFCFSLoadBalancingPlugin.class); 
    3030         
    31         public SchedulingPlanInterface schedule(SchedulingEvent event, 
     31        public SchedulingPlanInterface<?> schedule(SchedulingEvent event, 
    3232                        TaskQueueList queues,  
    3333                        JobRegistry jobRegistry, 
     
    8383         
    8484        private int findLeastLoadedResourceIdx(List<SchedulerDescription> availableResources){ 
    85                  
    8685                int resourceIdx = -1; 
    8786                long minLoad = Long.MAX_VALUE; 
     87                 
    8888                for(int i = 0; i < availableResources.size(); i++){ 
    8989                        SchedulerDescription sd = availableResources.get(i); 
  • DCWoRMS/trunk/src/example/localplugin/BaseLocalSchedulingPlugin.java

    r478 r481  
    1010import schedframe.resources.units.ResourceUnit; 
    1111import schedframe.resources.units.ResourceUnitName; 
    12 import schedframe.scheduling.WorkloadUnitListImpl; 
     12import schedframe.scheduling.TaskListImpl; 
    1313import schedframe.scheduling.manager.resources.ResourceManager; 
    1414import schedframe.scheduling.manager.tasks.JobRegistryImpl; 
     
    2222import schedframe.scheduling.queue.TaskQueueList; 
    2323import schedframe.scheduling.tasks.TaskInterface; 
    24 import schedframe.scheduling.tasks.WorkloadUnit; 
    2524import schemas.StringValueWithUnit; 
    2625 
     
    4645        } 
    4746         
    48         public int placeJobsInQueues(WorkloadUnitListImpl newJobs, 
     47        public int placeTasksInQueues(TaskListImpl newTasks, 
    4948                        TaskQueueList queues,  
    5049                        ResourceManager resourceManager, ModuleList moduleList) { 
     
    5352                TaskQueue queue = queues.get(0); 
    5453 
    55                 for(int i = 0; i < newJobs.size(); i++){ 
    56                         WorkloadUnit task = newJobs.get(i); 
     54                for(int i = 0; i < newTasks.size(); i++){ 
     55                        TaskInterface<?> task = newTasks.get(i); 
    5756                        queue.add(task); 
    5857                } 
  • DCWoRMS/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java

    r478 r481  
    11package example.localplugin; 
    22 
    3 import gridsim.Gridlet; 
     3import gridsim.gssim.DCWormsTags; 
     4import gssim.schedframe.scheduling.Executable; 
    45 
    56import java.util.ArrayList; 
     
    2829import schedframe.scheduling.queue.TaskQueue; 
    2930import schedframe.scheduling.queue.TaskQueueList; 
    30 import schedframe.scheduling.tasks.SubmittedTask; 
    3131import schedframe.scheduling.tasks.TaskInterface; 
    3232import schedframe.scheduling.tasks.WorkloadUnit; 
     
    3939        } 
    4040 
    41         public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry, 
     41        public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry, 
    4242                        ResourceManager resManager, ModuleList modules) { 
    4343 
     
    5858                                TaskInterface<?> task = (TaskInterface<?>) job; 
    5959                                // if status of the tasks in READY 
    60                                 if (task.getStatus() == Gridlet.READY) { 
     60                                if (task.getStatus() == DCWormsTags.READY) { 
    6161 
    6262                                        Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task); 
     
    7676                case TASK_FINISHED: 
    7777                        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(); 
    8080                        ProcessingElements pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(StandardResourceUnitName.PE); 
    8181                        List<Processor> processors =  new ArrayList<Processor>(); 
     
    8989                case TASK_REQUESTED_TIME_EXPIRED: 
    9090                        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(); 
    9393                        pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(StandardResourceUnitName.PE); 
    9494                        processors =  new ArrayList<Processor>(); 
     
    101101                                TaskInterface<?> task = (TaskInterface<?>) job; 
    102102                                // if status of the tasks in READY 
    103                                 if (task.getStatus() == Gridlet.READY) { 
     103                                if (task.getStatus() == DCWormsTags.READY) { 
    104104 
    105105                                        Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task); 
  • DCWoRMS/trunk/src/example/localplugin/FCFSClusterLocalPlugin.java

    r478 r481  
    11package example.localplugin; 
    22 
    3 import gridsim.Gridlet; 
     3import gridsim.gssim.DCWormsTags; 
    44 
    55import java.util.ArrayList; 
     
    5252                                TaskInterface<?> task = (TaskInterface<?>) job; 
    5353                                // if status of the tasks in READY 
    54                                 if (task.getStatus() == Gridlet.READY) { 
     54                                if (task.getStatus() == DCWormsTags.READY) { 
    5555                                         
    5656                                        /****************3 ways to schedule task****************/ 
  • DCWoRMS/trunk/src/example/localplugin/FCFSConsolidationClusterLocalPlugin.java

    r478 r481  
    11package example.localplugin; 
    22 
    3 import gridsim.Gridlet; 
     3import gridsim.gssim.DCWormsTags; 
    44 
    55import java.util.ArrayList; 
     
    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 
     
    5454                                TaskInterface<?> task = (TaskInterface<?>) job; 
    5555                                // if status of the tasks in READY 
    56                                 if (task.getStatus() == Gridlet.READY) { 
     56                                if (task.getStatus() == DCWormsTags.READY) { 
    5757 
    5858                                        Map<ResourceUnitName, ResourceUnit> choosenResources = null; 
  • DCWoRMS/trunk/src/example/localplugin/FCFSEnergyAwareClusterLocalPlugin.java

    r478 r481  
    11package example.localplugin; 
    22 
    3 import gridsim.Gridlet; 
     3import gridsim.gssim.DCWormsTags; 
    44 
    55import java.util.ArrayList; 
     
    2626        } 
    2727 
    28         public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry, 
     28        public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry, 
    2929                        ResourceManager resManager, ModuleList modules) { 
    3030 
     
    4545                                TaskInterface<?> task = (TaskInterface<?>) job; 
    4646                                // if status of the tasks in READY 
    47                                 if (task.getStatus() == Gridlet.READY) { 
     47                                if (task.getStatus() == DCWormsTags.READY) { 
    4848 
    4949                                        String nodeName = chooseProviderForExecution(resourceManager, task); 
  • DCWoRMS/trunk/src/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java

    r478 r481  
    11package example.localplugin; 
    22 
    3 import gridsim.Gridlet; 
     3import gridsim.gssim.DCWormsTags; 
    44 
    55import java.util.ArrayList; 
     
    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 
     
    5454                                TaskInterface<?> task = (TaskInterface<?>) job; 
    5555                                // if status of the tasks in READY 
    56                                 if (task.getStatus() == Gridlet.READY) { 
     56                                if (task.getStatus() == DCWormsTags.READY) { 
    5757 
    5858                                        Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task); 
  • DCWoRMS/trunk/src/example/localplugin/FCFSRandomClusterLocalPlugin.java

    r478 r481  
    11package example.localplugin; 
    22 
    3 import gridsim.Gridlet; 
     3import gridsim.gssim.DCWormsTags; 
    44 
    55import java.util.List; 
     
    4747                                TaskInterface<?> task = (TaskInterface<?>) job; 
    4848                                // if status of the tasks in READY 
    49                                 if (task.getStatus() == Gridlet.READY) { 
     49                                if (task.getStatus() == DCWormsTags.READY) { 
    5050                                        /*for(ResourceUnitName key:resManager.getSharedResourceUnits().keySet()){ 
    5151                                                System.out.println(key.getName()); 
  • DCWoRMS/trunk/src/example/localplugin/FCFS_BFLocalPlugin.java

    r478 r481  
    11package example.localplugin; 
    22 
    3 import gridsim.Gridlet; 
     3import gridsim.gssim.DCWormsTags; 
    44import schedframe.events.scheduling.SchedulingEvent; 
    55import schedframe.scheduling.manager.resources.ResourceManager; 
     
    3333                                 
    3434                                // if status of the tasks in READY 
    35                                 if (task.getStatus() == Gridlet.READY) { 
     35                                if (task.getStatus() == DCWormsTags.READY) { 
    3636                                        addToSchedulingPlan(plan, task); 
    3737                                } 
  • DCWoRMS/trunk/src/example/localplugin/RackLocalPlugin.java

    r478 r481  
    11package example.localplugin; 
    22 
    3 import gridsim.Gridlet; 
     3import gridsim.gssim.DCWormsTags; 
    44import schedframe.events.scheduling.SchedulingEvent; 
    55import schedframe.scheduling.manager.resources.ClusterResourceManager; 
     
    1919        } 
    2020 
    21         public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry, 
     21        public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry, 
    2222                        ResourceManager resManager, ModuleList modules) { 
    2323 
     
    3939                                TaskInterface<?> task = (TaskInterface<?>) job; 
    4040                                // if status of the tasks in READY 
    41                                 if (task.getStatus() == Gridlet.READY) { 
     41                                if (task.getStatus() == DCWormsTags.READY) { 
    4242                                        System.out.println(resourceManager.getSchedulers().get(0).get_name()); 
    4343                                        String nodeName = resourceManager.getSchedulers().get(0).get_name(); 
Note: See TracChangeset for help on using the changeset viewer.