edu.isi.pegasus.planner.invocation

## Class InvocationRecord

- java.lang.Object
- - org.griphyn.vdl.Chimera
  - - edu.isi.pegasus.planner.invocation.Invocation
    - - edu.isi.pegasus.planner.invocation.InvocationRecord

All Implemented Interfaces:
  java.io.Serializable

    public class InvocationRecord
    extends Invocation

This class is the container for an invocation record. The record itself contains information about the job or jobs that ran, the total usage, and information about central files that were used.

Version:
  $Revision$
Author:
  Jens-S. Vöckler, Yong Zhao
See Also:
  Serialized Form

### Field Summary

Fields
`private WorkingDir` `m_cwd` Working directory at startup.
`private java.lang.String` `m_derivation` Name of the Derivation that produced this invocation.
`private double` `m_duration` total duration of call.
`private Environment` `m_environment` Environment settings.
`private int` `m_gid` numerical group id of the effective user.
`private java.lang.String` `m_group` symbolical group name of the effective user.
`private java.net.InetAddress` `m_hostaddr` host address where gridlaunch ran (primary interface).
`private java.lang.String` `m_hostname` Symbolic hostname where gridlaunch ran (primary interface).
`private java.lang.String` `m_interface` Symbolic name of primary interface we used to determine host-name and -address.
`private java.util.List` `m_job` Job records: prejob, main job, postjob
`private Machine` `m_machine` The Machine object capturing machine information.
`private int` `m_pid` process id of gridlaunch itself.
`private long` `m_pmem` Records the physical memory on the remote machine, if available.
`private java.lang.String` `m_resource` Resource, site or pool at which the jobs was run.
`private java.util.Date` `m_start` start of gridlaunch timestamp.
`private java.util.List` `m_stat` Array with stat() and fstat() information about various files.
`private java.lang.String` `m_transformation` Name of the: Transformation that produced this invocation.
`private int` `m_uid` numerical user id of the effective user.
`private int` `m_umask` Currently active umask while kickstart was executing.
`private Architecture` `m_uname` Architectural information.
`private Usage` `m_usage` Total resource consumption by gridlaunch and all siblings.
`private java.lang.String` `m_user` symbolical user name of the effective user.
`private java.lang.String` `m_version` protocol version information.
`private java.lang.String` `m_wf_label` Workflow label, currently optional?
`private java.util.Date` `m_wf_stamp` Workflow timestamp to make the label more unique.
`static java.lang.String` `SCHEMA_LOCATION` The "not-so-official" location URL of the invocation record definition.
`static java.lang.String` `SCHEMA_NAMESPACE` The "official" namespace URI of the invocation record schema.

### Constructor Summary

