CloudletAbstract

public abstract class CloudletAbstract extends CustomerEntityAbstract implements Cloudlet

A base class for Cloudlet implementations.

Author:Rodrigo N. Calheiros, Anton Beloglazov, Manoel Campos da Silva Filho

Constructors

CloudletAbstract

public CloudletAbstract(long length, int pesNumber, UtilizationModel utilizationModel)

Creates a Cloudlet with no priority or id. The id is defined when the Cloudlet is submitted to a DatacenterBroker. The file size and output size is defined as 1.

Parameters:
  • length – the length or size (in MI) of this cloudlet to be executed in a VM (check out setLength(long))
  • pesNumber – number of PEs that Cloudlet will require
  • utilizationModel – a UtilizationModel to define how the Cloudlet uses CPU, RAM and BW. To define an independent utilization model for each resource, call the respective setters.

See also: .setUtilizationModelCpu(UtilizationModel), .setUtilizationModelRam(UtilizationModel), .setUtilizationModelBw(UtilizationModel)

CloudletAbstract

public CloudletAbstract(long length, int pesNumber)

Creates a Cloudlet with no priority or id. The id is defined when the Cloudlet is submitted to a DatacenterBroker. The file size and output size is defined as 1.

NOTE: By default, the Cloudlet will use a UtilizationModelFull to define CPU utilization and a UtilizationModel.NULL for RAM and BW. To change the default values, use the respective setters.

Parameters:
  • length – the length or size (in MI) of this cloudlet to be executed in a VM (check out setLength(long))
  • pesNumber – number of PEs that Cloudlet will require

CloudletAbstract

public CloudletAbstract(long length, long pesNumber)

Creates a Cloudlet with no priority or id. The id is defined when the Cloudlet is submitted to a DatacenterBroker. The file size and output size is defined as 1.

NOTE: By default, the Cloudlet will use a UtilizationModelFull to define CPU utilization and a UtilizationModel.NULL for RAM and BW. To change the default values, use the respective setters.

Parameters:
  • length – the length or size (in MI) of this cloudlet to be executed in a VM (check out setLength(long))
  • pesNumber – number of PEs that Cloudlet will require

CloudletAbstract

public CloudletAbstract(long id, long length, long pesNumber)

Creates a Cloudlet with no priority, file size and output size equal to 1.

NOTE: By default, the Cloudlet will use a UtilizationModelFull to define CPU utilization and a UtilizationModel.NULL for RAM and BW. To change the default values, use the respective setters.

Parameters:
  • id – id of the Cloudlet
  • length – the length or size (in MI) of this cloudlet to be executed in a VM (check out setLength(long))
  • pesNumber – number of PEs that Cloudlet will require

Methods

absLength

protected long absLength()

Gets the absolute value of the length (without the signal). Check out getLength() for details.

addFinishedLengthSoFar

public boolean addFinishedLengthSoFar(long partialFinishedMI)

addOnFinishListener

public Cloudlet addOnFinishListener(EventListener<CloudletVmEventInfo> listener)

addOnStartListener

public Cloudlet addOnStartListener(EventListener<CloudletVmEventInfo> listener)

addOnUpdateProcessingListener

public Cloudlet addOnUpdateProcessingListener(EventListener<CloudletVmEventInfo> listener)

addRequiredFile

public boolean addRequiredFile(String fileName)

addRequiredFiles

public boolean addRequiredFiles(List<String> fileNames)

assignToDatacenter

public void assignToDatacenter(Datacenter datacenter)

deleteRequiredFile

public boolean deleteRequiredFile(String filename)

equals

public boolean equals(Object other)

getAccumulatedBwCost

public double getAccumulatedBwCost()

getActualCpuTime

protected double getActualCpuTime(Datacenter datacenter)

Gets the total execution time of this Cloudlet in a given Datacenter ID.

Parameters:
  • datacenter – the Datacenter entity
Returns:

the total execution time of this Cloudlet in the given Datacenter or 0 if the Cloudlet was not executed there

getActualCpuTime

public double getActualCpuTime()

getArrivalTime

public double getArrivalTime(Datacenter datacenter)

getCostPerBw

public double getCostPerBw()

getCostPerSec

public double getCostPerSec()

getCostPerSec

public double getCostPerSec(Datacenter datacenter)

getExecStartTime

public double getExecStartTime()

getFileSize

public long getFileSize()

getFinishTime

public double getFinishTime()

getFinishedLengthSoFar

public long getFinishedLengthSoFar(Datacenter datacenter)

getFinishedLengthSoFar

public long getFinishedLengthSoFar()

