wiki:AppDb
Last modified 13 years ago Last modified on 01/20/09 20:05:36

Application Performance Database (AppDB)

This is the documentation/development page for AppDB pointing to installation, maintenance, and development details. AppDB can be accessed directly from http://gridportal.cis.uab.edu/AppDB/ while more general information on AppDB is available on CCL's projects page.

AppDB installation

  • Download Tomcat(Tomcat 6.0.14 used for this project) tar file onto your local machine.
    For Tomcat Download go to the following URL: Tomcat Download and Click on the tar.gz link under "Binary Distributions"->"Core"
  • Upload the Tomcat tar file to the gridportal.cis.uab.edu machine while logged in as "appdb" user
  • Download Hibernate(hibernate-3.2 used for this project) onto your local machine. For Hibernate download go to the following URL: Hibernate Download
    and click on the hibernate-3.2.6.ga.tar.gz file to start download
  • Upload the Hibernate ga.tar.gz file from to the gridportal.cis.uab.edu machine while logged in as "appdb" user
  • Unzip or Extract the contents of the above tar files as follows:
      tar xvf apache-tomcat-6.0.14.tar.gz 
      tar xvf hibernate-3.2.5.ga.tar.gz 
    
  • Download Java Development Kit(jdk1.6 used for this project) by following this URL: Java Download
  • Upload the JDK1.6 installed in the previous step onto the gridportal.cis.uab.edu machine while logged in as "appdb" user. Make sure to download the non RPM package (jdk-6u11-linux-i586.bin).
  • Extract to your $HOME directory in gridportal and install with.
    ./jdk-6u11-linux-i586.bin
    
  • Now set the appropriate PATH and CLASSPATH by editing your ~/.bash_profile: NOTE: check that JAVA_HOME below points to the correct JAVA distribution that you just extracted. at the time of this writing, the latest jdk is jdk1.6 update 11.
        vi  ~/.bash_profile
    
  • Paste the following instruction into the ~/.bash_profile file:
     # .bash_profile
    
     # Get the aliases and functions
     if [ -f ~/.bashrc ]; then
           . ~/.bashrc
     fi
    
     # User specific environment and startup programs
    
     PATH=$PATH:$HOME/bin
    
     # export PATH
     export JAVA_HOME=~/jdk1.6.0_11
     export PATH=${JAVA_HOME}/bin:${PATH}
    
     export CATALINA_HOME=~/apache-tomcat-6.0.14
     export PATH=${CATALINA_HOME}/bin:${PATH}
    
     export CLASSPATH=.:~/hibernate-3.2/hibernate3.jar:~/hibernate-3.2/lib/*:$CATALINA_HOME/webapps/AppDB/WEB-INF/classes/:$CLASSPATH
    
  • Log out and log in again into the appdb account for the PATH and CLASSPATH settings to be updated
  • Set the manager username and password to login into Tomcat. Do the following: Go to $CATALINA_HOME/conf/tomcat-users.xml and paste the following instruction anywhere within <tomcat-users> tags (not in the commented section). Keep rolename="manager" and roles="manager", but values for username and password can be changed appropriately:
      <role rolename="manager"/>
      <user username="manager" password="manager" roles="manager"/>
    

Software requirements

  • JDK 1.5 or higher versions
  • Hibernate 3.2 or higher versions
  • Tomcat 6.0 or higher versions
  • MySQL 5.0.22 or higher (installation instructions are available here:

Installation procedure

  • Download AppDB.tar.gz from http://students.cis.uab.edu/afgane/software/AppDB.tar.gz
  • Copy and extract contents of "AppDB.tar.gz" file containing all the source files into "apache-tomcat-6.0.14/webapps" using command:
       tar xvf AppDB.tar.gz
    
  • AppDB uses MySQL as the back-end DRM. In order to use AppDB, an AppDB database needs to be setup in MySQL. In the AppDB.tar.gz a file names AppDB.sql is provided that contains all necessary tables. In order to import this table structure into MySQL, the user needs to have access to MySQL and have a database created. In order to import the database structure, execute the following command:
       mysql -u <USER_NAME> -p <DATABASE_NAME> < AppDB.sql
       Enter password: <USER_NAME_PASSWORD>
    

The following is the table structure that should have been created by executing the above command:

   mysql> show tables;
   +-------------------+
   | Tables_in_test    |
   +-------------------+
   | AppJob            | 
   | AppParamMapping   | 
   | Application       | 
   | JobParameter      | 
   | JobTask           | 
   | Resources         | 
   | Statistics        | 
   | TaskParameter     | 
   | inputfiles        | 
   | jobfilestatistics | 
   | parameters        | 
   | userinfo          | 
   +-------------------+
   12 rows in set (0.00 sec)
  • AppDB uses Hibernate and thus a hibernate configuration file (hibernate.cfg.xml) needs to be edited to account for the new installation. There are two instances of this file and they both needs to be edited equally. The files are located in '$CATALINA_HOME/webapps/AppDB/WEB_INF/src/' and in '$CATALINA_HOME/webapps/AppDB/WEB_INF/classes'. The following three entries in the file need to be updated:
      <property name="hibernate.connection.url">jdbc:mysql://localhost/[DATABASE_NAME]</property>
      <property name="hibernate.connection.username">[USER_NAME]</property>
      <property name="hibernate.connection.password">[MySQL_USER_PASSWORD]</property>
    
  • By default Tomcat uses following ports: 8005 (SHUTDOWN), 8009 (APJ 1.3), 8080 (HTTP), and 8443 (HTTPS). If you need to change these ports, you need to edit file "$CATALINA_HOME/conf/server.xml" and change port numbers.

When ready, start the Tomcat server by executing $CATALINA_HOME/bin/startup.sh (To shutdown the server use $CATALINA_HOME/bin/shutdown.sh). Open a browser(Firefox, IE etc.,). Type in the URL: e.g., http://gridportal.cis.uab.edu:<PORT_NUMBER>/AppDB. You should be redirected to the Login page of AppDB.

  • If you get a 'permission denied' message do a "chmod +x startup.sh" to rectify the error.

Environment

Starting and stopping web server

  • Start the Tomcat server with the following instruction:
      $CATALINA_HOME/bin/startup.sh
    
  • Shutdown the Tomcat server with the following instrcution:
     $CATALINA_HOME/bin/shutdown.sh
    

Installation issues

org.apache.catalina.util.DefaultAnnotationProcessor? exception

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: java.lang.ClassCastException: org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProcessor
	org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:156)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

java.lang.ClassCastException: org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProcessor
	org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:146)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

Add the following line to context.xml file (inside Context element) in $CATALINA_HOME/conf directory (this makes classloading in Tomcat sticking to J2EE spec) and restart the server:

<Loader delegate="true"/>

Other possible solutions to errors:

  • Instead of cglib.jar add cg-nodep.jar to avoid dependencies of asm

Manipulating database

Adding/Removing? a table in the database

Adding a table

  • Login to the database with the following command:
       mysql -u appdb -p appdb
    
    The above command will ask for the password. Enter the appdb password for the database
  • The following SQL command will create a new table:
      CREATE TABLE ''table_name''(''column_1'' type, ''column_2'' type, ''column_3'' type);
      
      Eg: CREATE TABLE TaskParameter(AppName varchar(40) NOT NULL,JobName varchar(30) NOT NULL,TaskID varchar(30) NOT NULL,TaskParameterName varchar(30) PRIMARY KEY,TaskParameterValue varchar(30) NOT NULL);
    
  • In the apache-tomcat-6.0.14/webapps/AppDB/WEB-INF/src/distributed folder, create a new Java class with the same name as the table created Eg:TaskParameter?.java and an XML file with the same name too Eg: TaskParameter?.hbm.xml
  • TaskParameter?.java has the getter and setter methods for every column in the TaskParameter? table. The code looks like below:
        public class TaskParameter implements Serializable{
           String AppName;
           String JobName;
           String TaskID;
           String TaskParameterName;
           String TaskParameterValue;
    	
    	
    	public String getAppName() {
    		return AppName;
    	}
    	public void setAppName(String AppName) {
    		this.AppName = AppName;
    	}
    	
    	public String getJobName() {
    		return JobName;
    	}
    	public void setJobName(String JobName) {
    		this.JobName = JobName;
    	}
    	
    	public String getTaskParameterName() {
    		return TaskParameterName;
    	}
    	public void setTaskParameterName(String parameterID) {
    		TaskParameterName = parameterID;
    	}
    	public String getTaskParameterValue() {
    		return TaskParameterValue;
    	}
    	public void setTaskParameterValue(String parameterValue) {
    		TaskParameterValue = parameterValue;
    	}
    	
    	public String getTaskID() {
    		return TaskID;
    	}
    	public void setTaskID(String taskID) {
    		TaskID = taskID;
    	}
           
    }
    
    
  • TaskParameter?.hbm.xml file has all the mappings from the columns of the table to the corresponding variables in the TaskParameter?.java class. The xml file looks like:
         <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
              "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    
    <hibernate-mapping>
      <class name="distributed.TaskParameter" table="TaskParameter">
        <composite-id>
             <key-property column="AppName"  name="AppName" type="java.lang.String" />
             <key-property column="JobName"  name="JobName" type="java.lang.String"/>
             <key-property column="TaskID"  name="TaskID" type="java.lang.String"/>
             <key-property column="TaskParameterName"  name="TaskParameterName" type="java.lang.String"/>
          </composite-id>
       
    	   <property name="TaskParameterValue">
    	  		<column name="TaskParameterValue"/>
    	  </property>
          
        </class>
    </hibernate-mapping>
    
  • Compile the TaskParameter?.java file as follows:
      javac TaskParameter.java
    
  • The compilation in the above step produces a .class file named "TaskParameter?.class"
  • The TaskParameter?.class should be present in the folder: apache-tomcat-6.0.14/webapps/AppDB/WEB-INF/classes/distributed
  • Make sure that the TaskParameter?.hbm.xml file is present in both apache-tomcat-6.0.14/webapps/AppDB/WEB-INF/src/distributed and apache-tomcat-6.0.14/webapps/AppDB/WEB-INF/classes/distributed
  • Edit the hibernate.cfg.xml file present in apache-tomcat-6.0.14/webapps/AppDB/WEB-INF/src/ and apache-tomcat-6.0.14/webapps/AppDB/WEB-INF/classes/ as follows:
      <mapping resource="distributed/TaskParameter.hbm.xml" />
    
    Add the above mapping at the end of the hibernate.cfg.xml file
  • Make sure that the hibernate.cfg.xml file is present in both apache-tomcat-6.0.14/webapps/AppDB/WEB-INF/src/ and apache-tomcat-6.0.14/webapps/AppDB/WEB-INF/classes/

Removing a table

  • Login to the "appdb" database as follows:
     mysql -u appdb -p appdb
    
  • Delete the table with the following SQL command:
     DROP TABLE ''table_name'' ;
     Eg: DROP TABLE TaskParameter;
    

  • Delete the corresponding Java file and .hbm.xml file associated with the table from the apache-tomcat-6.0.14/webapps/AppDB/WEB-INF/src/distributed folder
  • Delete the mapping of the .hbm.xml file in the hibernate.cfg.xml file
  • Delete the corresponding .class and .hbm.xml file associated with the table from apache-tomcat-6.0.14/webapps/AppDB/WEB-INF/classes/distributed folder

Adding/removing a field to an existing table

Adding a field

  • Login to the "appdb" database as follows:
     mysql -u appdb -p appdb
    
  • Add a column with the following SQL command:
      ALTER TABLE ''table_name'' ADD COLUMN ''column_name'' type property;
    
      Eg: ALTER TABLE inputfiles ADD COLUMN JobName varchar(20) NOT NULL;
          ALTER TABLE inputfiles ADD COLUMN AppName varchar(40) PRIMARY KEY;
    
  • Edit the correspoding .java and .hbm.xml files to add this extra field. In the .java file we would have a "private" variable and a getter and setter method for the added column and in the .hbm.xml file provide a mapping between the added column and the variable in the .java file
  • Shutdown and re-start the server to update the changes

Deleting a field

  • Login to the "appdb" database as follows:
     mysql -u appdb -p appdb
    
  • Delete a column with the following SQL command:
      ALTER TABLE ''table_name'' DROP COLUMN ''column_name'';
    
      Eg: ALTER TABLE inputfiles DROP COLUMN JobName;
          ALTER TABLE inputfiles DROP COLUMN AppName;
    
  • Edit the correspoding .java and .hbm.xml files to delete this field. In the .java file we would have to remove the "private" variable and a getter and setter method of the deleted column and in the .hbm.xml file remove the mapping between the deleted column and the variable in the .java file
  • Shutdown and re-start the server to update the changes

Web interface

  • Registered users have access to all the data provided by AppDB. A new user can register himself/herself by following the link on the Login Page. The user registering on the page would have to fill out a form giving his Email Address, Password, Name, Affiliation and Description. An email will be triggered to the user containing a link for confirmation of his registration. Once the user confirms his email address, he will be able to access the site with this Email Address and Password.
  • Registered users can create a new Application, Job, Resource, Task, Parameters, Statistics, Input File Statistics and Task Parameters.
  • Registered users can also view all the currently active entities in the database.

Module interactions

  • index.jsp - This is the login page provided to the user. This page can be accessed by the URL http://gridportal.cis.uab.edu/AppDB. A registered user can log in with his Email Address and Password. This page provides two other links: 1. Registration link if the user is using AppDB for the first time 2. Forgot password link, if a registered user forgets his/her password.

A new session is started using the following code:

public Session openSession() {
SessionFactory sessionFactory = new Configuration().configure(
"hibernate.cfg.xml").buildSessionFactory();
Session session = sessionFactory.openSession();
return session;
}

The page takes in the username and password from the user. The username is the email address of the user. The hash value of the password is compared with the value stored in the database. If the username or password does not match, then an error message is displayed to the user and the user would have to re-login. If the user is authenticated successfully then the user is redirected to main.jsp page. The username and the hibernate session objects are set as follows:

session.setAttribute("userid",userid); session.setAttribute("hbsession", hbsession);

The password's hash value is obtained by using the java.security.MessageDigest? class. The algorithm used is "SHA" (Secure Hash Algorithm)

  • header.jsp: This is the file that contains the header image ccl_logo.jpg. This file is included in all the JSP pages thus having a common header for all the pages related to AppDB
  • register.jsp - The user is taken to this page when he clicks on the "New User, Click Here" link provided on the Login page. The user has to fill up a form and when he submits the form an email is sent to the user's email address. The email sent to the user contains a link which the user has to click in order to confirm his email address and thus acts a way of authenticating the user's email address.
  • forgotPass.jsp - The user is taken to this page when he clicks on the "Forgot Password?" link provided on the Login page. The user has to enter his email address(which was used during registration) and a new password. An email is triggered to the user. The email contains a link which the user has to click on, to reset his password.
  • verifyUser.jsp - This is the page whose URL is sent to the user as a link in the email when he registers on the AppDB site. For every user who registers on the site, a unique guid is generated which is appended as a query string at the end of the URL Eg: http://gridportal.cis.uab.edu/verifyUser.jsp?guid=XXXXXX. Once the user clicks on this link, the users email address is verified by setting a flag in the "userinfo" table as true. Thus the user will be able to log in to the AppDB site.
  • verifyPass.jsp - This is the page whose URL is sent to the user as a link in the email when he wants to reset his password. For every user based on his email address a unique guid is generated which is appended as a query string at the end of the URL Eg: http://gridportal.cis.uab.edu/verifyPass.jsp?guid=XXXXX. Once the user clicks on this link, his password is reset.
  • main.jsp - This is the main page of AppDB. When a user logs in successfully from index.jsp page, he is redirected to the main.jsp page. This page contains all the menus to create and view entities. Simply by clicking on all the links in the page the user will be able to view all the information in the same page. By clicking on the link once again, the user can hide the information.

The page has three menus:

  1. Create Menu - Used to create entities like Job, Application, Task, Resources etc.,
  2. Show All Jobs - displays the list of all jobs run by all the users
  3. Show Only My Jobs - displays the list of all jobs run by the user who has logged in.


This page also has links to the User Info page, Help Page and Logout

  • userinfo.jsp - This page is used to view and edit user information. The user can edit his/her Name, Affiliation and Description on this page.
  • help.jsp - This page is a generic help page explaining about what every entity in the database means and how to navigate.
  • logout.jsp - When the user clicks on the "Logout" link, the user session expires and the user is re-directed to the login page.
  • createData.jsp - When the user clicks on the "Create Menu" link on the main.jsp page, the user is re-directed to the createData.jsp page. The user can create new Applications, Jobs, Tasks, Resources, Parameters, Statistics, Input File Statistics and Task Parameters. The user can go back to the main page by clicking on the "Back to Main Page" link.

Wizard for multiple Task creation

When the user clicks on the Wizard for creating a Job and adding multiple Tasks link on the page, we go to the createJob.jsp page.

createJob.jsp: This is the first page of the wizard. In this page a new Job can be created by giving the input Application Name, Job Name, Total Runtime and Total Number of CPUs. The user can also create a new Application by following the link: No application? Create New Application

Clicking submit will take the user to the 2nd page. The 2nd page of the wizard is the jobProperty.jsp

jobProperty.jsp: In this page the user can add a Job Property or a Job File Statistic for the job created in the previous page. However this is optional. If the user does not want to create a Job Property or File Statistic, then he can follow the link: Go to Add Task page This will take the user to the noftasks.jsp page

noftasks.jsp: In this page, the user has to enter the number of Resources on which he wants to register his/her Tasks. The number provided should be an integer else an error message comes up asking the user to enter an integer. The user then clicks on the Add Task button. This will take the user to the createTaskArea.jsp page

createTaskArea.jsp: In this page, the user can add as many tasks as required under each resource specified. All these tasks are added under a single job. The user need not specify an explicit Task Name. A default Task Name is assigned to each task. For example, if the user adds 10 tasks then the Tasks are named by default as Task 0, Task 1, Task 2 and so on. The user has to enter the Task RunTimes? for each task inside the Text Area provided. The values provided in the Text area is parsed and added to the table. The user can go back to the noftasks.jsp page by clicking on the link at the top left corner. The user can also add a new Resource for the tasks being added by following the link: No Resources? Add a new Resource

Usage Record Support

The createData.jsp page supports the upload of an XML file defined under the Usage Record standards, parses the XML and populates the required database. Thus the user can add tasks in two ways: 1. By following the Wizard to add multiple Tasks 2. Uploading a usage-record XML

Uploading an XML file, parsing it and then updating the database tables:

  1. A browse button is provided to browse the local file system and select an XML file to be uploaded. The request to upload the file is sent as a "multipart" request.
<FORM ENCTYPE="multipart/form-data" METHOD="POST" ACTION="usageRecord.jsp">
<tr>Export an Usage Record XML File</tr><br>
<tr><input type="file" name="browseButton">
</tr><br>
<tr><input type="submit" name="submit" value="Export XML"></tr><br>
</FORM>

The input type="file" provides the browse button and allows the user to select a file from the local file system. The request is then sent to usageRecord.jsp page encrypted as a multipart request.

usageRecord.jsp

We use the package org.apache.commons.fileupload.* for uploading the XML file onto the web server. The part of code that performs the file upload is as follows:

Source/Link? used for the below code:

http://www.developershome.com/wap/wapUpload/wap_upload.asp?page=jsp

<%
if (ServletFileUpload.isMultipartContent(request)){
%>
<b>Entered if loop</b>

<%
ServletFileUpload servletFileUpload = new ServletFileUpload(new DiskFileItemFactory());
List fileItemsList = servletFileUpload.parseRequest(request);

String optionalFileName = "tmp.xml";
FileItem fileItem = null;

Iterator it = fileItemsList.iterator();
while (it.hasNext()){
FileItem fileItemTemp = (FileItem)it.next();
if (fileItemTemp.isFormField()){
%>

<b>Name-value Pair Info:</b><br/>
Field name: <%= fileItemTemp.getFieldName() %><br/>
Field value: <%= fileItemTemp.getString() %><br/><br/>

<%
if (fileItemTemp.getFieldName().equals("filename"))
optionalFileName = fileItemTemp.getString();
}
else
fileItem = fileItemTemp;
}

if (fileItem!=null){
String fileName = fileItem.getName();
%>

<b>Uploaded File Info:</b><br/>
Content type: <%= fileItem.getContentType() %><br/>
Field name: <%= fileItem.getFieldName() %><br/>
File name: <%= fileName %><br/>
File size: <%= fileItem.getSize() %><br/><br/>

<%
/* Save the uploaded file if its size is greater than 0. */
if (fileItem.getSize() > 0){
if (optionalFileName.trim().equals(""))
fileName = FilenameUtils.getName(fileName);
else
fileName = optionalFileName;

String dirName = "/tmp/";

File saveTo = new File(dirName + fileName);
try {
fileItem.write(saveTo);
%>

<b>The uploaded file has been saved successfully.</b>

<%
}
catch (Exception e){
e.printStackTrace();
}
}
}
}
%>