Constructors
Constructor and Description
`InvocationRecord()` Default c'tor: Construct a hollow shell and allow further information to be added later.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addJob(int index, Job job)` Accessor: Inserts a Job into a specific position of the job list.
`void` `addJob(Job job)` Accessor: Appends a job to the list of jobs.
`void` `addStatCall(int index, StatCall stat)` Accessor: Inserts a StatCall into a specific position of the stat list.
`void` `addStatCall(StatCall stat)` Accessor: Appends a stat to the list of stats.
`Architecture` `getArchitecture()` Accessor
`java.lang.String` `getDerivation()` Accessor
`double` `getDuration()` Accessor
`Environment` `getEnvironment()` Accessor
`int` `getGID()` Accessor
`java.lang.String` `getGroup()` Accessor
`java.net.InetAddress` `getHostAddress()` Accessor
`java.lang.String` `getHostname()` Accessor
`java.lang.String` `getInterface()` Accessor.
`Job` `getJob(int index)` Accessor: Obtains a job at a certain position in the job list.
`int` `getJobCount()` Accessor: Obtains the size of the job list.
`java.util.List` `getJobList()` Accessor: Gets an array of all values that constitute the current content.
`Machine` `getMachine()` Accessor.
`long` `getPhysicalMemory()` Accessor.
`int` `getPID()` Accessor
`java.lang.String` `getResource()` Accessor
`java.util.Date` `getStart()` Accessor
`StatCall` `getStatCall(int index)` Accessor: Obtains a stat at a certain position in the stat list.
`int` `getStatCount()` Accessor: Obtains the size of the stat list.
`java.util.List` `getStatList()` Accessor: Gets an array of all values that constitute the current content.
`java.lang.String` `getTransformation()` Accessor
`int` `getUID()` Accessor
`int` `getUMask()` Accessor
`Usage` `getUsage()` Accessor
`java.lang.String` `getUser()` Accessor
`java.lang.String` `getVersion()` Accessor
`java.lang.String` `getWorkflowLabel()` Accessor
`java.util.Date` `getWorkflowTimestamp()` Accessor
`WorkingDir` `getWorkingDirectory()` Accessor
`java.util.Iterator` `iterateJob()` Accessor: Enumerates the internal values that constitute the content of the job list.
`java.util.Iterator` `iterateStatCall()` Accessor: Enumerates the internal values that constitute the content of the stat list.
`java.util.ListIterator` `listIterateJob()` Accessor: Enumerates the internal values that constitute the content of the job list.
`java.util.ListIterator` `listIterateStatCall()` Accessor: Enumerates the internal values that constitute the content of the stat list.
`void` `removeAllJob()` Accessor: Removes all values from the job list.
`void` `removeAllStatCall()` Accessor: Removes all values from the stat list.
`Job` `removeJob(int index)` Accessor: Removes a specific job from the job list.
`StatCall` `removeStatCall(int index)` Accessor: Removes a specific stat from the stat list.
`void` `setArchitecture(Architecture uname)` Accessor.
`void` `setDerivation(java.lang.String derivation)` Accessor.
`void` `setDuration(double duration)` Accessor.
`void` `setEnvironment(Environment environment)` Accessor.
`void` `setGID(int gid)` Accessor.
`void` `setGroup(java.lang.String group)` Accessor.
`void` `setHostAddress(java.net.InetAddress hostaddr)` Accessor.
`void` `setHostname(java.lang.String hostname)` Accessor.
`void` `setInterface(java.lang.String p_interface)` Accessor.
`void` `setJob(java.util.Collection jobs)` Accessor: Overwrites internal list with an external list representing jobs.
`void` `setJob(int index, Job job)` Accessor: Overwrites a job at a certain position.
`void` `setMachine(Machine machine)` Accessor.
`void` `setPhysicalMemory(long pmem)` Accessor.
`void` `setPID(int pid)` Accessor.
`void` `setResource(java.lang.String resource)` Accessor.
`void` `setStart(java.util.Date start)` Accessor.
`void` `setStatCall(java.util.Collection stats)` Accessor: Overwrites internal list with an external list representing stats.
`void` `setStatCall(int index, StatCall stat)` Accessor: Overwrites a stat at a certain position.
`void` `setTransformation(java.lang.String transformation)` Accessor.
`void` `setUID(int uid)` Accessor.
`void` `setUMask(int umask)` Accessor.
`void` `setUsage(Usage usage)` Accessor.
`void` `setUser(java.lang.String user)` Accessor.
`void` `setVersion(java.lang.String version)` Accessor.
`void` `setWorkflowLabel(java.lang.String label)` Accessor.
`void` `setWorkflowTimestamp(java.util.Date stamp)` Accessor.
`void` `setWorkingDirectory(java.lang.String cwd)` Accessor.
`void` `setWorkingDirectory(WorkingDir cwd)` Accessor.
`void` `toString(java.io.Writer stream)` Converts the active state into something meant for human consumption.
`void` `toXML(java.io.Writer stream, java.lang.String indent, java.lang.String namespace)` Dump the state of the current element as XML output.
`void` `writeXMLHeader(java.io.Writer stream, java.lang.String indent, java.lang.String namespace)` Writes the header of the XML output.

### Methods inherited from class org.griphyn.vdl.Chimera

