public class WorkloadFileReader extends java.lang.Object implements WorkloadModel
NOTE:
gridsim.net.Link#DEFAULT_MTU. However, you can specify the file size by using
#setGridletFileSize(int).
By default, this class follows the standard workload format as specified in
http://www.cs.huji.ac.il/labs/parallel/workload/
However, you can use other format by calling the below methods before running the simulation:
Workload| Constructor and Description |
|---|
WorkloadFileReader(java.lang.String fileName,
int rating)
Create a new
WorkloadFileReader object. |
| Modifier and Type | Method and Description |
|---|---|
java.util.ArrayList<Cloudlet> |
generateWorkload()
Reads job information from a given file.
|
boolean |
setComment(java.lang.String cmt)
Identifies the start of a comment line.
|
boolean |
setField(int maxField,
int jobNum,
int submitTime,
int runTime,
int numProc)
Tells this class what to look in the trace file.
|
public WorkloadFileReader(java.lang.String fileName,
int rating)
throws java.io.FileNotFoundException
WorkloadFileReader object.fileName - the workload trace filename in one of the following format: ASCII text,
zip, gz.rating - the resource's PE ratingjava.io.FileNotFoundExceptionjava.lang.IllegalArgumentException - This happens for the following conditions:
public java.util.ArrayList<Cloudlet> generateWorkload()
generateWorkload in interface WorkloadModelnull in case of failure.public boolean setComment(java.lang.String cmt)
cmt - a character that denotes the start of a comment, e.g. ";" or "#"true if it is successful, false otherwisepublic boolean setField(int maxField,
int jobNum,
int submitTime,
int runTime,
int numProc)
By default, this class follows the standard workload format as specified in
http://www.cs.huji.ac.il/labs/parallel/workload/
However, you can use other format by calling this method.
The parameters must be a positive integer number starting from 1. A special case is where jobNum == -1, meaning the job or gridlet ID starts at 1.
maxField - max. number of field/column in one rowjobNum - field/column number for locating the job IDsubmitTime - field/column number for locating the job submit timerunTime - field/column number for locating the job run timenumProc - field/column number for locating the number of PEs required to run a jobtrue if successful, false otherwisejava.lang.IllegalArgumentException - if any of the arguments are not within the acceptable ranges