XML Parsing:

Used the SAX Parser. More about the SAX Parser from the Wikipedia link:

A parser which implements SAX (ie, a SAX Parser) functions as a stream parser, with an event-driven API. The user defines a number of callback methods that will be called when events occur during parsing. The SAX events include:

  • XML Text nodes
  • XML Element nodes
  • XML Processing Instructions
  • XML Comments

Events are fired when each of these XML features are encountered, and again when the end of them is encountered. XML attributes are provided as part of the data passed to element events.

SAX parsing is unidirectional; previously parsed data cannot be re-read without starting the parsing operation again.

Source: http://en.wikipedia.org/wiki/Simple_API_for_XML

Start the parsing of the XML file given the input:

public static void startParse(String fileName) throws Exception {
XMLReader xr = XMLReaderFactory.createXMLReader();
XML_Parser_Class handler = new XML_Parser_Class();
xr.setContentHandler(handler);
xr.setErrorHandler(handler);
out = new OutputStreamWriter(System.out, "UTF8");



// Parse each file provided on the
// command line.

FileReader r = new FileReader(fileName);
xr.parse(new InputSource(r));

}

We use the callback function for "startelement" and read in all the tags and set the corresponding boolean values to be true. The characters method who's prototype is as follows: characters(char ch[], int start, int length) throws SAXException is used to read in the values for each of the tags. The sample XML files that can be parsed by XML_Parser_Class.java are given below:

<?xml version="1.0" encoding="UTF-8"?>
<JobUsageRecord xmlns="http://schema.ogf.org/urf/2003/09/urf"
xmlns:urf="http://schema.ogf.org/urf/2003/09/urf"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schema.ogf.org/urf/2003/09/urf
file:/Users/bekah/Documents/GGF/URWG/urwg-schema.09.xsd">
<RecordIdentity urf:recordId="http://www.emsl.pnl.gov/mscf/colony/PBS.1234.0" urf:createTime="2003-08-13T18:56:56Z" />
<JobIdentity> >
<LocalJobId>PBS.1234.0</LocalJobId>
</JobIdentity>
<UserIdentity>
<LocalUserId>scottmo</LocalUserId>
</UserIdentity> 
<Charge>2870</Charge>
<Status>completed</Status> 
<Memory urf:storageUnit="MB">1234</Memory>
<ServiceLevel urf:type="QOS">BottomFeeder</ServiceLevel>
<Processors>4</Processors> 
<ProjectName>mscfops</ProjectName>
<MachineName>Colony</MachineName>
<WallDuration>PT1S</WallDuration>
<StartTime>2003-08-13T17:34:50Z</StartTime>
<EndTime>2003-08-13T18:37:38Z</EndTime> 
<NodeCount>2</NodeCount> 
<Queue>batch</Queue> 
<Resource urf:description="quoteId">1435</Resource>
<Resource urf:description="application">NWChem</Resource>
<Resource urf:description="executable">nwchem_linux</Resource>
</JobUsageRecord>
<?xml version="1.0" encoding="UTF-8"?>
<UsageRecord xmlns="http://schema.ogf.org/urf/2003/09/urf"
xmlns:urf="http://schema.ogf.org/urf/2003/09/urf"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schema.ogf.org/urf/2003/09/urf
file:/Users/bekah/Documents/GGF/URWG/urwg-schema.09.02.xsd">
<RecordIdentity urf:createTime="2003-08-15T14:25:56Z"
urf:recordId="urn:nasa:arc:usage:82125.lomax.nas.nasa.gov:0"/>
<urf:JobIdentity>
<urf:LocalJobId>82125.lomax.nas.nasa.gov</urf:LocalJobId>
</urf:JobIdentity>
<urf:UserIdentity>
<urf:LocalUserId>foobar</urf:LocalUserId>
</urf:UserIdentity>
<Status urf:description="pbs exit status">0</Status>
<urf:Memory urf:metric="max" urf:storageUnit="KB"
urf:type="virtual">1060991</urf:Memory>
<urf:Processors urf:metric="total">32</urf:Processors>
<urf:EndTime>2003-06-16T08:24:32Z</urf:EndTime>
<urf:ProjectName urf:description="local charge
group">g13563</urf:ProjectName>
<urf:Host urf:primary="true">lomax.nas.nasa.gov</urf:Host>
<urf:Queue>lomax</urf:Queue>
<urf:WallDuration>PT45M48S</urf:WallDuration>
<urf:CpuDuration>PT15S</urf:CpuDuration>
<urf:Resource urf:description="pbs-jobname">m0.20a-7.0b0.0v</urf:Resource>
</UsageRecord>

The tables that get updated after parsing the XML are: AppJob?, JobTask? and TaskParameter?

The tag LocalJobId? of the XML corresponds to the TaskName? of AppDB

The tag ProjectName? of the XML corresponds to the JobName? of AppDB

The tag WallDuration? of the XML corresponds to the RunTime? of a Task in AppDB

The tag MachineName? of the XML corresponds to the HostName? of the Resource in AppDB

The above fields are added to the JobTask? table in AppDB. A default Application Name is added for the sake for completeness.

The tag StartTime? of the XML is added as a Task parameter in the TaskParameter? table

The tag EndTime? of the XML is added as a Task Parameter in the TaskParameter? table

The tag Processors of the XML corresponds to the TotalNumCPUs of the AppJob? table

The tag LocalUserId? of the XML corresponds to the UserID of the AppJob? table

The Runtime entered for the Job is the total Runtime of all the Tasks. If there is only one task added to the system, then the Runtime of the Job is equal to that task RunTime?.