`escape, quote, toString, toXML, toXML, writeAttribute`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### SCHEMA_NAMESPACE

    public static final java.lang.String SCHEMA_NAMESPACE

The "official" namespace URI of the invocation record schema.

See Also:
  Constant Field Values

#### SCHEMA_LOCATION

    public static final java.lang.String SCHEMA_LOCATION

The "not-so-official" location URL of the invocation record definition.

See Also:
  Constant Field Values

#### m_version

    private java.lang.String m_version

protocol version information.

#### m_start

    private java.util.Date m_start

start of gridlaunch timestamp.

#### m_duration

    private double m_duration

total duration of call.

#### m_transformation

    private java.lang.String m_transformation

Name of the: Transformation that produced this invocation.

#### m_derivation

    private java.lang.String m_derivation

Name of the Derivation that produced this invocation.

#### m_pmem

    private long m_pmem

Records the physical memory on the remote machine, if available.

#### m_pid

    private int m_pid

process id of gridlaunch itself.

#### m_hostaddr

    private java.net.InetAddress m_hostaddr

host address where gridlaunch ran (primary interface).

#### m_hostname

    private java.lang.String m_hostname

Symbolic hostname where gridlaunch ran (primary interface).

#### m_interface

    private java.lang.String m_interface

Symbolic name of primary interface we used to determine host-name and -address.

#### m_uid

    private int m_uid

numerical user id of the effective user.

#### m_user

    private java.lang.String m_user

symbolical user name of the effective user.

#### m_gid

    private int m_gid

numerical group id of the effective user.

#### m_group

    private java.lang.String m_group

symbolical group name of the effective user.

#### m_cwd

    private WorkingDir m_cwd

Working directory at startup.

#### m_uname

    private Architecture m_uname

Architectural information.

#### m_usage

    private Usage m_usage

Total resource consumption by gridlaunch and all siblings.

#### m_job

    private java.util.List m_job

Job records: prejob, main job, postjob

#### m_stat

    private java.util.List m_stat

Array with stat() and fstat() information about various files.

#### m_resource

    private java.lang.String m_resource

Resource, site or pool at which the jobs was run.

#### m_wf_label

    private java.lang.String m_wf_label

Workflow label, currently optional?

#### m_wf_stamp

    private java.util.Date m_wf_stamp

Workflow timestamp to make the label more unique.

#### m_environment

    private Environment m_environment

Environment settings.

#### m_umask

    private int m_umask

Currently active umask while kickstart was executing. This is available with new kickstart, older version will have -1 at this API point.

#### m_machine

    private Machine m_machine

The Machine object capturing machine information.

### Constructor Detail

#### InvocationRecord

    public InvocationRecord()

Default c'tor: Construct a hollow shell and allow further information to be added later.

### Method Detail

#### getUMask

    public int getUMask()

Accessor

See Also:
  `setUMask(int)`

#### setUMask

    public void setUMask(int umask)

Accessor.

Parameters:
  `umask` -
See Also:
  `getUMask()`

#### getVersion

    public java.lang.String getVersion()

Accessor

See Also:
  `setVersion(String)`

#### setVersion

    public void setVersion(java.lang.String version)

Accessor.

Parameters:
  `version` -
See Also:
  `getVersion()`

#### getStart

    public java.util.Date getStart()

Accessor

See Also:
  `setStart(Date)`

#### setStart

    public void setStart(java.util.Date start)

Accessor.

Parameters:
  `start` -
See Also:
  `getStart()`

#### getDuration

    public double getDuration()

Accessor

See Also:
  `setDuration(double)`

#### setDuration

    public void setDuration(double duration)

Accessor.

Parameters:
  `duration` -
See Also:
  `getDuration()`

#### setMachine

    public void setMachine(Machine machine)

Accessor.

Parameters:
  `machine` -
See Also:
  `getMachine()`

#### getMachine

    public Machine getMachine()

Accessor.

Returns:
  machine
See Also:
  `#setMachine(org.griphyn.vdl.invocation.Machine)`

