edu.isi.pegasus.planner.namespace

## Class Globus

- java.lang.Object
- - edu.isi.pegasus.planner.namespace.Namespace
  - - edu.isi.pegasus.planner.namespace.Globus

    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$
Author:
  Karan Vahi

### Nested Class Summary

### Nested classes/interfaces inherited from class edu.isi.pegasus.planner.namespace.Namespace

`Namespace.EmptyIterator`

### Field Summary

Fields
`static java.util.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 java.lang.String` `mNamespace` The name of the implementing namespace.
`static java.lang.String` `NAMESPACE_NAME` The name of the namespace that this class implements.

### Fields inherited from class edu.isi.pegasus.planner.namespace.Namespace

`DEPRECATED_KEY, EMPTY_KEY, MALFORMED_KEY, mLogger, mProfileMap, NOT_PERMITTED_KEY, UNKNOWN_KEY, VALID_KEY, VERSION`

### Constructor Summary

Constructors
Constructor and Description
`Globus()` The default constructor.
`Globus(java.util.Map map)` The overloaded constructor

### Method Summary

All Methods Instance Methods Concrete Methods
`protected Aggregator` `aggregator(java.lang.String key)` Returns the aggregator to be used for the profile key while merging.
`int` `checkKey(java.lang.String key, java.lang.String value)` Additional method to handle the globus namespace with convenience mappings.
`void` `checkKeyInNS(PegasusProperties properties, java.lang.String pool)` It puts in the namespace specific information specified in the properties file into the namespace.
`java.lang.Object` `clone()` Returns a copy of the current namespace object
`void` `construct(java.lang.String key, java.lang.String value)` Constructs a new element of the format (key=value).
`private java.lang.String` `convert(java.util.Map rsl)` Converts a map with RSL kv-pairs into an RSL string.
`void` `merge(Namespace profiles)` Merge the profiles in the namespace in a controlled manner.
`java.lang.String` `namespaceName()` Returns the name of the namespace associated with the profile implementations.
`java.lang.String` `toCondor()` Converts the contents of the map into the string that can be put in the Condor file for printing.

### Methods inherited from class edu.isi.pegasus.planner.namespace.Namespace

`assimilate, checkKeyInNS, checkKeyInNS, checkKeyInNS, checkKeyInNS, checkKeyInNS, containsKey, deprecatedKey, deprecatedTable, emptyKey, get, getProfileKeyIterator, isEmpty, isNamespaceValid, keySet, malformedKey, notPermitted, removeKey, toString, unknownKey`

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

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

### Field Detail

#### NAMESPACE_NAME

    public static final java.lang.String NAMESPACE_NAME

The name of the namespace that this class implements.

See Also:
  Constant Field Values

#### mAggregatorTable

    public static java.util.Map mAggregatorTable

The table that maps the various globus profile keys to their aggregator functions.

#### mDefaultAggregator

    public static Aggregator mDefaultAggregator

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

#### mNamespace

    protected java.lang.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(java.util.Map map)

The overloaded constructor

Parameters:
  `map` - a possibly empty map.

### Method Detail

#### namespaceName

    public java.lang.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(java.lang.String key,
                          java.lang.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(java.lang.String key,
                        java.lang.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
     totalMemory      - 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,
                             java.lang.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.

#### toCondor

    public java.lang.String toCondor()

Converts the contents of the map into the string that can be put in the Condor file for printing.

Specified by:
  `toCondor` in class `Namespace`
Returns:
  the textual description.

#### clone

    public java.lang.Object clone()

Returns a copy of the current namespace object

Overrides:
  `clone` in class `Namespace`
Returns:
  the Cloned object

#### aggregator

    protected Aggregator aggregator(java.lang.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 java.lang.String convert(java.util.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.