Class DatacenterBrokerSimple
- All Implemented Interfaces:
Cloneable
,Comparable<SimEntity>
,Runnable
,DatacenterBroker
,Identifiable
,Nameable
,SimEntity
- Direct Known Subclasses:
DatacenterBrokerBestFit
,DatacenterBrokerFirstFit
,DatacenterBrokerHeuristic
public class DatacenterBrokerSimple extends DatacenterBrokerAbstract
DatacenterBroker
that try to host customer's VMs
at the first Datacenter found. If there isn't capacity in that one,
it will try the other ones.
The default selection of VMs for each cloudlet is based on a Round-Robin policy,
cyclically selecting the next VM from the broker VM list for each requesting
cloudlet.
However, when selection of the closest datacenter
is enabled, the broker will try to place each VM at the closest Datacenter as possible,
according to their timezone.
Such a policy doesn't check if the selected VM is really suitable for the Cloudlet and may not provide an optimal mapping.
- Since:
- CloudSim Toolkit 1.0
- Author:
- Rodrigo N. Calheiros, Anton Beloglazov, Manoel Campos da Silva Filho
- See Also:
DatacenterBrokerFirstFit
,DatacenterBrokerBestFit
,DatacenterBrokerHeuristic
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cloudbus.cloudsim.core.SimEntity
SimEntity.State
-
Field Summary
Fields inherited from class org.cloudbus.cloudsim.brokers.DatacenterBrokerAbstract
SHUTDOWN
Fields inherited from interface org.cloudbus.cloudsim.brokers.DatacenterBroker
DEF_VM_DESTRUCTION_DELAY, LOGGER, NULL
-
Constructor Summary
Constructors Constructor Description DatacenterBrokerSimple(CloudSim simulation)
Creates a new DatacenterBroker.DatacenterBrokerSimple(CloudSim simulation, String name)
Creates a DatacenterBroker giving a specific name. -
Method Summary
Modifier and Type Method Description protected Datacenter
defaultDatacenterMapper(Datacenter lastDatacenter, Vm vm)
The default policy used to select a Datacenter to runwaiting VMs
.protected Vm
defaultVmMapper(Cloudlet cloudlet)
The default policy used to select a VM to execute a given Cloudlet.Methods inherited from class org.cloudbus.cloudsim.brokers.DatacenterBrokerAbstract
addOnVmsCreatedListener, bindCloudletToVm, closestDatacenterMapper, destroyVm, getCloudletCreatedList, getCloudletFinishedList, getCloudletSubmittedList, getCloudletWaitingList, getDatacenter, getDatacenterList, getVmCreatedList, getVmCreationAcks, getVmCreationRequests, getVmDestructionDelayFunction, getVmExecList, getVmFailedList, getVmFromCreatedList, getVmsNumber, getVmWaitingList, getWaitingVm, isRetryFailedVms, isSelectClosestDatacenter, isShutdownWhenIdle, processEvent, removeOnVmsCreatedListener, requestDatacentersToCreateWaitingCloudlets, requestIdleVmDestruction, requestShutdownWhenIdle, setCloudletComparator, setDatacenterMapper, setRetryFailedVms, setSelectClosestDatacenter, setShutdownWhenIdle, setVmComparator, setVmDestructionDelay, setVmDestructionDelayFunction, setVmMapper, shutdown, startInternal, submitCloudlet, submitCloudletList, submitCloudletList, submitCloudletList, submitCloudletList, submitVm, submitVmList, submitVmList, toString
Methods inherited from class org.cloudbus.cloudsim.core.CloudSimEntity
cancelEvent, clone, compareTo, equals, getId, getName, getNextEvent, getNextEvent, getShutdownTime, getSimulation, getStartTime, getState, hashCode, isAlive, isFinished, isStarted, pause, run, run, schedule, schedule, schedule, schedule, schedule, schedule, scheduleFirst, scheduleFirst, scheduleFirstNow, scheduleFirstNow, scheduleNow, scheduleNow, selectEvent, send, send, sendNow, sendNow, setEventBuffer, setId, setName, setSimulation, setState, start, waitForEvent
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface org.cloudbus.cloudsim.core.Identifiable
getId
Methods inherited from interface org.cloudbus.cloudsim.core.SimEntity
getShutdownTime, getSimulation, getStartTime, getState, isAlive, isFinished, isStarted, run, schedule, schedule, schedule, schedule, schedule, schedule, schedule, setName, setSimulation, setState, start
-
Constructor Details
-
DatacenterBrokerSimple
Creates a new DatacenterBroker.- Parameters:
simulation
- the CloudSim instance that represents the simulation the Entity is related to
-
DatacenterBrokerSimple
Creates a DatacenterBroker giving a specific name.- Parameters:
simulation
- the CloudSim instance that represents the simulation the Entity is related toname
- the DatacenterBroker name
-
-
Method Details
-
defaultDatacenterMapper
The default policy used to select a Datacenter to runwaiting VMs
.It applies a Round-Robin policy to cyclically select the next Datacenter from the list. However, it just moves to the next Datacenter when the previous one was not able to create all
waiting VMs
.This policy is just used if the selection of the closest Datacenter is not enabled. Otherwise, the
DatacenterBrokerAbstract.closestDatacenterMapper(Datacenter, Vm)
is used instead.- Specified by:
defaultDatacenterMapper
in classDatacenterBrokerAbstract
- Parameters:
lastDatacenter
- the last selected Datacentervm
- the VM trying to be created- Returns:
- the Datacenter selected to request the creating of waiting VMs
or
Datacenter.NULL
if no suitable Datacenter was found - See Also:
DatacenterBroker.setDatacenterMapper(java.util.function.BiFunction)
,DatacenterBrokerAbstract.setSelectClosestDatacenter(boolean)
-
defaultVmMapper
The default policy used to select a VM to execute a given Cloudlet. The method defines the default policy used to map VMs for Cloudlets that are waiting to be created.Since this policy can be dynamically changed by calling
DatacenterBrokerAbstract.setVmMapper(Function)
, this method will always return the default policy provided by the subclass where the method is being called.It applies a Round-Robin policy to cyclically select the next Vm from the
list of waiting VMs
.- Specified by:
defaultVmMapper
in classDatacenterBrokerAbstract
- Parameters:
cloudlet
- the cloudlet that needs a VM to execute- Returns:
- the selected Vm for the cloudlet or
Vm.NULL
if no suitable VM was found - See Also:
DatacenterBrokerAbstract.setVmMapper(Function)
-