#### getTransformation

    public java.lang.String getTransformation()

Accessor

See Also:
  `setTransformation(String)`

#### setTransformation

    public void setTransformation(java.lang.String transformation)

Accessor.

Parameters:
  `transformation` -
See Also:
  `getTransformation()`

#### getDerivation

    public java.lang.String getDerivation()

Accessor

See Also:
  `setDerivation(String)`

#### setDerivation

    public void setDerivation(java.lang.String derivation)

Accessor.

Parameters:
  `derivation` -
See Also:
  `getDerivation()`

#### getPID

    public int getPID()

Accessor

See Also:
  `setPID(int)`

#### setPID

    public void setPID(int pid)

Accessor.

Parameters:
  `pid` -
See Also:
  `getPID()`

#### getHostAddress

    public java.net.InetAddress getHostAddress()

Accessor

See Also:
  `setHostAddress(InetAddress)`

#### setHostAddress

    public void setHostAddress(java.net.InetAddress hostaddr)

Accessor.

Parameters:
  `hostaddr` -
See Also:
  `getHostAddress()`

#### getHostname

    public java.lang.String getHostname()

Accessor

See Also:
  `setHostname(String)`

#### setHostname

    public void setHostname(java.lang.String hostname)

Accessor.

Parameters:
  `hostname` -
See Also:
  `getHostname()`

#### getInterface

    public java.lang.String getInterface()

Accessor.

See Also:
  `setInterface(String)`

#### setInterface

    public void setInterface(java.lang.String p_interface)

Accessor.

Parameters:
  `p_interface` -
See Also:
  `getInterface()`

#### getUID

    public int getUID()

Accessor

See Also:
  `setUID(int)`

#### setUID

    public void setUID(int uid)

Accessor.

Parameters:
  `uid` -
See Also:
  `getUID()`

#### getUser

    public java.lang.String getUser()

Accessor

See Also:
  `setUser(String)`

#### setUser

    public void setUser(java.lang.String user)

Accessor.

Parameters:
  `user` -
See Also:
  `getUser()`

#### getGID

    public int getGID()

Accessor

See Also:
  `setGID(int)`

#### setGID

    public void setGID(int gid)

Accessor.

Parameters:
  `gid` -
See Also:
  `getGID()`

#### getGroup

    public java.lang.String getGroup()

Accessor

See Also:
  `setGroup(String)`

#### setGroup

    public void setGroup(java.lang.String group)

Accessor.

Parameters:
  `group` -
See Also:
  `getGroup()`

#### getUsage

    public Usage getUsage()

Accessor

See Also:
  `setUsage(Usage)`

#### setUsage

    public void setUsage(Usage usage)

Accessor.

Parameters:
  `usage` -
See Also:
  `getUsage()`

#### getArchitecture

    public Architecture getArchitecture()

Accessor

See Also:
  `setArchitecture(Architecture)`

#### setArchitecture

    public void setArchitecture(Architecture uname)

Accessor.

Parameters:
  `uname` -
See Also:
  `getArchitecture()`

#### getResource

    public java.lang.String getResource()

Accessor

See Also:
  `setResource( String )`

#### setResource

    public void setResource(java.lang.String resource)

Accessor.

Parameters:
  `resource` -
See Also:
  `getResource()`

#### getWorkflowLabel

    public java.lang.String getWorkflowLabel()

Accessor

See Also:
  `setWorkflowLabel( String )`

#### setWorkflowLabel

    public void setWorkflowLabel(java.lang.String label)

Accessor.

Parameters:
  `label` -
See Also:
  `getWorkflowLabel()`

#### getWorkflowTimestamp

    public java.util.Date getWorkflowTimestamp()

Accessor

See Also:
  `setWorkflowTimestamp( Date )`

#### setWorkflowTimestamp

    public void setWorkflowTimestamp(java.util.Date stamp)

Accessor.

Parameters:
  `stamp` -
See Also:
  `getResource()`

#### getEnvironment

    public Environment getEnvironment()

