*
* @param events the events to be read and used by the scheduler
*/
- private void handleEvents(HashMap<EventType, LinkedList<SchedulerEvent>> events) {
+ protected void handleEvents(HashMap<EventType, LinkedList<SchedulerEvent>> events) {
if (events.containsKey(EventType.endApplication))
handleEndEvents(events.get(EventType.endApplication));
if (events.containsKey(EventType.endOutsourcedApplication))
handleOutsourcedStartEvents(events.get(EventType.startOutsourcedApplication));
if (events.containsKey(EventType.startApplication))
handleStartEvents(events.get(EventType.startApplication));
- runMigration();
}
protected void handleDelayedApps() {
protected abstract void handleStartEvents(LinkedList<SchedulerEvent> events);
- protected abstract void runMigration();
-
/**
* handle running of outsourced apps.
*
import java.io.File;
import java.io.IOException;
+import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import at.ac.tuwien.lsdc.types.Application;
import at.ac.tuwien.lsdc.types.PhysicalMachine;
import at.ac.tuwien.lsdc.types.ScenarioType;
+import at.ac.tuwien.lsdc.types.SchedulerEvent;
+import at.ac.tuwien.lsdc.types.SchedulerEvent.EventType;
import at.ac.tuwien.lsdc.types.VirtualMachine;
public abstract class AbstractSchedulerWithMigration extends AbstractScheduler {
super(numPMs, numCloudPartners, schedulerLog, scenario);
}
+ @Override
+ protected void handleEvents(HashMap<EventType, LinkedList<SchedulerEvent>> events) {
+ super.handleEvents(events);
+ runMigration();
+ }
+
/**
* Check if we can free up a VM to shut it down.
*/
- @Override
protected void runMigration() {
List<PhysicalMachine> pms = manager.getSortedPMs();
// iterate through all the PMs (except the one with the highest utilization)
}
- @Override
- protected void runMigration() {
- // Scheduler A doesn't support Migration, nothing to do here
- }
-
// sorting applications by amount of resources (descending)
private List<Application> sortApps(LinkedList<SchedulerEvent> events) {
List<Application> sortedApps = new LinkedList<Application>();