getJobId

public long getJobId()

getLastDatacenterArrivalTime

public double getLastDatacenterArrivalTime()

getLastExecutedDatacenterIdx

protected int getLastExecutedDatacenterIdx()

getLength

public long getLength()

getNetServiceLevel

public int getNetServiceLevel()

getNumberOfPes

public long getNumberOfPes()

getOutputSize

public long getOutputSize()

getPriority

public int getPriority()

getRequiredFiles

public List<String> getRequiredFiles()

getStatus

public Status getStatus()

getSubmissionDelay

public double getSubmissionDelay()

getTotalCost

public double getTotalCost()

getTotalLength

public long getTotalLength()

getUtilizationModelBw

public UtilizationModel getUtilizationModelBw()

getUtilizationModelCpu

public UtilizationModel getUtilizationModelCpu()

getUtilizationModelRam

public UtilizationModel getUtilizationModelRam()

getUtilizationOfBw

public double getUtilizationOfBw()

getUtilizationOfBw

public double getUtilizationOfBw(double time)

getUtilizationOfCpu

public double getUtilizationOfCpu()

getUtilizationOfCpu

public double getUtilizationOfCpu(double time)

getUtilizationOfRam

public double getUtilizationOfRam()

getUtilizationOfRam

public double getUtilizationOfRam(double time)

getVm

public Vm getVm()

getWaitingTime

public double getWaitingTime()

getWallClockTime

protected double getWallClockTime(Datacenter datacenter)

Gets the time of this Cloudlet resides in a given Datacenter (from arrival time until departure time).

Parameters:
  • datacenter – a Datacenter entity
Returns:

the wall-clock time or 0 if the Cloudlet has never been executed there

See also: Elapsed real time (wall-clock time)

isBindToVm

public boolean isBindToVm()

isFinished

public boolean isFinished()

notifyOnUpdateProcessingListeners

public void notifyOnUpdateProcessingListeners(double time)

registerArrivalInDatacenter

public double registerArrivalInDatacenter()

removeOnFinishListener

public boolean removeOnFinishListener(EventListener<CloudletVmEventInfo> listener)

removeOnStartListener

public boolean removeOnStartListener(EventListener<CloudletVmEventInfo> listener)

removeOnUpdateProcessingListener

public boolean removeOnUpdateProcessingListener(EventListener<CloudletVmEventInfo> listener)

requiresFiles

public boolean requiresFiles()

setAccumulatedBwCost

protected final void setAccumulatedBwCost(double accumulatedBwCost)

Sets the accumulated bw cost.

Parameters:
  • accumulatedBwCost – the accumulated bw cost to set

setCostPerBw

protected final void setCostPerBw(double costPerBw)

Sets the cost of each byte of bandwidth (bw) consumed.

Parameters:
  • costPerBw – the new cost per bw to set

setExecStartTime

public void setExecStartTime(double clockTime)

setFileSize

public final Cloudlet setFileSize(long fileSize)

setFinishTime

protected final void setFinishTime(double finishTime)

Sets the finish time of this cloudlet in the latest Datacenter.

Parameters:
  • finishTime – the finish time

setJobId

public final void setJobId(long jobId)

setLastExecutedDatacenterIdx

protected void setLastExecutedDatacenterIdx(int lastExecutedDatacenterIdx)

setLength

public final Cloudlet setLength(long length)

setNetServiceLevel

public boolean setNetServiceLevel(int netServiceLevel)

setNumberOfPes

public final Cloudlet setNumberOfPes(long numberOfPes)

setOutputSize

public final Cloudlet setOutputSize(long outputSize)

setPriority

public void setPriority(int priority)

setRequiredFiles

public final void setRequiredFiles(List<String> requiredFiles)

Sets the list of required files.

Parameters:
  • requiredFiles – the new list of required files

setSizes

public Cloudlet setSizes(long size)

setStatus

public boolean setStatus(Status newStatus)

setSubmissionDelay

public final void setSubmissionDelay(double submissionDelay)

setUtilizationModel

public Cloudlet setUtilizationModel(UtilizationModel utilizationModel)

setUtilizationModelBw

public final Cloudlet setUtilizationModelBw(UtilizationModel utilizationModelBw)

setUtilizationModelCpu

public final Cloudlet setUtilizationModelCpu(UtilizationModel utilizationModelCpu)

setUtilizationModelRam

public final Cloudlet setUtilizationModelRam(UtilizationModel utilizationModelRam)

setVm

public final Cloudlet setVm(Vm vm)

setWallClockTime

public boolean setWallClockTime(double wallTime, double actualCpuTime)