public class Cloudlet extends Object
Modifier and Type | Field and Description |
---|---|
protected double |
accumulatedBwCost
The accumulated bw cost.
|
static int |
CANCELED
The Cloudlet has been canceled.
|
protected double |
costPerBw
The cost per bw.
|
static int |
CREATED
The Cloudlet has been created and added to the CloudletList object.
|
static int |
FAILED
The Cloudlet is failed.
|
static int |
FAILED_RESOURCE_UNAVAILABLE
The cloudlet has failed due to a resource failure.
|
static int |
INEXEC
The Cloudlet is in execution in a Cloud node.
|
static int |
PAUSED
The Cloudlet has been paused.
|
static int |
QUEUED
The Cloudlet has moved to a Cloud node.
|
static int |
READY
The Cloudlet has been assigned to a CloudResource object as planned.
|
static int |
RESUMED
The Cloudlet has been resumed from PAUSED state.
|
static int |
SUCCESS
The Cloudlet has been executed successfully.
|
protected int |
vmId
The vm id.
|
Constructor and Description |
---|
Cloudlet(int cloudletId,
long cloudletLength,
int pesNumber,
long cloudletFileSize,
long cloudletOutputSize,
UtilizationModel utilizationModelCpu,
UtilizationModel utilizationModelRam,
UtilizationModel utilizationModelBw)
Allocates a new Cloudlet object.
|
Cloudlet(int cloudletId,
long cloudletLength,
int pesNumber,
long cloudletFileSize,
long cloudletOutputSize,
UtilizationModel utilizationModelCpu,
UtilizationModel utilizationModelRam,
UtilizationModel utilizationModelBw,
boolean record)
Allocates a new Cloudlet object.
|
Cloudlet(int cloudletId,
long cloudletLength,
int pesNumber,
long cloudletFileSize,
long cloudletOutputSize,
UtilizationModel utilizationModelCpu,
UtilizationModel utilizationModelRam,
UtilizationModel utilizationModelBw,
boolean record,
List<String> fileList)
Allocates a new Cloudlet object.
|
Cloudlet(int cloudletId,
long cloudletLength,
int pesNumber,
long cloudletFileSize,
long cloudletOutputSize,
UtilizationModel utilizationModelCpu,
UtilizationModel utilizationModelRam,
UtilizationModel utilizationModelBw,
List<String> fileList)
Allocates a new Cloudlet object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addRequiredFile(String fileName)
Adds the required filename to the list.
|
boolean |
deleteRequiredFile(String filename)
Deletes the given filename from the list.
|
double |
getActualCPUTime()
Returns the time the Cloudlet actually run.
|
double |
getActualCPUTime(int resId)
Gets the total execution time of this Cloudlet in a given CloudResource ID.
|
int[] |
getAllResourceId()
Gets all the CloudResource IDs that executed this Cloudlet.
|
String[] |
getAllResourceName()
Gets all the CloudResource names that executed this Cloudlet.
|
int |
getClassType()
Gets the classtype or priority of this Cloudlet for scheduling on a resource.
|
long |
getCloudletFileSize()
Gets the input file size of this Cloudlet BEFORE submitting to a CloudResource.
|
long |
getCloudletFinishedSoFar()
Gets the length of this Cloudlet that has been executed so far from the latest CloudResource.
|
long |
getCloudletFinishedSoFar(int resId)
Gets the length of this Cloudlet that has been executed so far in a given CloudResource ID.
|
String |
getCloudletHistory()
Gets the history of this Cloudlet.
|
int |
getCloudletId()
Gets the ID of this Cloudlet.
|
long |
getCloudletLength()
Gets the length of this Cloudlet.
|
long |
getCloudletOutputSize()
Gets the output size of this Cloudlet AFTER submitting and executing to a
CloudResource.
|
int |
getCloudletStatus()
Gets the status code of this Cloudlet.
|
String |
getCloudletStatusString()
Gets the string representation of the current Cloudlet status code.
|
long |
getCloudletTotalLength()
Gets the total length (across all PEs) of this Cloudlet.
|
double |
getCostPerSec()
Gets the cost running this Cloudlet in the latest CloudResource.
|
double |
getCostPerSec(int resId)
Gets the cost running this Cloudlet in a given CloudResource ID.
|
double |
getExecStartTime()
Gets the latest execution start time.
|
double |
getFinishTime()
Gets the finish time of this Cloudlet in a CloudResource.
|
int |
getNetServiceLevel()
Gets the network service level for sending this cloudlet over a network.
|
int |
getNumberOfPes()
Gets the number of PEs required to run this Cloudlet.
|
double |
getProcessingCost()
Gets the total cost of processing or executing this Cloudlet
Processing Cost = input data transfer + processing cost + output transfer cost .
|
List<String> |
getRequiredFiles()
Gets the required files.
|
int |
getReservationId()
Gets the reservation ID that owns this Cloudlet.
|
org.cloudbus.cloudsim.Cloudlet.Resource |
getResourceById(int resourceId)
Gets the resource by id.
|
int |
getResourceId()
Gets the latest resource ID that processes this Cloudlet.
|
String |
getResourceName(int resId)
Gets the CloudResource name based on its ID.
|
int |
getStatus()
Get the status of the Cloudlet.
|
static String |
getStatusString(int status)
Gets the string representation of the given Cloudlet status code.
|
double |
getSubmissionTime()
Gets the submission or arrival time of this Cloudlet from the latest CloudResource.
|
double |
getSubmissionTime(int resId)
Gets the submission or arrival time of this Cloudlet in the given CloudResource ID.
|
int |
getUserId()
Gets the user or owner ID of this Cloudlet.
|
UtilizationModel |
getUtilizationModelBw()
Gets the utilization model bw.
|
UtilizationModel |
getUtilizationModelCpu()
Gets the utilization model cpu.
|
UtilizationModel |
getUtilizationModelRam()
Gets the utilization model ram.
|
double |
getUtilizationOfBw(double time)
Gets the utilization of bw.
|
double |
getUtilizationOfCpu(double time)
Gets the total utilization of cpu.
|
double |
getUtilizationOfRam(double time)
Gets the utilization of memory.
|
int |
getVmId()
Gets the ID of the VM that will run this Cloudlet.
|
double |
getWaitingTime()
Gets the waiting time of this cloudlet executed on a resource.
|
double |
getWallClockTime()
Gets the time of this Cloudlet resides in the latest CloudResource (from arrival time until
departure time).
|
double |
getWallClockTime(int resId)
Gets the time of this Cloudlet resides in a given CloudResource ID (from arrival time until
departure time).
|
boolean |
hasReserved()
Checks whether this Cloudlet is submitted by reserving or not.
|
boolean |
isFinished()
Checks whether this Cloudlet has finished execution or not.
|
boolean |
requiresFiles()
Checks whether this cloudlet requires any files or not.
|
boolean |
setClassType(int classType)
Sets the classType or priority of this Cloudlet for scheduling on a resource.
|
void |
setCloudletFinishedSoFar(long length)
Sets the length of this Cloudlet that has been executed so far.
|
boolean |
setCloudletLength(long cloudletLength)
Sets the length or size (in MI) of this Cloudlet to be executed in a CloudResource.
|
void |
setCloudletStatus(int newStatus)
Sets the status code of this Cloudlet.
|
void |
setExecParam(double wallTime,
double actualTime)
Sets this Cloudlet's execution parameters.
|
void |
setExecStartTime(double clockTime)
Sets the execution start time of this Cloudlet inside a CloudResource.
|
boolean |
setNetServiceLevel(int netServiceLevel)
Sets the network service level for sending this cloudlet over a network.
|
boolean |
setNumberOfPes(int numberOfPes)
Sets the number of PEs required to run this Cloudlet.
|
protected void |
setRequiredFiles(List<String> requiredFiles)
Sets the required files.
|
boolean |
setReservationId(int resId)
Sets the id of the reservation made for this cloudlet.
|
void |
setResourceParameter(int resourceID,
double cost)
Sets the resource parameters for which this Cloudlet is going to be executed.
|
void |
setResourceParameter(int resourceID,
double costPerCPU,
double costPerBw)
Sets the resource parameters for which this Cloudlet is going to be executed.
|
void |
setSubmissionTime(double clockTime)
Sets the submission or arrival time of this Cloudlet into a CloudResource.
|
void |
setUserId(int id)
Sets the user or owner ID of this Cloudlet.
|
void |
setUtilizationModelBw(UtilizationModel utilizationModelBw)
Sets the utilization model bw.
|
void |
setUtilizationModelCpu(UtilizationModel utilizationModelCpu)
Sets the utilization model cpu.
|
void |
setUtilizationModelRam(UtilizationModel utilizationModelRam)
Sets the utilization model ram.
|
void |
setVmId(int vmId)
Sets the ID of the VM that will run this Cloudlet.
|
protected void |
write(String str)
Writes this particular history transaction of this Cloudlet into a log.
|
public static final int CREATED
public static final int READY
public static final int QUEUED
public static final int INEXEC
public static final int SUCCESS
public static final int FAILED
public static final int CANCELED
public static final int PAUSED
public static final int RESUMED
public static final int FAILED_RESOURCE_UNAVAILABLE
protected int vmId
protected double costPerBw
protected double accumulatedBwCost
public Cloudlet(int cloudletId, long cloudletLength, int pesNumber, long cloudletFileSize, long cloudletOutputSize, UtilizationModel utilizationModelCpu, UtilizationModel utilizationModelRam, UtilizationModel utilizationModelBw)
cloudletId
- the unique ID of this CloudletcloudletLength
- the length or size (in MI) of this cloudlet to be executed in a
PowerDatacentercloudletFileSize
- the file size (in byte) of this cloudlet BEFORE submitting
to a PowerDatacentercloudletOutputSize
- the file size (in byte) of this cloudlet AFTER finish
executing by a PowerDatacenterpesNumber
- the pes numberutilizationModelCpu
- the utilization model cpuutilizationModelRam
- the utilization model ramutilizationModelBw
- the utilization model bwpublic Cloudlet(int cloudletId, long cloudletLength, int pesNumber, long cloudletFileSize, long cloudletOutputSize, UtilizationModel utilizationModelCpu, UtilizationModel utilizationModelRam, UtilizationModel utilizationModelBw, boolean record, List<String> fileList)
cloudletId
- the unique ID of this cloudletcloudletLength
- the length or size (in MI) of this cloudlet to be executed in a
PowerDatacentercloudletFileSize
- the file size (in byte) of this cloudlet BEFORE submitting
to a PowerDatacentercloudletOutputSize
- the file size (in byte) of this cloudlet AFTER finish
executing by a PowerDatacenterrecord
- record the history of this object or notfileList
- list of files required by this cloudletpesNumber
- the pes numberutilizationModelCpu
- the utilization model cpuutilizationModelRam
- the utilization model ramutilizationModelBw
- the utilization model bwpublic Cloudlet(int cloudletId, long cloudletLength, int pesNumber, long cloudletFileSize, long cloudletOutputSize, UtilizationModel utilizationModelCpu, UtilizationModel utilizationModelRam, UtilizationModel utilizationModelBw, List<String> fileList)
cloudletId
- the unique ID of this CloudletcloudletLength
- the length or size (in MI) of this cloudlet to be executed in a
PowerDatacentercloudletFileSize
- the file size (in byte) of this cloudlet BEFORE submitting
to a PowerDatacentercloudletOutputSize
- the file size (in byte) of this cloudlet AFTER finish
executing by a PowerDatacenterfileList
- list of files required by this cloudletpesNumber
- the pes numberutilizationModelCpu
- the utilization model cpuutilizationModelRam
- the utilization model ramutilizationModelBw
- the utilization model bwpublic Cloudlet(int cloudletId, long cloudletLength, int pesNumber, long cloudletFileSize, long cloudletOutputSize, UtilizationModel utilizationModelCpu, UtilizationModel utilizationModelRam, UtilizationModel utilizationModelBw, boolean record)
cloudletId
- the unique ID of this cloudletcloudletLength
- the length or size (in MI) of this cloudlet to be executed in a
PowerDatacentercloudletFileSize
- the file size (in byte) of this cloudlet BEFORE submitting
to a PowerDatacentercloudletOutputSize
- the file size (in byte) of this cloudlet AFTER finish
executing by a PowerDatacenterrecord
- record the history of this object or notpesNumber
- the pes numberutilizationModelCpu
- the utilization model cpuutilizationModelRam
- the utilization model ramutilizationModelBw
- the utilization model bwpublic boolean setReservationId(int resId)
resId
- the reservation IDpublic int getReservationId()
public boolean hasReserved()
public boolean setCloudletLength(long cloudletLength)
cloudletLength
- the length or size (in MI) of this Cloudlet to be executed in a
CloudResourcepublic boolean setNetServiceLevel(int netServiceLevel)
netServiceLevel
- determines the kind of service this cloudlet receives in the network
(applicable to selected PacketScheduler class only)true
if successful.public int getNetServiceLevel()
public double getWaitingTime()
public boolean setClassType(int classType)
classType
- classType of this Cloudletpublic int getClassType()
public boolean setNumberOfPes(int numberOfPes)
numberOfPes
- number of Pepublic int getNumberOfPes()
public String getCloudletHistory()
public long getCloudletFinishedSoFar()
public boolean isFinished()
public void setCloudletFinishedSoFar(long length)
length
- length of this Cloudletgridsim.AllocPolicy
,
gridsim.ResCloudlet
public void setUserId(int id)
id
- the user IDpublic int getUserId()
public int getResourceId()
public long getCloudletFileSize()
public long getCloudletOutputSize()
public void setResourceParameter(int resourceID, double cost)
resourceID
- the CloudResource IDcost
- the cost running this CloudResource per secondpublic void setSubmissionTime(double clockTime)
clockTime
- the submission timepublic double getSubmissionTime()
public void setExecStartTime(double clockTime)
clockTime
- the latest execution start timepublic double getExecStartTime()
public void setExecParam(double wallTime, double actualTime)
wallTime
- the time of this Cloudlet resides in a CloudResource (from arrival time until
departure time).actualTime
- the total execution time of this Cloudlet in a CloudResource.public void setCloudletStatus(int newStatus) throws Exception
newStatus
- the status code of this CloudletException
- Invalid range of Cloudlet statuspublic int getCloudletStatus()
public String getCloudletStatusString()
public static String getStatusString(int status)
status
- the Cloudlet status codepublic long getCloudletLength()
public long getCloudletTotalLength()
public double getCostPerSec()
public double getWallClockTime()
public String[] getAllResourceName()
public int[] getAllResourceId()
public double getActualCPUTime(int resId)
resId
- a CloudResource entity IDpublic double getCostPerSec(int resId)
resId
- a CloudResource entity IDpublic long getCloudletFinishedSoFar(int resId)
resId
- a CloudResource entity IDpublic double getSubmissionTime(int resId)
resId
- a CloudResource entity IDpublic double getWallClockTime(int resId)
resId
- a CloudResource entity IDpublic String getResourceName(int resId)
resId
- a CloudResource entity IDpublic org.cloudbus.cloudsim.Cloudlet.Resource getResourceById(int resourceId)
resourceId
- the resource idpublic double getFinishTime()
protected void write(String str)
str
- a history transaction of this Cloudletpublic int getStatus()
public int getCloudletId()
public int getVmId()
public void setVmId(int vmId)
vmId
- the vm idpublic double getActualCPUTime()
public void setResourceParameter(int resourceID, double costPerCPU, double costPerBw)
resourceID
- the CloudResource IDcostPerCPU
- the cost running this Cloudlet per secondcostPerBw
- the cost of data transfer to this PowerDatacenterpublic double getProcessingCost()
public List<String> getRequiredFiles()
protected void setRequiredFiles(List<String> requiredFiles)
requiredFiles
- the new required filespublic boolean addRequiredFile(String fileName)
fileName
- the required filenamepublic boolean deleteRequiredFile(String filename)
filename
- the given filename to be deletedpublic boolean requiresFiles()
public UtilizationModel getUtilizationModelCpu()
public void setUtilizationModelCpu(UtilizationModel utilizationModelCpu)
utilizationModelCpu
- the new utilization model cpupublic UtilizationModel getUtilizationModelRam()
public void setUtilizationModelRam(UtilizationModel utilizationModelRam)
utilizationModelRam
- the new utilization model rampublic UtilizationModel getUtilizationModelBw()
public void setUtilizationModelBw(UtilizationModel utilizationModelBw)
utilizationModelBw
- the new utilization model bwpublic double getUtilizationOfCpu(double time)
time
- the timepublic double getUtilizationOfRam(double time)
time
- the timepublic double getUtilizationOfBw(double time)
time
- the timeCopyright © 2012 The Cloud Computing and Distributed Systems (CLOUDS) Laboratory, The University of Melbourne. All Rights Reserved.