Package org.cloudsimplus.autoscaling
Class VmScalingAbstract
java.lang.Object
org.cloudsimplus.autoscaling.VmScalingAbstract
- All Implemented Interfaces:
VmScaling
- Direct Known Subclasses:
HorizontalVmScalingSimple
,VerticalVmScalingAbstract
An abstract class for implementing
HorizontalVmScaling
and
VerticalVmScaling
.- Since:
- CloudSim Plus 1.1.0
- Author:
- Manoel Campos da Silva Filho
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetVm()
Gets theVm
that this Load Balancer is linked to.protected boolean
isTimeToCheckPredicate
(double time) Checks if it is time to evaluate weather the Vm is under or overloaded.protected abstract boolean
requestUpScaling
(double time) Performs the actual request to scale the Vm up or down, depending on whether it is over or underloaded, respectively.protected void
setLastProcessingTime
(double lastProcessingTime) Sets the last time the scheduler checked for VM overload.void
Sets aVm
to this Load Balancer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.cloudsimplus.autoscaling.VmScaling
requestUpScalingIfPredicateMatches
-
Constructor Details
-
VmScalingAbstract
protected VmScalingAbstract()
-
-
Method Details
-
getVm
Description copied from interface:VmScaling
Gets theVm
that this Load Balancer is linked to. -
setVm
Description copied from interface:VmScaling
Sets aVm
to this Load Balancer. The broker will call this Load Balancer in order to balance load when its Vm is over utilized.When the VmScaling is assigned to a Vm, the Vm sets itself to the VmScaling object, creating an association between the two objects.
-
isTimeToCheckPredicate
protected boolean isTimeToCheckPredicate(double time) Checks if it is time to evaluate weather the Vm is under or overloaded.- Parameters:
time
- current simulation time- Returns:
- true if it's time to check weather the Vm is over and underloaded, false otherwise
-
requestUpScaling
protected abstract boolean requestUpScaling(double time) Performs the actual request to scale the Vm up or down, depending on whether it is over or underloaded, respectively. This method is automatically called byVmScaling.requestUpScalingIfPredicateMatches(org.cloudsimplus.listeners.VmHostEventInfo)
when it is verified that the Vm is over or underloaded.- Parameters:
time
- current simulation time- Returns:
- true if the request was actually sent, false otherwise
-
setLastProcessingTime
protected void setLastProcessingTime(double lastProcessingTime) Sets the last time the scheduler checked for VM overload.- Parameters:
lastProcessingTime
- the processing time to set
-