org.griphyn.cPlanner.namespace
Class Globus

java.lang.Object
  extended by org.griphyn.cPlanner.classes.Data
      extended by org.griphyn.cPlanner.namespace.Namespace
          extended by org.griphyn.cPlanner.namespace.Globus
All Implemented Interfaces:
Cloneable

public class Globus
extends Namespace

This helper class helps in handling the globus rsl key value pairs that come through profile information for namespace Globus. The information can either come in through transformation catalog, site catalog or through profile tags in DAX.

Version:
$Revision: 50 $
Author:
Karan Vahi

Nested Class Summary
 
Nested classes/interfaces inherited from class org.griphyn.cPlanner.namespace.Namespace
Namespace.EmptyIterator
 
Field Summary
static Map mAggregatorTable
          The table that maps the various globus profile keys to their aggregator functions.
static Aggregator mDefaultAggregator
          The default aggregator to be used for profile aggregation, if none specified in the aggregator table;
protected  String mNamespace
          The name of the implementing namespace.
static String NAMESPACE_NAME
          The name of the namespace that this class implements.
 
Fields inherited from class org.griphyn.cPlanner.namespace.Namespace
DEPRECATED_KEY, MALFORMED_KEY, mProfileMap, NOT_PERMITTED_KEY, UNKNOWN_KEY, VALID_KEY, VERSION
 
Fields inherited from class org.griphyn.cPlanner.classes.Data
mLogger, mLogMsg
 
Constructor Summary
Globus()
          The default constructor.
Globus(Map map)
          The overloaded constructor
 
Method Summary
protected  Aggregator aggregator(String key)
          Returns the aggregator to be used for the profile key while merging.
 int checkKey(String key, String value)
          Additional method to handle the globus namespace with convenience mappings.
 void checkKeyInNS(PegasusProperties properties, String pool)
          It puts in the namespace specific information specified in the properties file into the namespace.
 Object clone()
          Returns a copy of the current namespace object
 void construct(String key, String value)
          Constructs a new element of the format (key=value).
private  String convert(Map rsl)
          Converts a map with RSL kv-pairs into an RSL string.
protected  void enforceMinTime(PegasusProperties properties, String key)
          Enforces a minimum time if specified in the properties.
 void merge(Namespace profiles)
          Merge the profiles in the namespace in a controlled manner.
 String namespaceName()
          Returns the name of the namespace associated with the profile implementations.
 String toString()
          Converts the contents of the map into the string that can be put in the Condor file for printing.
 
Methods inherited from class org.griphyn.cPlanner.namespace.Namespace
checkKeyInNS, checkKeyInNS, checkKeyInNS, checkKeyInNS, containsKey, deprecatedKey, deprecatedTable, get, getProfileKeyIterator, isNamespaceValid, keySet, malformedKey, notPermitted, removeKey, unknownKey
 
Methods inherited from class org.griphyn.cPlanner.classes.Data
setToString, vectorToString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAMESPACE_NAME

public static final String NAMESPACE_NAME
The name of the namespace that this class implements.

See Also:
Constant Field Values

mAggregatorTable

public static Map mAggregatorTable
The table that maps the various globus profile keys to their aggregator functions.

See Also:
#Aggregator

mDefaultAggregator

public static Aggregator mDefaultAggregator
The default aggregator to be used for profile aggregation, if none specified in the aggregator table;


mNamespace

protected String mNamespace
The name of the implementing namespace. It should be one of the valid namespaces always.

See Also:
Namespace.isNamespaceValid(String)
Constructor Detail

Globus

public Globus()
The default constructor.


Globus

public Globus(Map map)
The overloaded constructor

Parameters:
map - a possibly empty map.
Method Detail

namespaceName

public String namespaceName()
Returns the name of the namespace associated with the profile implementations.

Specified by:
namespaceName in class Namespace
Returns:
the namespace name.
See Also:
NAMESPACE_NAME

construct

public void construct(String key,
                      String value)
Constructs a new element of the format (key=value). All the keys are converted to lower case before storing.

Overrides:
construct in class Namespace
Parameters:
key - is the left-hand-side
value - is the right hand side

checkKey

public int checkKey(String key,
                    String value)
Additional method to handle the globus namespace with convenience mappings. Currently supported keys are:
 arguments      - not supported, clashes with Condor
 count          - OK
 directory      - not supported, clashes with Pegasus
 dryRun         - OK, beware the consequences!
 environment    - not supported, use env namespace
 executable     - not supported, clashes with Condor
 gramMyjob      - OK
 hostCount      - OK
 jobType                - OK to handle MPI jobs
 maxCpuTime     - OK
 maxMemory      - OK
 maxTime                - OK
 maxWallTime    - OK
 minMemory      - OK
 project                - OK
 queue          - OK
 stdin          - not supported, clashes with Pegasus
 stdout         - not supported, clashes with Pegasus
 stderr         - not supported, clashes with Pegasus

 rls            - OK: Chimera's generic extension (AOB)
 

Specified by:
checkKey in class Namespace
Parameters:
key - is the key within the globus namespace, must be lowercase!
value - is the value for the given key.
Returns:
MALFORMED_KEY VALID_KEY UNKNOWN_KEY NOT_PERMITTED_KEY

merge

public void merge(Namespace profiles)
Merge the profiles in the namespace in a controlled manner. In case of intersection, the new profile value overrides, the existing profile value.

Specified by:
merge in class Namespace
Parameters:
profiles - the Namespace object containing the profiles.

checkKeyInNS

public void checkKeyInNS(PegasusProperties properties,
                         String pool)
It puts in the namespace specific information specified in the properties file into the namespace. The name of the pool is also passed, as many of the properties specified in the properties file are on a per pool basis. An empty implementation for the timebeing. It is handled in the submit writer.

Specified by:
checkKeyInNS in class Namespace
Parameters:
properties - the PegasusProperties object containing all the properties that the user specified at various places (like .chimerarc, properties file, command line).
pool - the pool name where the job is scheduled to run.

toString

public String toString()
Converts the contents of the map into the string that can be put in the Condor file for printing.

Specified by:
toString in class Data
Returns:
the textual description.

clone

public Object clone()
Returns a copy of the current namespace object

Overrides:
clone in class Object
Returns:
the Cloned object

enforceMinTime

protected void enforceMinTime(PegasusProperties properties,
                              String key)
Enforces a minimum time if specified in the properties.

Parameters:
properties - the properties object holding the properties.
key - the RSL time key .

aggregator

protected Aggregator aggregator(String key)
Returns the aggregator to be used for the profile key while merging. If no aggregator is found, the then default Aggregator (Update) is used.

Parameters:
key - the key for which the aggregator is found.
Returns:
the aggregator for the profile key.

convert

private String convert(Map rsl)
Converts a map with RSL kv-pairs into an RSL string.

Parameters:
rsl - is the RSL map to convert
Returns:
the new string to use in globusrsl of Condor.


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