| java.lang.Object org.griphyn.cPlanner.visualize.spaceusage.SpaceUsageCallback
All known Subclasses: org.griphyn.cPlanner.visualize.spaceusage.TailStatd,
SpaceUsageCallback | public class SpaceUsageCallback implements Callback(Code) | | Implements callback interface to calculate space usage.
author: not attributable version: 1.0 |
Field Summary | |
final public static String | MAINJOB_MARKER The marker for the MAINJOB. | final public static String | POSTJOB_MARKER The marker for the POSTJOB. | final public static String | PREJOB_MARKER The marker for the PREJOB. | protected long | mJobInSize Stores in bytes the size of all the input files for a job. | protected long | mJobOutSize Stores in bytes the size of all the output files for a job. | protected JobSpace | mJobSpace Stores all the space readings for the current invocation record. | protected LogManager | mLogger The handle to the logger. | protected String | mMainJob The main job whose record is being parsed. | protected String | mSite The logical site where the job was run. | protected SpaceUsage | mSpaceStore The SpaceUsage object created during the callback construction. | protected boolean | mUseStatInfo Boolean indicating whether to use stat data or not for computing directory
sizes. |
Method Summary | |
public void | cbInputFile(String filename, StatInfo info) Callback function for when stat information for an input file is
encountered. | public void | cbInvocationEnd() Callback signalling that an invocation record has been parsed. | public void | cbInvocationStart(String job, String resource) Callback for the starting of an invocation record. | public void | cbOutputFile(String filename, StatInfo info) Callback function for when stat information for an output file is
encountered. | public void | cbStdERR(List jobs, String data) | public void | cbStdIN(List jobs, String data) | public void | cbStdOut(List jobs, String data) | public boolean | cleanupJob(String name) Returns boolean indicating whether the job is a cleanup job or not.
Does it on the basis of the name of the job.
Parameters: name - the name of the job. | public void | done() Callback signalling that we are done with the parsing of the files. | public Object | getConstructedObject() Returns the SpaceUsage store built. | protected int | getEventTypeForHeader(String marker) Returns the event type matching a header. | public void | initialize(String directory, boolean useStatInfo) Initializes the callback. | protected Space | parseContent(String header, String content) Parses the content and stores it in a Space object.
Parameters: header - the header from which the content was collected. Parameters: content - the Content. | protected boolean | validHeader(String token) Returns a boolean indicating whether the token passed matches
a header or not. |
MAINJOB_MARKER | final public static String MAINJOB_MARKER(Code) | | The marker for the MAINJOB. The stdout corresponding to the
MAINJOB is enclosed within this marker.
|
POSTJOB_MARKER | final public static String POSTJOB_MARKER(Code) | | The marker for the POSTJOB. The stdout corresponding to the
POSTJOB is enclosed within this marker.
|
PREJOB_MARKER | final public static String PREJOB_MARKER(Code) | | The marker for the PREJOB. The stdout corresponding to the
PREJOB is enclosed within this marker.
|
mJobInSize | protected long mJobInSize(Code) | | Stores in bytes the size of all the input files for a job.
|
mJobOutSize | protected long mJobOutSize(Code) | | Stores in bytes the size of all the output files for a job.
|
mJobSpace | protected JobSpace mJobSpace(Code) | | Stores all the space readings for the current invocation record.
|
mMainJob | protected String mMainJob(Code) | | The main job whose record is being parsed.
|
mSite | protected String mSite(Code) | | The logical site where the job was run.
|
mSpaceStore | protected SpaceUsage mSpaceStore(Code) | | The SpaceUsage object created during the callback construction.
|
mUseStatInfo | protected boolean mUseStatInfo(Code) | | Boolean indicating whether to use stat data or not for computing directory
sizes.
|
SpaceUsageCallback | public SpaceUsageCallback()(Code) | | The default constructor.
|
cbInputFile | public void cbInputFile(String filename, StatInfo info)(Code) | | Callback function for when stat information for an input file is
encountered. Empty for time being.
Parameters: filename - the name of the file. Parameters: info - the StatInfo about the file. |
cbInvocationEnd | public void cbInvocationEnd()(Code) | | Callback signalling that an invocation record has been parsed.
Stores the total compute size, somewhere in the space structure
for the jobs.
|
cbInvocationStart | public void cbInvocationStart(String job, String resource)(Code) | | Callback for the starting of an invocation record.
Parameters: job - the job/file being parsed. Parameters: resource - the site id where the job was executed. |
cbOutputFile | public void cbOutputFile(String filename, StatInfo info)(Code) | | Callback function for when stat information for an output file is
encountered. The size of the file is computed and stored.
Parameters: filename - the name of the file. Parameters: info - the StatInfo about the file. |
cleanupJob | public boolean cleanupJob(String name)(Code) | | Returns boolean indicating whether the job is a cleanup job or not.
Does it on the basis of the name of the job.
Parameters: name - the name of the job. boolean |
done | public void done()(Code) | | Callback signalling that we are done with the parsing of the files.
|
getConstructedObject | public Object getConstructedObject()(Code) | | Returns the SpaceUsage store built.
SpaceUsage |
getEventTypeForHeader | protected int getEventTypeForHeader(String marker)(Code) | | Returns the event type matching a header.
Parameters: header - the corresponding event type |
initialize | public void initialize(String directory, boolean useStatInfo)(Code) | | Initializes the callback.
Parameters: directory - the directory where all the files reside. Parameters: useStatInfo - boolean indicating whether to use stat info or not. |
parseContent | protected Space parseContent(String header, String content)(Code) | | Parses the content and stores it in a Space object.
Parameters: header - the header from which the content was collected. Parameters: content - the Content. Space |
validHeader | protected boolean validHeader(String token)(Code) | | Returns a boolean indicating whether the token passed matches
a header or not. In the specific case of using statinfo, for calculating
directory sizes, we only mainjob and postjob markers are valid.
Parameters: token - the token to be matched. Parameters: state - the current header being processed boolean |
|
|