public interface Datacenter extends SimEntity, PowerAware
NullPointerException
when using the
NULL
object instead of attributing null
to
Datacenter
variables.SimEntity.State
Modifier and Type | Field and Description |
---|---|
static double |
DEF_BW_PERCENT_FOR_MIGRATION
The default percentage of bandwidth allocated for VM migration, is
a value is not set.
|
static Datacenter |
NULL
A property that implements the Null Object Design Pattern for
Datacenter objects. |
Modifier and Type | Method and Description |
---|---|
<T extends Host> |
addHost(T host)
Physically expands the Datacenter by adding a new Host (physical machine) to it.
|
<T extends Host> |
addHostList(List<T> hostList)
Physically expands the Datacenter by adding a List of new Hosts (physical machines) to it.
|
Datacenter |
addOnHostAvailableListener(EventListener<HostEventInfo> listener)
Adds a
EventListener object that will be notified every time when the
a new Hosts is available for the Datacenter during simulation runtime. |
long |
getActiveHostsNumber()
Gets the current number of Hosts that are powered on inside the Datacenter.
|
double |
getBandwidthPercentForMigration()
Gets the percentage of the bandwidth allocated to a Host to
migrate VMs.
|
DatacenterCharacteristics |
getCharacteristics()
Gets the Datacenter characteristics.
|
DatacenterStorage |
getDatacenterStorage()
Gets the storage of the Datacenter.
|
Host |
getHost(int index)
Gets a Host in a given position inside the Host List.
|
Host |
getHostById(long id)
Gets a Host from its id.
|
<T extends Host> |
getHostList()
Gets an unmodifiable host list.
|
double |
getPower()
Gets an estimation of Datacenter power consumption in Watt-Second (Ws).
|
double |
getSchedulingInterval()
Gets the scheduling interval to process each event received by the
Datacenter (in seconds).
|
VmAllocationPolicy |
getVmAllocationPolicy()
Gets the policy to be used by the Datacenter to allocate VMs into hosts.
|
<T extends Host> |
removeHost(T host)
Removes a Host from its Datacenter.
|
void |
setBandwidthPercentForMigration(double bandwidthPercentForMigration)
Sets the percentage of the bandwidth allocated to a Host to
migrate VMs.
|
void |
setDatacenterStorage(DatacenterStorage datacenterStorage)
Sets the storage of the Datacenter.
|
void |
setPowerSupply(DatacenterPowerSupply powerSupply)
Sets a
DatacenterPowerSupply to enable computing the Datacenter's power consumption,
based on the consumption of its Host s. |
Datacenter |
setSchedulingInterval(double schedulingInterval)
Sets the scheduling delay to process each event received by the
Datacenter (in seconds).
|
getSimulation, getState, isAlive, isFinished, isStarted, processEvent, run, schedule, schedule, schedule, schedule, schedule, setName, setSimulation, setState, shutdownEntity, start
getId
compareTo
getPowerInKWatts, wattsSecToKWattsHour
static final Datacenter NULL
Datacenter
objects.static final double DEF_BW_PERCENT_FOR_MIGRATION
<T extends Host> List<T> getHostList()
T
- The generic typeHost getHost(int index)
index
- the position of the List to get the Hostlong getActiveHostsNumber()
Host.isActive()
Host getHostById(long id)
id
- the ID of the Host to get from the List.Host.NULL
otherwise<T extends Host> Datacenter addHostList(List<T> hostList)
VmAllocationPolicy
.
If an ID is not assigned to a Host, the method assigns one.
hostList
- the List of new hosts to be addedgetVmAllocationPolicy()
<T extends Host> Datacenter addHost(T host)
VmAllocationPolicy
.
If an ID is not assigned to the given Host, the method assigns one.
host
- the new host to be addedgetVmAllocationPolicy()
<T extends Host> Datacenter removeHost(T host)
host
- the new host to be removed from its assigned DatacenterVmAllocationPolicy getVmAllocationPolicy()
VmAllocationPolicy
double getSchedulingInterval()
Cloudlet.getFinishedLengthSoFar(Datacenter)
, it
will not return an updated value. By this way, one should set the
scheduling interval to 5 to get an updated result. As longer is the
interval, faster will be the simulation execution.Datacenter setSchedulingInterval(double schedulingInterval)
schedulingInterval
- the new scheduling interval (in seconds)getSchedulingInterval()
DatacenterCharacteristics getCharacteristics()
DatacenterStorage getDatacenterStorage()
void setDatacenterStorage(DatacenterStorage datacenterStorage)
datacenterStorage
- the new storagedouble getBandwidthPercentForMigration()
DEF_BW_PERCENT_FOR_MIGRATION
void setBandwidthPercentForMigration(double bandwidthPercentForMigration)
bandwidthPercentForMigration
- the bandwidth migration percentage to setdouble getPower()
To get actual power consumption, it's required to enable
Host's StateHistory
by calling Host.enableStateHistory()
and use each Host PowerModel
to compute power usage
based on the CPU utilization got form the StateHistory.
getPower
in interface PowerAware
PowerAware.getPowerInKWatts()
Datacenter addOnHostAvailableListener(EventListener<HostEventInfo> listener)
EventListener
object that will be notified every time when the
a new Hosts is available for the Datacenter during simulation runtime.
If the addHost(Host)
or addHostList(List)
is called
before the simulation starts, the listeners will not be notified.listener
- the event listener to addvoid setPowerSupply(DatacenterPowerSupply powerSupply)
DatacenterPowerSupply
to enable computing the Datacenter's power consumption,
based on the consumption of its Host
s.
Since this computation is expensive for large amount of Hosts
and the researcher may not be interested in power consumption,
the attribute is initialized with DatacenterPowerSupply.NULL
.
That avoids computing power consumption by default for every simulation,
This way, the computation of power consumption must be explicitly
enabled by the researcher by providing an instance to this attribute
before the simulation starts.powerSupply
- a DatacenterPowerSupply
instance to enable
the Datacenter to compute its power consumption
(if null is given, it disables such a computation)Copyright © 2015–2019 Systems, Security and Image Communication Lab - Instituto de Telecomunica����es (IT) - Universidade da Beira Interior (UBI) - Instituto Federal de Educa����o Ci��ncia e Tecnologia do Tocantins (IFTO). All rights reserved.