public class Datacenter extends SimEntity
| Constructor and Description |
|---|
Datacenter(java.lang.String name,
DatacenterCharacteristics characteristics,
VmAllocationPolicy vmAllocationPolicy,
java.util.List<Storage> storageList,
double schedulingInterval)
Allocates a new PowerDatacenter object.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addFile(File file)
Adds a file into the resource's storage before the experiment starts.
|
protected void |
checkCloudletCompletion()
Verifies if some cloudlet inside this PowerDatacenter already finished.
|
protected boolean |
contains(File file)
Checks whether the resource has the given file.
|
protected boolean |
contains(java.lang.String fileName)
Checks whether the resource has the given file.
|
protected DatacenterCharacteristics |
getCharacteristics()
Gets the characteristics.
|
<T extends Host> |
getHostList()
Gets the host list.
|
protected double |
getLastProcessTime()
Gets the last process time.
|
protected java.lang.String |
getRegionalCisName()
Gets the regional cis name.
|
protected double |
getSchedulingInterval()
Gets the scheduling interval.
|
protected java.util.List<Storage> |
getStorageList()
Gets the storage list.
|
VmAllocationPolicy |
getVmAllocationPolicy()
Gets the vm allocation policy.
|
<T extends Vm> |
getVmList()
Gets the vm list.
|
protected double |
predictFileTransferTime(java.util.List<java.lang.String> requiredFiles)
Predict file transfer time.
|
protected void |
processCloudlet(SimEvent ev,
int type)
Processes a Cloudlet based on the event type.
|
protected void |
processCloudletCancel(int cloudletId,
int userId,
int vmId)
Processes a Cloudlet cancel request.
|
protected void |
processCloudletMove(int[] receivedData,
int type)
Process the event for an User/Broker who wants to move a Cloudlet.
|
protected void |
processCloudletPause(int cloudletId,
int userId,
int vmId,
boolean ack)
Processes a Cloudlet pause request.
|
protected void |
processCloudletResume(int cloudletId,
int userId,
int vmId,
boolean ack)
Processes a Cloudlet resume request.
|
protected void |
processCloudletStatus(SimEvent ev)
Process the event for an User/Broker who wants to know the status of a Cloudlet.
|
protected void |
processCloudletSubmit(SimEvent ev,
boolean ack)
Processes a Cloudlet submission.
|
protected void |
processDataAdd(SimEvent ev,
boolean ack)
Process data add.
|
protected void |
processDataDelete(SimEvent ev,
boolean ack)
Process data del.
|
void |
processEvent(SimEvent ev)
Processes events or services that are available for this PowerDatacenter.
|
protected void |
processOtherEvent(SimEvent ev)
Here all the method related to VM requests will be received and forwarded to the related
method.
|
protected void |
processPingRequest(SimEvent ev)
Processes a ping request.
|
protected void |
processVmCreate(SimEvent ev,
boolean ack)
Process the event for an User/Broker who wants to create a VM in this PowerDatacenter.
|
protected void |
processVmDestroy(SimEvent ev,
boolean ack)
Process the event for an User/Broker who wants to destroy a VM previously created in this
PowerDatacenter.
|
protected void |
processVmMigrate(SimEvent ev,
boolean ack)
Process the event for an User/Broker who wants to migrate a VM.
|
protected void |
registerOtherEntity()
Overrides this method when making a new and different type of resource.
|
protected void |
setCharacteristics(DatacenterCharacteristics characteristics)
Sets the characteristics.
|
protected void |
setLastProcessTime(double lastProcessTime)
Sets the last process time.
|
protected void |
setRegionalCisName(java.lang.String regionalCisName)
Sets the regional cis name.
|
protected void |
setSchedulingInterval(double schedulingInterval)
Sets the scheduling interval.
|
protected void |
setStorageList(java.util.List<Storage> storageList)
Sets the storage list.
|
protected void |
setVmAllocationPolicy(VmAllocationPolicy vmAllocationPolicy)
Sets the vm allocation policy.
|
protected <T extends Vm> |
setVmList(java.util.List<T> vmList)
Sets the vm list.
|
void |
shutdownEntity()
This method is invoked by the
Simulation before the simulation finishes. |
void |
startEntity()
This method is invoked by the
Simulation class when the simulation is started. |
protected void |
updateCloudletProcessing()
Updates processing of each cloudlet running in this PowerDatacenter.
|
cancelEvent, clone, getEventBuffer, getId, getName, getNextEvent, getNextEvent, getState, numEventsWaiting, numEventsWaiting, pause, run, schedule, schedule, schedule, schedule, scheduleFirst, scheduleFirst, scheduleFirst, scheduleFirst, scheduleFirstNow, scheduleFirstNow, scheduleFirstNow, scheduleFirstNow, scheduleNow, scheduleNow, scheduleNow, scheduleNow, selectEvent, send, send, send, send, sendNow, sendNow, sendNow, sendNow, setEventBuffer, setId, setState, waitForEventpublic Datacenter(java.lang.String name,
DatacenterCharacteristics characteristics,
VmAllocationPolicy vmAllocationPolicy,
java.util.List<Storage> storageList,
double schedulingInterval)
throws java.lang.Exception
name - the name to be associated with this entity (as required by Sim_entity class from
simjava package)characteristics - an object of DatacenterCharacteristicsstorageList - a LinkedList of storage elements, for data simulationvmAllocationPolicy - the vmAllocationPolicyjava.lang.Exception - This happens when one of the following scenarios occur:
protected void registerOtherEntity()
#body() method, if you use this method.public void processEvent(SimEvent ev)
processEvent in class SimEntityev - a Sim_event objectprotected void processDataDelete(SimEvent ev, boolean ack)
ev - the evack - the ackprotected void processDataAdd(SimEvent ev, boolean ack)
ev - the evack - the ackprotected void processPingRequest(SimEvent ev)
ev - a Sim_event objectprotected void processCloudletStatus(SimEvent ev)
ev - a Sim_event objectprotected void processOtherEvent(SimEvent ev)
ev - the received eventprotected void processVmCreate(SimEvent ev, boolean ack)
ev - a Sim_event objectack - the ackprotected void processVmDestroy(SimEvent ev, boolean ack)
ev - a Sim_event objectack - the ackprotected void processVmMigrate(SimEvent ev, boolean ack)
ev - a Sim_event objectprotected void processCloudlet(SimEvent ev, int type)
ev - a Sim_event objecttype - event typeprotected void processCloudletMove(int[] receivedData,
int type)
receivedData - information about the migrationtype - event tagprotected void processCloudletSubmit(SimEvent ev, boolean ack)
ev - a SimEvent objectack - an acknowledgementprotected double predictFileTransferTime(java.util.List<java.lang.String> requiredFiles)
requiredFiles - the required filesprotected void processCloudletResume(int cloudletId,
int userId,
int vmId,
boolean ack)
cloudletId - resuming cloudlet IDuserId - ID of the cloudlet's ownerack - $true if an ack is requested after operationvmId - the vm idprotected void processCloudletPause(int cloudletId,
int userId,
int vmId,
boolean ack)
cloudletId - resuming cloudlet IDuserId - ID of the cloudlet's ownerack - $true if an ack is requested after operationvmId - the vm idprotected void processCloudletCancel(int cloudletId,
int userId,
int vmId)
cloudletId - resuming cloudlet IDuserId - ID of the cloudlet's ownervmId - the vm idprotected void updateCloudletProcessing()
protected void checkCloudletCompletion()
public int addFile(File file)
file - a DataCloud fileprotected boolean contains(File file)
file - a file to be searchedprotected boolean contains(java.lang.String fileName)
fileName - a file name to be searchedpublic void shutdownEntity()
SimEntitySimulation before the simulation finishes. If you want
to save data in log files this is the method in which the corresponding code would be placed.shutdownEntity in class SimEntitypublic void startEntity()
SimEntitySimulation class when the simulation is started. This
method should be responsible for starting the entity up.startEntity in class SimEntitypublic <T extends Host> java.util.List<T> getHostList()
protected DatacenterCharacteristics getCharacteristics()
protected void setCharacteristics(DatacenterCharacteristics characteristics)
characteristics - the new characteristicsprotected java.lang.String getRegionalCisName()
protected void setRegionalCisName(java.lang.String regionalCisName)
regionalCisName - the new regional cis namepublic VmAllocationPolicy getVmAllocationPolicy()
protected void setVmAllocationPolicy(VmAllocationPolicy vmAllocationPolicy)
vmAllocationPolicy - the new vm allocation policyprotected double getLastProcessTime()
protected void setLastProcessTime(double lastProcessTime)
lastProcessTime - the new last process timeprotected java.util.List<Storage> getStorageList()
protected void setStorageList(java.util.List<Storage> storageList)
storageList - the new storage listpublic <T extends Vm> java.util.List<T> getVmList()
protected <T extends Vm> void setVmList(java.util.List<T> vmList)
vmList - the new vm listprotected double getSchedulingInterval()
protected void setSchedulingInterval(double schedulingInterval)
schedulingInterval - the new scheduling interval