Cloudlet 类
是用来说明在VM中运行的任务的类
Cloudlet 的属性
用来说明任务的状态(如就绪,成功,失败,暂停等)
public enum CloudletStatus {
/** The Cloudlet has been created and added to the CloudletList object. */
CREATED,
/** The Cloudlet has been assigned to a CloudResource object to be executed as planned. */
READY,
/** The Cloudlet has moved to a Cloud node. */
QUEUED,
/** The Cloudlet is in execution in a Cloud node. */
INEXEC,
/** The Cloudlet has been executed successfully. */
SUCCESS,
/** The Cloudlet has failed. */
FAILED,
/** The Cloudlet has been canceled. */
CANCELED,
/** The Cloudlet has been paused. It can be resumed by changing the status into RESUMED. */
PAUSED,
/** The Cloudlet has been resumed from PAUSED state. */
RESUMED,
/** The cloudlet has failed due to a resource failure.*/
FAILED_RESOURCE_UNAVAILABLE;
public static final CloudletStatus[] values = values();
// @NOTE: Convert an int to enum with CloudletStatus.values[i] (mind the array bounds)
}
任务的ID
/**
* The cloudlet ID.
*/
private final int cloudletId;
broker(管理器)的ID
/**
* The User or Broker ID. It is advisable that broker set this ID with its
* own ID, so that CloudResource returns to it after the execution.
*/
private int userId;
任务的ID(字符串)
/** The Cloudlet UID */
private String uid;
执行长度(任务的计算量)-对应的是设备CPU计算频率
/**
* The execution length of this Cloudlet (Unit: in Million Instructions
* (MI)). According to this length and the power of the processor (in
* Million Instruction Per Second - MIPS) where the cloudlet will be run,
* the cloudlet will take a given time to finish processing. For instance,
* for a cloudlet of 10000 MI running on a processor of 2000 MIPS, the
* cloudlet will spend 5 seconds using the processor in order to be
* completed (that may be uninterrupted or not, depending on the scheduling
* policy).
*
* @see #setNumberOfPes(int)
*/
private long cloudletLength;
输入的文件大小-对应的是设备存储空间
/**
* The input file size of this Cloudlet before execution (unit: in byte).
* This size has to be considered the program + input data sizes.
*/
private final long cloudletFileSize;
输出的文件大小
/**
* The output file size of this Cloudlet after execution (unit: in byte).
* <p>
* //TODO See
* <a href="https://groups.google.com/forum/#!topic/cloudsim/MyZ7OnrXuuI">this
* discussion</a>
*/
private final long cloudletOutputSize;
执行任务需要的核心数
/**
* The number of Processing Elements (Pe) required to execute this cloudlet
* (job).
*
* @see #setNumberOfPes(int)
*/
private int numberOfPes;
任务的执行状态
/**
* The execution status of this Cloudlet.
*/
private CloudletStatus status;
任务开始执行的时间
/**
* The execution start time of this Cloudlet. With new functionalities, such
* as CANCEL, PAUSED and RESUMED, this attribute only stores the latest
* execution time. Previous execution time are ignored.
*/
private double execStartTime;
任务完成的时间
/**
* The time where this Cloudlet completes.
*/
private double execFinishTime;
运行任务消耗的时间
/** The total time to complete this Cloudlet. */
private double totalCompletionTime;
是否要输出运行记录
/**
* Indicates if transaction history records for this Cloudlet is to be
* outputted.
*/
private final boolean record;
是否输出运行记录
/**
* Indicates if transaction history records for this Cloudlet is to be
* outputted.
*/
private final boolean record;
存储操作系统的分界
/**
* Stores the operating system line separator.
*/
private String newline;
任务的执行历史记录
/**
* The cloudlet transaction history.
*/
private StringBuffer history;
云任务在每个VM上执行的列表(如果它在一个单一的云资源上开始并完成执行,而没有被迁移,这个列表将只有一个)
/**
* The list of every resource where the cloudlet has been executed. In case
* it starts and finishes executing in a single cloud resource, without
* being migrated, this list will have only one item.
*/
private final List<Resource> resList;
任务最后执行位置的VM的ID
/**
* The index of the last resource where the cloudlet was executed. If the
* cloudlet is migrated during its execution, this index is updated. The
* value -1 indicates the cloudlet has not been executed
* yet.
*/
private int index;
任务种类和执行的优先级
/**
* The classType or priority of this Cloudlet for scheduling on a resource.
*/
private int classType;
网络种类
/**
* The Type of Service (ToS) of IPv4 for sending Cloudlet over the network.
*/
private int netToS;
数据格式
/**
* The format of decimal numbers.
*/
private DecimalFormat num;
执行任务的用户ID
/**
* The id of the guest entity that is planned to execute the cloudlet.
*/
protected int guestId;
计划执行任务的VM容器
/**
* The id of the container is planned to execute the cloudlet.
* It may be -1, if containers are not in use
*/
// TODO: Remo Andreoli: to be deprecated in favor of guestId
protected int containerId = -1;
传输能耗/比特
/**
* The cost of each byte of bandwidth (bw) consumed.
*/
protected double costPerBw;
传输任务总能量消耗
/**
* The total bandwidth (bw) cost for transferring the cloudlet by the
* network, according to the {@link #cloudletFileSize}.
*/
protected double accumulatedBwCost;
任务的CPU的使用量
/**
* The utilization model that defines ho