Modifier and Type | Field and Description |
---|---|
static String |
MAINJOB_MARKER
The marker for the MAINJOB.
|
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.
|
static String |
POSTJOB_MARKER
The marker for the POSTJOB.
|
static String |
PREJOB_MARKER
The marker for the PREJOB.
|
Constructor and Description |
---|
SpaceUsageCallback()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
cbInputFile(String filename,
StatInfo info)
Callback function for when stat information for an input file is
encountered.
|
void |
cbInvocationEnd()
Callback signalling that an invocation record has been parsed.
|
void |
cbInvocationStart(String job,
String resource)
Callback for the starting of an invocation record.
|
void |
cbMachine(Machine machine)
Callback to pass the machine information on which the job is executed.
|
void |
cbMetadata(Map metadata)
Callback for the metadata retrieved from the kickstart record.
|
void |
cbOutputFile(String filename,
StatInfo info)
Callback function for when stat information for an output file is
encountered.
|
void |
cbStdERR(List jobs,
String data)
Callback function for the data section of stderr.
|
void |
cbStdIN(List jobs,
String data)
Callback function for the data section of stdin.
|
void |
cbStdOut(List jobs,
String data)
Callback function for the data section of stdout.
|
boolean |
cleanupJob(String name)
Returns boolean indicating whether the job is a cleanup job or not.
|
void |
done()
Callback signalling that we are done with the parsing of the files.
|
Object |
getConstructedObject()
Returns the SpaceUsage store built.
|
protected int |
getEventTypeForHeader(String marker)
Returns the event type matching a header.
|
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.
|
private void |
parseData(String data)
Parses the data in the data section.
|
protected boolean |
validHeader(String token)
Returns a boolean indicating whether the token passed matches
a header or not.
|
public static final String PREJOB_MARKER
public static final String MAINJOB_MARKER
public static final String POSTJOB_MARKER
protected String mSite
protected SpaceUsage mSpaceStore
protected String mMainJob
protected LogManager mLogger
protected boolean mUseStatInfo
protected long mJobOutSize
protected long mJobInSize
protected JobSpace mJobSpace
public void initialize(String directory, boolean useStatInfo)
initialize
in interface Callback
directory
- the directory where all the files reside.useStatInfo
- boolean indicating whether to use stat info or not.public void cbInvocationStart(String job, String resource)
cbInvocationStart
in interface Callback
job
- the job/file being parsed.resource
- the site id where the job was executed.public void cbStdIN(List jobs, String data)
Callback
public void cbStdOut(List jobs, String data)
Callback
public void cbStdERR(List jobs, String data)
Callback
public void cbInputFile(String filename, StatInfo info)
cbInputFile
in interface Callback
filename
- the name of the file.info
- the StatInfo
about the file.public void cbOutputFile(String filename, StatInfo info)
cbOutputFile
in interface Callback
filename
- the name of the file.info
- the StatInfo
about the file.public void cbInvocationEnd()
cbInvocationEnd
in interface Callback
public Object getConstructedObject()
getConstructedObject
in interface Callback
private void parseData(String data)
data
- Stringpublic void done()
protected boolean validHeader(String token)
token
- the token to be matched.public boolean cleanupJob(String name)
name
- the name of the job.protected Space parseContent(String header, String content)
header
- the header from which the content was collected.content
- the Content.protected int getEventTypeForHeader(String marker)
marker
- the markerpublic void cbMetadata(Map metadata)
cbMetadata
in interface Callback
metadata
- Copyright © 2011 The University of Southern California. All Rights Reserved.