Accessor

See Also:
  `setEnvironment(Environment)`

#### setEnvironment

    public void setEnvironment(Environment environment)

Accessor.

Parameters:
  `environment` -
See Also:
  `getEnvironment()`

#### addJob

    public void addJob(Job job)

Accessor: Appends a job to the list of jobs.

Parameters:
  `job` - is the job to append to the list.

#### addJob

    public void addJob(int index,
                       Job job)

Accessor: Inserts a Job into a specific position of the job list.

Parameters:
  `index` - is the position to insert the item into
  `job` - is the job to insert into the list.

#### getJob

    public Job getJob(int index)
               throws java.lang.IndexOutOfBoundsException

Accessor: Obtains a job at a certain position in the job list.

Parameters:
  `index` - is the position in the list to obtain a job from
Returns:
  the job at that position.
Throws:
  `java.lang.IndexOutOfBoundsException` - if the index points to an element in the list that does not contain any elments.

#### getJobCount

    public int getJobCount()

Accessor: Obtains the size of the job list.

Returns:
  number of elements that an external array needs to be sized to.

#### getJobList

    public java.util.List getJobList()

Accessor: Gets an array of all values that constitute the current content. This list is read-only.

Returns:
  a list of jobs.

#### iterateJob

    public java.util.Iterator iterateJob()

Accessor: Enumerates the internal values that constitute the content of the job list.

Returns:
  an iterator to walk the list with.

#### listIterateJob

    public java.util.ListIterator listIterateJob()

Accessor: Enumerates the internal values that constitute the content of the job list.

Returns:
  a list iterator to walk the list with.

#### removeAllJob

    public void removeAllJob()

Accessor: Removes all values from the job list.

#### removeJob

    public Job removeJob(int index)

Accessor: Removes a specific job from the job list.

Parameters:
  `index` - is the position at which an element is to be removed.
Returns:
  the job that was removed.

#### setJob

    public void setJob(int index,
                       Job job)
                throws java.lang.IndexOutOfBoundsException

Accessor: Overwrites a job at a certain position.

Parameters:
  `index` - position to overwrite an elment in.
  `job` - is the Job to replace with.
Throws:
  `java.lang.IndexOutOfBoundsException` - if the position pointed to is invalid.

#### setJob

    public void setJob(java.util.Collection jobs)

Accessor: Overwrites internal list with an external list representing jobs.

Parameters:
  `jobs` - is the external list of job to overwrite with.

#### addStatCall

    public void addStatCall(StatCall stat)

Accessor: Appends a stat to the list of stats.

Parameters:
  `stat` - is the stat to append to the list.

#### addStatCall

    public void addStatCall(int index,
                            StatCall stat)

Accessor: Inserts a StatCall into a specific position of the stat list.

Parameters:
  `index` - is the position to insert the item into
  `stat` - is the stat to insert into the list.

#### getStatCall

    public StatCall getStatCall(int index)
                         throws java.lang.IndexOutOfBoundsException

Accessor: Obtains a stat at a certain position in the stat list.

Parameters:
  `index` - is the position in the list to obtain a stat from
Returns:
  the stat at that position.
Throws:
  `java.lang.IndexOutOfBoundsException` - if the index points to an element in the list that does not contain any elments.

#### getStatCount

    public int getStatCount()

Accessor: Obtains the size of the stat list.

Returns:
  number of elements that an external array needs to be sized to.

#### getStatList

    public java.util.List getStatList()

Accessor: Gets an array of all values that constitute the current content. This list is read-only.

Returns:
  a list of stats.

#### iterateStatCall

    public java.util.Iterator iterateStatCall()

Accessor: Enumerates the internal values that constitute the content of the stat list.

Returns:
  an iterator to walk the list with.

#### listIterateStatCall

    public java.util.ListIterator listIterateStatCall()

Accessor: Enumerates the internal values that constitute the content of the stat list.

Returns:
  a list iterator to walk the list with.

#### removeAllStatCall

    public void removeAllStatCall()

