public class Datacenter extends SimEntity
Constructor and Description |
---|
Datacenter(String name,
DatacenterCharacteristics characteristics,
VmAllocationPolicy vmAllocationPolicy,
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(String fileName)
Checks whether the resource has the given file.
|
protected DatacenterCharacteristics |
getCharacteristics()
Gets the characteristics.
|
protected Map<Integer,Double> |
getDebts()
Gets the debts.
|
<T extends Host> |
getHostList()
Gets the host list.
|
protected double |
getLastProcessTime()
Gets the last process time.
|
protected String |
getRegionalCisName()
Gets the regional cis name.
|
protected double |
getSchedulingInterval()
Gets the scheduling interval.
|
protected 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(List<String> requiredFiles)
Predict file transfer time.
|
void |
printDebts()
Prints the debts.
|
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 |
setDebts(Map<Integer,Double> debts)
Sets the debts.
|
protected void |
setLastProcessTime(double lastProcessTime)
Sets the last process time.
|
protected void |
setRegionalCisName(String regionalCisName)
Sets the regional cis name.
|
protected void |
setSchedulingInterval(double schedulingInterval)
Sets the scheduling interval.
|
protected void |
setStorageList(List<Storage> storageList)
Sets the storage list.
|
protected void |
setVmAllocationPolicy(VmAllocationPolicy vmAllocationPolicy)
Sets the vm allocation policy.
|
protected <T extends Vm> |
setVmList(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, waitForEvent
public Datacenter(String name, DatacenterCharacteristics characteristics, VmAllocationPolicy vmAllocationPolicy, List<Storage> storageList, double schedulingInterval) throws 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 vmAllocationPolicyException
- 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 SimEntity
ev
- 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(List<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(String fileName)
fileName
- a file name to be searchedpublic void printDebts()
public void shutdownEntity()
SimEntity
Simulation
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 SimEntity
public void startEntity()
SimEntity
Simulation
class when the simulation is started. This
method should be responsible for starting the entity up.startEntity
in class SimEntity
protected DatacenterCharacteristics getCharacteristics()
protected void setCharacteristics(DatacenterCharacteristics characteristics)
characteristics
- the new characteristicsprotected String getRegionalCisName()
protected void setRegionalCisName(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 void setDebts(Map<Integer,Double> debts)
debts
- the debtsprotected List<Storage> getStorageList()
protected void setStorageList(List<Storage> storageList)
storageList
- the new storage listprotected <T extends Vm> void setVmList(List<T> vmList)
vmList
- the new vm listprotected double getSchedulingInterval()
protected void setSchedulingInterval(double schedulingInterval)
schedulingInterval
- the new scheduling intervalCopyright © 2012 The Cloud Computing and Distributed Systems (CLOUDS) Laboratory, The University of Melbourne. All Rights Reserved.