Commit 08313dee authored by Eduardo Falcão's avatar Eduardo Falcão
Browse files

fixing allocation variable of shared provisioner

parent 887a7ae9
......@@ -118,16 +118,21 @@ public class ResourceProvisionerShared extends ResourceProvisionerAbstract {
class VmRequestedAllocated implements Comparable<VmRequestedAllocated>{
private Vm vm;
private Long prevAllocated, requested, newCapacity;
private long prevAllocated, requested, newCapacity;
public VmRequestedAllocated(Vm vm, Long requested, Long newCapacity) {
public VmRequestedAllocated(Vm vm, long requested, long newCapacity) {
super();
this.vm = vm;
this.requested = requested;
this.prevAllocated = requested;
this.prevAllocated = vm.getResource(getResourceClass()).getAllocatedResource();
this.newCapacity = newCapacity;
}
@Override
public String toString() {
return "Vm id="+vm.getId()+", requested="+requested+", prevAllocated="+prevAllocated+", newCapacity="+newCapacity;
}
@Override
public boolean equals(Object obj) {
return vm.equals(obj);
......@@ -151,7 +156,7 @@ public class ResourceProvisionerShared extends ResourceProvisionerAbstract {
this.vm = vm;
}
public Long getRequested() {
public long getRequested() {
return requested;
}
......@@ -163,19 +168,19 @@ public class ResourceProvisionerShared extends ResourceProvisionerAbstract {
this.requested -= requested;
}
public Long getNewCapacity() {
public long getNewCapacity() {
return newCapacity;
}
public void setNewCapacity(Long newCapacity) {
public void setNewCapacity(long newCapacity) {
this.newCapacity = newCapacity;
}
public void addNewCapacity(Long extraCapacity) {
public void addNewCapacity(long extraCapacity) {
this.newCapacity += extraCapacity;
}
public Long getPrevAllocated() {
public long getPrevAllocated() {
return prevAllocated;
}
......
......@@ -203,7 +203,7 @@ public final class VmCreationFailureIntegrationTest {
final BrokerBuilderDecorator brokerBuilder = scenario.getBrokerBuilder().createBroker();
brokerBuilder.getVmBuilder()
.setRam(512).setBw(1000).setIops(100)
.setRam(512).setBw(1000).setIops(1000)
.setPes(1).setMips(1000).setSize(10000)
.setCloudletSchedulerSupplier(() -> new CloudletSchedulerSpaceShared())
.setOnHostAllocationListener(evt -> onHostAllocation(evt))
......
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