Accessor: Removes all values from the stat list.

#### removeStatCall

    public StatCall removeStatCall(int index)

Accessor: Removes a specific stat from the stat list.

Parameters:
  `index` - is the position at which an element is to be removed.
Returns:
  the stat that was removed.

#### setStatCall

    public void setStatCall(int index,
                            StatCall stat)
                     throws java.lang.IndexOutOfBoundsException

Accessor: Overwrites a stat at a certain position.

Parameters:
  `index` - position to overwrite an elment in.
  `stat` - is the StatCall to replace with.
Throws:
  `java.lang.IndexOutOfBoundsException` - if the position pointed to is invalid.

#### setStatCall

    public void setStatCall(java.util.Collection stats)

Accessor: Overwrites internal list with an external list representing stats.

Parameters:
  `stats` - is the external list of stat to overwrite with.

#### getWorkingDirectory

    public WorkingDir getWorkingDirectory()

Accessor

See Also:
  `setWorkingDirectory(WorkingDir)`, `setWorkingDirectory(String)`

#### setWorkingDirectory

    public void setWorkingDirectory(java.lang.String cwd)

Accessor.

Parameters:
  `cwd` -
See Also:
  `getWorkingDirectory()`, `setWorkingDirectory(WorkingDir)`

#### setWorkingDirectory

    public void setWorkingDirectory(WorkingDir cwd)

Accessor.

Parameters:
  `cwd` -
See Also:
  `getWorkingDirectory()`, `setWorkingDirectory(String)`

#### getPhysicalMemory

    public long getPhysicalMemory()

Accessor.

Returns:
  the recorded physical memory in byte, or -1 if not available.
See Also:
  `setPhysicalMemory( long )`

#### setPhysicalMemory

    public void setPhysicalMemory(long pmem)

Accessor.

Parameters:
  `pmem` -
See Also:
  `getPhysicalMemory()`

#### toString

    public void toString(java.io.Writer stream)
                  throws java.io.IOException

Converts the active state into something meant for human consumption. The method will be called when recursively traversing the instance tree.

Specified by:
  `toString` in class `org.griphyn.vdl.Chimera`
Parameters:
  `stream` - is a stream opened and ready for writing. This can also be a string stream for efficient output.
Throws:
  `java.io.IOException` - if something fishy happens to the stream.

#### writeXMLHeader

    public void writeXMLHeader(java.io.Writer stream,
                               java.lang.String indent,
                               java.lang.String namespace)
                        throws java.io.IOException

Writes the header of the XML output. The output contains the special strings to start an XML document, some comments, and the root element. The latter points to the XML schema via XML Instances.

Parameters:
  `stream` - is a stream opened and ready for writing. This can also be a string stream for efficient output.
  `indent` - is a `String` of spaces used for pretty printing. The initial amount of spaces should be an empty string. The parameter is used internally for the recursive traversal.
  `namespace` - is the XML schema namespace prefix. If neither empty nor null, each element will be prefixed with this prefix, and the root element will map the XML namespace.
Throws:
  `java.io.IOException` - if something fishy happens to the stream.

#### toXML

    public void toXML(java.io.Writer stream,
                      java.lang.String indent,
                      java.lang.String namespace)
               throws java.io.IOException

Dump the state of the current element as XML output. This function traverses all sibling classes as necessary, and converts the data into pretty-printed XML output. The stream interface should be able to handle large output efficiently.

Specified by:
  `toXML` in class `org.griphyn.vdl.Chimera`
Parameters:
  `stream` - is a stream opened and ready for writing. This can also be a string stream for efficient output.
  `indent` - is a `String` of spaces used for pretty printing. The initial amount of spaces should be an empty string. The parameter is used internally for the recursive traversal.
  `namespace` - is the XML schema namespace prefix. If neither empty nor null, each element will be prefixed with this prefix, and the root element will map the XML namespace.
Throws:
  `java.io.IOException` - if something fishy happens to the stream.
See Also:
  `BufferedWriter`