org.griphyn.cPlanner.code.generator.condor
Class ClassADSGenerator

java.lang.Object
  extended by org.griphyn.cPlanner.code.generator.condor.ClassADSGenerator

public class ClassADSGenerator
extends Object

A helper class, that generates VDS specific classads for the jobs.

Version:
$Revision: 296 $
Author:
Karan Vahi

Field Summary
static String BUILD_AD_KEY
          The classad key for the pegasus build.
static String GENERATOR
          The name of the generator.
static String GENERATOR_AD_KEY
          The complete classad designating Pegasus as the generator.
static String JOB_CLASS_AD_KEY
          The class ad for job Class.
static String JOB_ID_AD_KEY
          The class ad for the jobId.
static String RESOURCE_AD_KEY
          The class ad to store the execution pool at which the job is run.
static String VERSION_AD_KEY
          The class ad key for the version id.
static String WF_NAME_AD_KEY
          The classad for the flow id.
static String WF_TIME_AD_KEY
          The classad for the timestamp.
static String XFORMATION_AD_KEY
          The classad for the complete transformation name.
 
Constructor Summary
ClassADSGenerator()
           
 
Method Summary
static void generate(PrintWriter writer, ADag dag)
          Writes out the classads for a workflow to corresponding writer stream.
static void generate(PrintWriter writer, ADag dag, SubInfo job)
          Writes out the classads for a job to corresponding writer stream.
static void generateBraindumpEntries(PrintWriter writer, ADag dag)
          Writes out the classads for a workflow to corresponding writer stream.
private static String generateBraindumpEntry(String name, String value)
          Generates a braindump entry given the name and the value.
private static String generateClassAdAttribute(String name, int value)
          Generates a classad attribute given the name and the value.
private static String generateClassAdAttribute(String name, String value)
          Generates a classad attribute given the name and the value.
private static String generateClassAdAttribute(String name, String value, boolean newLine)
          Generates a classad attribute given the name and the value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GENERATOR

public static final String GENERATOR
The name of the generator.

See Also:
Constant Field Values

GENERATOR_AD_KEY

public static final String GENERATOR_AD_KEY
The complete classad designating Pegasus as the generator.

See Also:
Constant Field Values

VERSION_AD_KEY

public static final String VERSION_AD_KEY
The class ad key for the version id.

See Also:
DagInfo.releaseVersion, Constant Field Values

BUILD_AD_KEY

public static final String BUILD_AD_KEY
The classad key for the pegasus build.

See Also:
Constant Field Values

WF_NAME_AD_KEY

public static final String WF_NAME_AD_KEY
The classad for the flow id.

See Also:
DagInfo.flowIDName, Constant Field Values

WF_TIME_AD_KEY

public static final String WF_TIME_AD_KEY
The classad for the timestamp.

See Also:
DagInfo.mFlowTimestamp, Constant Field Values

XFORMATION_AD_KEY

public static final String XFORMATION_AD_KEY
The classad for the complete transformation name.

See Also:
Constant Field Values

JOB_CLASS_AD_KEY

public static final String JOB_CLASS_AD_KEY
The class ad for job Class.

See Also:
SubInfo.jobClass, Constant Field Values

JOB_ID_AD_KEY

public static final String JOB_ID_AD_KEY
The class ad for the jobId.

See Also:
SubInfo.jobID, Constant Field Values

RESOURCE_AD_KEY

public static final String RESOURCE_AD_KEY
The class ad to store the execution pool at which the job is run. The globusscheduler specified in the submit file refers to the jobmanager on this execution pool.

See Also:
Constant Field Values
Constructor Detail

ClassADSGenerator

public ClassADSGenerator()
Method Detail

generate

public static void generate(PrintWriter writer,
                            ADag dag)
Writes out the classads for a workflow to corresponding writer stream.

Parameters:
writer - is an open stream for the Condor submit file.
dag - the workflow object containing metadata about the workflow like the workflow id and the release version.

generateBraindumpEntries

public static void generateBraindumpEntries(PrintWriter writer,
                                            ADag dag)
Writes out the classads for a workflow to corresponding writer stream.

Parameters:
writer - is an open stream for the Condor submit file.
dag - the workflow object containing metadata about the workflow like the workflow id and the release version.

generateBraindumpEntry

private static String generateBraindumpEntry(String name,
                                             String value)
Generates a braindump entry given the name and the value. It by default adds a new line character at start of each attribute.

Parameters:
name - the attribute name.
value - the value/expression making the classad attribute.
Returns:
the classad attriubute.

generate

public static void generate(PrintWriter writer,
                            ADag dag,
                            SubInfo job)
Writes out the classads for a job to corresponding writer stream. The writer stream points to a Condor Submit file for the job.

Parameters:
writer - is an open stream for the Condor submit file.
dag - the workflow object containing metadata about the workflow like the workflow id and the release version.
job - the SubInfo object for which the writer stream is passed.

generateClassAdAttribute

private static String generateClassAdAttribute(String name,
                                               String value)
Generates a classad attribute given the name and the value.

Parameters:
name - the attribute name.
value - the value/expression making the classad attribute.
Returns:
the classad attriubute.

generateClassAdAttribute

private static String generateClassAdAttribute(String name,
                                               int value)
Generates a classad attribute given the name and the value. It by default adds a new line character at start of each attribute.

Parameters:
name - the attribute name.
value - the value/expression making the classad attribute.
Returns:
the classad attriubute.

generateClassAdAttribute

private static String generateClassAdAttribute(String name,
                                               String value,
                                               boolean newLine)
Generates a classad attribute given the name and the value.

Parameters:
name - the attribute name.
value - the value/expression making the classad attribute.
newLine - boolean denoting whether to add a new line character at start or not.
Returns:
the classad attriubute.


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