|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Job
A Job represents one customer of services. It records the job's current state as well as statistics about its lifetime. It generally spends its lifetime moving form Server to Server.
One Job is created from each line of the input trace file.
The resources required by a Job are characterized by an amount `cpuNeeded' of CPU time (all times are in milliseconds) and a number `ioNeeded' of I/O operations, each representing one disk transfer of Sim.BLOCKSIZE bytes of data. The CPU time is assumed to be distributed as evenly as possible into ioNeeded "bursts" of cpu time, each followed by an I/O operation (unless the job does no I/O at all).
Note the terminology: A "burst" is the amount of computing a Job wants to do before choosing to do I/O. Depending on the CPU scheduing algorithm in force, these bursts may be divided into "quanta" (plural of "quantum").
Field Summary | |
static int |
BLOCKED
State value indicating that the Job needs to do an I/O operation next |
int |
burstStart
Time when current burst started (job "arrived" at the cpu queue) |
static int |
DONE
State value indicating that the Job has completed |
static int |
READY
State value indicating that the Job is ready to run |
java.lang.Object |
schedulerInfo
A place for the scheduler to store arbitrary info about this Job. |
Constructor Summary | |
Job(java.io.BufferedReader traceFile)
Creates a Job from a line of the trace file. |
Method Summary | |
int |
arrivalTime()
Indicates when this Job first arrived in the system. |
int |
burstRemaining()
Returns the amount of CPU time remaining for this job until it next blocks for I/O or completes. |
int |
burstUsed()
Indicates the amount of CPU time has this job used since the start of the burst (not including overhead). |
int |
currentBurst()
Indicates the total length of the current burst. |
void |
doIO()
Called by the simulator when this Job does an I/O operation |
JobStats |
finish()
This job is finished. |
void |
startJob()
Called by the simulator when this Job is started running on the CPU |
int |
state()
Indicates the current state of this Job. |
void |
stopJob()
Called by the simulator when this Job is removed from the CPU |
java.lang.String |
toString()
For debugging, information about this Job. |
void |
updateRemaining()
Called when an accurate value of the remaining time for this job is needed. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int DONE
public static final int BLOCKED
public static final int READY
public int burstStart
public java.lang.Object schedulerInfo
Constructor Detail |
public Job(java.io.BufferedReader traceFile) throws java.io.EOFException
traceFile
- the file to read from.Method Detail |
public java.lang.String toString()
job jobnumber[arrival-time; cpu; io] where cpu = total/remaining/burst-remaining and io = total/remainingotherwise, just the serial number.
public int state()
public int arrivalTime()
public int currentBurst()
public int burstRemaining()
public int burstUsed()
public void startJob()
public void stopJob()
public void updateRemaining()
public void doIO()
public JobStats finish()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |