From 0f8010ba0459e43a78a98284854009dcc73cccb4 Mon Sep 17 00:00:00 2001 From: Andreas Egger Date: Mon, 24 Jun 2013 23:23:28 +0200 Subject: [PATCH] Restoring the original state (migration) --- .../lsdc/sched/AbstractSchedulerWithMigration.java | 3 ++- src/at/ac/tuwien/lsdc/sched/SchedulerB.java | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/at/ac/tuwien/lsdc/sched/AbstractSchedulerWithMigration.java b/src/at/ac/tuwien/lsdc/sched/AbstractSchedulerWithMigration.java index afe7484..56d204e 100644 --- a/src/at/ac/tuwien/lsdc/sched/AbstractSchedulerWithMigration.java +++ b/src/at/ac/tuwien/lsdc/sched/AbstractSchedulerWithMigration.java @@ -23,7 +23,7 @@ public abstract class AbstractSchedulerWithMigration extends AbstractScheduler { @Override protected void handleEvents(HashMap> events) { super.handleEvents(events); -// runMigration(); + runMigration(); } /** @@ -47,6 +47,7 @@ public abstract class AbstractSchedulerWithMigration extends AbstractScheduler { .next(); if (deployApp(nextVM, app)) { currentVM.stopApplication(app); +// currentVM.resizeDown(app); break; } } diff --git a/src/at/ac/tuwien/lsdc/sched/SchedulerB.java b/src/at/ac/tuwien/lsdc/sched/SchedulerB.java index f0b6d9f..7079c64 100644 --- a/src/at/ac/tuwien/lsdc/sched/SchedulerB.java +++ b/src/at/ac/tuwien/lsdc/sched/SchedulerB.java @@ -46,7 +46,7 @@ public class SchedulerB extends AbstractSchedulerWithMigration { @Override protected boolean deployApp(VirtualMachine vm, Application app) { -// VirtualMachine current = app.getRunningOn(); + VirtualMachine current = app.getRunningOn(); boolean deployed = false; if (!vm.enoughResources(app)) { try { @@ -59,10 +59,10 @@ public class SchedulerB extends AbstractSchedulerWithMigration { if (deployed) { app.setRunningOn(vm); insertStopEvent(currTime + app.getDuration(), app); -// if (current != null) { -// current.stopApplication(app); -// current.resizeDown(app); -// } + if (current != null) { + current.stopApplication(app); + current.resizeDown(app); + } } return deployed; } -- 2.43.0