Commit 7b304c2e authored by Eduardo Falcão's avatar Eduardo Falcão
Browse files

fixing cloudlet scheduler bug (the one we thought was a bug in sharedProvisioner)

parent acb5d106
......@@ -81,14 +81,14 @@ public class ResourceProvisionerShared extends ResourceProvisionerAbstract {
This way, if the resource is not found inside the VM
and it is a Pe, it's OK (as it is expected)
*/
//if(!getResource().isObjectSubClassOf(Pe.class) && !vm.getResource(getResourceClass()).setCapacity(newTotalVmResourceCapacity)){
// return false;
//}
if(!getResource().isObjectSubClassOf(Pe.class) && !vm.getResource(getResourceClass()).setCapacity(newTotalVmResourceCapacity)){
return false;
}
//Allocates the requested resource from the physical resource
getResource().allocateResource(newTotalVmResourceCapacity);
getResourceAllocationMap().put(vm, newTotalVmResourceCapacity);
vm.getResource(getResourceClass()).setAllocatedResource(newTotalVmResourceCapacity);
vm.getResource(getResourceClass()).setAllocatedResource(prevVmResourceAllocation);
return true;
}
}
......
......@@ -66,9 +66,9 @@ public class ResourceProvisionerSimple extends ResourceProvisionerAbstract {
This way, if the resource is not found inside the VM
and it is a Pe, it's OK (as it is expected)
*/
// if(!getResource().isObjectSubClassOf(Pe.class) && !vm.getResource(getResourceClass()).setCapacity(newTotalVmResourceCapacity)){
// return false;
// }
if(!getResource().isObjectSubClassOf(Pe.class) && !vm.getResource(getResourceClass()).setCapacity(newTotalVmResourceCapacity)){
return false;
}
//Allocates the requested resource from the physical resource
getResource().allocateResource(newTotalVmResourceCapacity);
......
......@@ -597,8 +597,6 @@ public abstract class CloudletSchedulerAbstract implements CloudletScheduler {
protected void updateCloudletProcessing(final CloudletExecution ce, final double currentTime) {
final long executedInstructions = cloudletExecutedInstructionsForElapsedTime(ce, currentTime);
final long executedIops = cloudletExecutedIopsForElapsedTime(ce, currentTime);
Log.printLine(executedInstructions);
Log.printLine(executedIops);
ce.updateProcessing(executedInstructions, executedIops);
}
......
......@@ -209,8 +209,8 @@ public abstract class VmSchedulerAbstract implements VmScheduler {
@Override
public double getAllocatedIops(final Vm vm) {
final double iops = vm.getIops().getCapacity();
// final double iops = vm.getIops().getCapacity();
final double iops = vm.getIops().getAllocatedResource();
return iops;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment