edu.isi.pegasus.planner.visualize.spaceusage
Class TailStatd

java.lang.Object
  extended by edu.isi.pegasus.planner.visualize.spaceusage.SpaceUsageCallback
      extended by edu.isi.pegasus.planner.visualize.spaceusage.TailStatd
All Implemented Interfaces:
Callback

public class TailStatd
extends SpaceUsageCallback

The callback parses the jobstate.log file to order the events of how the jobs executed.

Version:
$Revision: 2563 $
Author:
Karan Vahi vahi@isi.edu

Field Summary
static String GRIDSTART_MAINJOB_STATE
          The state in the jobstate that is taken to designate the GRIDSTART_MAINJOB time.
static String GRIDSTART_POSTJOB_STATE
          The state in the jobstate that is taken to designate the GRIDSTART_POSTJOB time.
static String GRIDSTART_PREJOB_STATE
          The state in the jobstate that is taken to designate the GRIDSTART_PREJOB time.
static String JOBSTATE_LOG
          The name of the tailstatd file.
private  String mDirectory
          The directory where all the files reside.
private  Map mJobSpaceStore
          A Map store that stores JobSpace objects indexed by the name of the jobs.
private  LogManager mLogger
          The handle to the logging object
 
Fields inherited from class edu.isi.pegasus.planner.visualize.spaceusage.SpaceUsageCallback
MAINJOB_MARKER, mJobInSize, mJobOutSize, mJobSpace, mMainJob, mSite, mSpaceStore, mUseStatInfo, POSTJOB_MARKER, PREJOB_MARKER
 
Fields inherited from interface edu.isi.pegasus.planner.visualize.Callback
VERSION
 
Constructor Summary
TailStatd()
          The default constructor.
 
Method Summary
 void cbInvocationStart(String job, String resource)
          Callback for the starting of an invocation record.
private  int getEventType(String state)
          Returns the event type matching a particular job type
 void initialize(String directory, boolean useStatInfo)
          Initializes the callback.
protected  Space parseContent(String header, String content)
          Parses the content and stores it in a SpaceUsage object.
protected  boolean validState(String state)
          Returns a boolean indicating whether the state is valid or not.
 
Methods inherited from class edu.isi.pegasus.planner.visualize.spaceusage.SpaceUsageCallback
cbInputFile, cbInvocationEnd, cbMachine, cbMetadata, cbOutputFile, cbStdERR, cbStdIN, cbStdOut, cleanupJob, done, getConstructedObject, getEventTypeForHeader, validHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JOBSTATE_LOG

public static final String JOBSTATE_LOG
The name of the tailstatd file.

See Also:
Constant Field Values

GRIDSTART_PREJOB_STATE

public static final String GRIDSTART_PREJOB_STATE
The state in the jobstate that is taken to designate the GRIDSTART_PREJOB time.

See Also:
Constant Field Values

GRIDSTART_MAINJOB_STATE

public static final String GRIDSTART_MAINJOB_STATE
The state in the jobstate that is taken to designate the GRIDSTART_MAINJOB time.

See Also:
Constant Field Values

GRIDSTART_POSTJOB_STATE

public static final String GRIDSTART_POSTJOB_STATE
The state in the jobstate that is taken to designate the GRIDSTART_POSTJOB time.

See Also:
Constant Field Values

mDirectory

private String mDirectory
The directory where all the files reside.


mJobSpaceStore

private Map mJobSpaceStore
A Map store that stores JobSpace objects indexed by the name of the jobs.


mLogger

private LogManager mLogger
The handle to the logging object

Constructor Detail

TailStatd

public TailStatd()
The default constructor.

Method Detail

initialize

public void initialize(String directory,
                       boolean useStatInfo)
Initializes the callback.

Specified by:
initialize in interface Callback
Overrides:
initialize in class SpaceUsageCallback
Parameters:
directory - the directory where all the files reside.
useStatInfo - boolean indicating whether to use stat info or not.

cbInvocationStart

public void cbInvocationStart(String job,
                              String resource)
Callback for the starting of an invocation record.

Specified by:
cbInvocationStart in interface Callback
Overrides:
cbInvocationStart in class SpaceUsageCallback
Parameters:
job - the job/file being parsed.
resource - the site id where the job was executed.

parseContent

protected Space parseContent(String header,
                             String content)
Parses the content and stores it in a SpaceUsage object. The date is taken from the jobstate.log instead of the date in the record.

Overrides:
parseContent in class SpaceUsageCallback
Parameters:
header - the header from which the content was collected.
content - the Content.
Returns:
Space

validState

protected boolean validState(String state)
Returns a boolean indicating whether the state is valid or not.

Parameters:
state - the state
Returns:
boolean

getEventType

private int getEventType(String state)
Returns the event type matching a particular job type

Parameters:
state - the state of the job
Returns:
the corresponding event type


Copyright © 2011 The University of Southern California. All Rights Reserved.