mapping.data
Class JobsTable

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<java.lang.Long,Job>
          extended by mapping.data.JobsTable
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Long,Job>

public class JobsTable
extends java.util.Hashtable<java.lang.Long,Job>

This is the table of all the jobs of a Mapper. Any access to any Job in this table have to be made through the setters and getters of this class. This class is thread safe. This class notifies a JobsTableListener Class when the table is changed.

See Also:
Serialized Form

Field Summary
static int CLOCK_DIFFERENCE_TOLARNCE
           
 
Constructor Summary
JobsTable(int initialCapacity)
          Default constructor
 
Method Summary
 void addJob(Job job)
          This method add a job Job to this table.
 void addJobsTableListener(JobsTableListener listener)
           
 double getCommunicationDelayInSeconds()
          returns The mean of the differences between Time Started and Time Sent excluding timed out jobs.
 double getCommunicationDelayInSeconds(int jobClassID)
          returns The mean of the differences between Time Started and Time Sent for the class jobClassID excluding timed out jobs.
 double getCommunicationDelayInSecondsIncludingTimedOut()
          returns The mean of the differences between Time Started and Time Sent excluding timed out jobs.
 double getCommunicationDelayInSecondsIncludingTimedOut(int jobClassID)
          returns The mean of the differences between Time Started and Time Sent for the class jobClassID including timed out jobs.
 int getJobClassID(long l)
           
 java.lang.String getJobHostName(long l)
           
 long getJobIndex(long l)
           
 boolean getJobIsTimedOut(long l)
           
 long getJobIterations(long l)
           
 long getJobSecondaryID(long l)
           
 Server getJobServer(long l)
           
 java.lang.String getJobStatus(long l)
           
 java.util.GregorianCalendar getJobTimeDone(long l)
           
 java.util.GregorianCalendar getJobTimeSent(long l)
           
 java.util.GregorianCalendar getJobTimeStarted(long l)
           
 java.util.GregorianCalendar getJobTimeSubmitted(long l)
           
 double getResponseTimeInSeconds()
          returns The mean of the differences between Time Submitted and Time Done for all jobs excluding timed out jobs.
 double getResponseTimeInSeconds(int jobClassID)
          returns The mean of the differences between Time Submitted and Time Done for the job class with ID jobClassID excluding timed out jobs.
 double getResponseTimeInSecondsIncludingTimedOut()
          returns The mean of the differences between Time Submitted and Time Done including timed out jobs.
 double getResponseTimeInSecondsIncludingTimedOut(int jobClassID)
          returns The mean of the differences between Time Submitted and Time Done for the job class with ID class jobClassID including timed-out jobs
 double getSchedulingDelayInMilliSeconds()
          returns The mean of the differences between Time Sent and Time Submitted excluding timed out jobs.
 double getSchedulingDelayInMilliSeconds(int jobClassID)
          returns The mean of the differences between Time Sent and Time Submitted for the job class with ID jobClassID excluding timed out jobs.
 double getSchedulingDelayInMilliSecondsIncludingTimedOut()
          returns The mean of the differences between Time Sent and Time Submitted including timed out jobs.
 double getSchedulingDelayInMilliSecondsIncludingTimedOut(int jobClassID)
          returns The mean of the differences between Time Sent and Time Submitted for the class jobClassID including timed out jobs.
 int getTimeOutedJobsCount()
           
 int getTimeOutedJobsCount(int jobClassID)
           
 boolean isJobTimedOut(long l)
           
static void main(java.lang.String[] args)
           
 void printAll()
           
 void saveToFile(java.lang.String fileName)
           
 void setJobClassID(long id, int classID)
           
 void setJobSecondaryID(long id, long secondID)
           
 void setJobServer(long id, Server server)
           
 void setJobTimeDone(long id, java.util.GregorianCalendar cal)
           
 void setJobTimeSent(long id, java.util.GregorianCalendar cal)
           
 void setJobTimeStarted(long id, java.util.GregorianCalendar cal)
           
 void setJobTimeSubmitted(long id, java.util.GregorianCalendar cal)
           
 void setTimedOut(long id, boolean timedOut)
           
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLOCK_DIFFERENCE_TOLARNCE

public static int CLOCK_DIFFERENCE_TOLARNCE
Constructor Detail

JobsTable

public JobsTable(int initialCapacity)
Default constructor

Parameters:
initialCapacity -
Method Detail

addJob

public void addJob(Job job)
This method add a job Job to this table.

Parameters:
job - the job to be added.

printAll

public void printAll()

isJobTimedOut

public boolean isJobTimedOut(long l)

getJobHostName

public java.lang.String getJobHostName(long l)

getJobIndex

public long getJobIndex(long l)

getJobSecondaryID

public long getJobSecondaryID(long l)

getJobClassID

public int getJobClassID(long l)

getJobIterations

public long getJobIterations(long l)

getJobServer

public Server getJobServer(long l)

getJobStatus

public java.lang.String getJobStatus(long l)

getJobTimeSubmitted

public java.util.GregorianCalendar getJobTimeSubmitted(long l)

getJobTimeSent

public java.util.GregorianCalendar getJobTimeSent(long l)

getJobTimeStarted

public java.util.GregorianCalendar getJobTimeStarted(long l)

getJobTimeDone

public java.util.GregorianCalendar getJobTimeDone(long l)

getJobIsTimedOut

public boolean getJobIsTimedOut(long l)

setJobSecondaryID

public void setJobSecondaryID(long id,
                              long secondID)

setJobClassID

public void setJobClassID(long id,
                          int classID)

setJobServer

public void setJobServer(long id,
                         Server server)

setJobTimeSubmitted

public void setJobTimeSubmitted(long id,
                                java.util.GregorianCalendar cal)

setJobTimeSent

public void setJobTimeSent(long id,
                           java.util.GregorianCalendar cal)

setJobTimeStarted

public void setJobTimeStarted(long id,
                              java.util.GregorianCalendar cal)

setJobTimeDone

public void setJobTimeDone(long id,
                           java.util.GregorianCalendar cal)

setTimedOut

public void setTimedOut(long id,
                        boolean timedOut)

addJobsTableListener

public void addJobsTableListener(JobsTableListener listener)

getResponseTimeInSeconds

public double getResponseTimeInSeconds()
returns The mean of the differences between Time Submitted and Time Done for all jobs excluding timed out jobs.


getResponseTimeInSecondsIncludingTimedOut

public double getResponseTimeInSecondsIncludingTimedOut()
returns The mean of the differences between Time Submitted and Time Done including timed out jobs.


getSchedulingDelayInMilliSeconds

public double getSchedulingDelayInMilliSeconds()
returns The mean of the differences between Time Sent and Time Submitted excluding timed out jobs.


getSchedulingDelayInMilliSecondsIncludingTimedOut

public double getSchedulingDelayInMilliSecondsIncludingTimedOut()
returns The mean of the differences between Time Sent and Time Submitted including timed out jobs.


getCommunicationDelayInSeconds

public double getCommunicationDelayInSeconds()
returns The mean of the differences between Time Started and Time Sent excluding timed out jobs.


getCommunicationDelayInSecondsIncludingTimedOut

public double getCommunicationDelayInSecondsIncludingTimedOut()
returns The mean of the differences between Time Started and Time Sent excluding timed out jobs.


getResponseTimeInSeconds

public double getResponseTimeInSeconds(int jobClassID)
returns The mean of the differences between Time Submitted and Time Done for the job class with ID jobClassID excluding timed out jobs.


getResponseTimeInSecondsIncludingTimedOut

public double getResponseTimeInSecondsIncludingTimedOut(int jobClassID)
returns The mean of the differences between Time Submitted and Time Done for the job class with ID class jobClassID including timed-out jobs


getSchedulingDelayInMilliSeconds

public double getSchedulingDelayInMilliSeconds(int jobClassID)
returns The mean of the differences between Time Sent and Time Submitted for the job class with ID jobClassID excluding timed out jobs.


getSchedulingDelayInMilliSecondsIncludingTimedOut

public double getSchedulingDelayInMilliSecondsIncludingTimedOut(int jobClassID)
returns The mean of the differences between Time Sent and Time Submitted for the class jobClassID including timed out jobs.


getCommunicationDelayInSeconds

public double getCommunicationDelayInSeconds(int jobClassID)
returns The mean of the differences between Time Started and Time Sent for the class jobClassID excluding timed out jobs.


getCommunicationDelayInSecondsIncludingTimedOut

public double getCommunicationDelayInSecondsIncludingTimedOut(int jobClassID)
returns The mean of the differences between Time Started and Time Sent for the class jobClassID including timed out jobs.


saveToFile

public void saveToFile(java.lang.String fileName)

getTimeOutedJobsCount

public int getTimeOutedJobsCount(int jobClassID)
Parameters:
jobClassID - the id of the job class
Returns:
number of jobs belonging to that job class that has timed out.

getTimeOutedJobsCount

public int getTimeOutedJobsCount()
Returns:
number of jobs that has timed out.

main

public static void main(java.lang.String[] args)