edu.isi.pegasus.planner.classes

## Class TCMap

- java.lang.Object
- - edu.isi.pegasus.planner.classes.TCMap

    public class TCMap
    extends java.lang.Object

This is a data class to store the TCMAP for a particular dag. This data class is populated and maintained in the TCMapper and is queried from the Interpool Engine and site selectors. The TCMAP is a hashmap which maps an lfn to a Map which contains keys as siteids and values as List of TransformationCatalogEntry objects TCMAP= lfn1 ---> MAP1 lfn2 ---> MAP2 MAP1 = site1 ---> List1 site2 ---> List2 List1 = TCE1 TCE2 TCEn

Version:
  $Revision$
Author:
  Gaurang Mehta

### Field Summary

Fields
`private LogManager` `mLogger`
`private java.util.Map` `mTCMap` The TCMap for a dag is stored in this HashMap.

### Constructor Summary

Constructors
Constructor and Description
`TCMap()` Default constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`java.util.List` `getSiteList(java.lang.String fqlfn)` Returns a List of siteid's that are valid for a particular lfn.
`java.util.List` `getSiteList(java.lang.String fqlfn, java.util.List sites)` Returns a list of siteid's that are valid for a particular lfn and among a list of input sites
`java.util.Map` `getSiteMap(java.lang.String fqlfn)` Returns a HashMap of sites as keys and a List of TransformationCatalogEntry object as values.
`java.util.Map` `getSitesTCEntries(java.lang.String fqlfn, java.util.List sites)` Retrieves all the entries matching a particular lfn for the sites passed.
`java.util.List` `getSiteTCEntries(java.lang.String fqlfn, java.lang.String siteid)` This method returns a list of TransformationCatalogEntry objects for a given transformation and siteid
`boolean` `setSiteMap(java.lang.String fqlfn, java.util.Map sitemap)` This method allows to associate a site map with a particular logical transformation
`boolean` `setSiteTCEntries(java.lang.String fqlfn, java.lang.String siteid, TransformationCatalogEntry entry)` This method allows to add a TransformationCatalogEntry object in the map to a particular transformation for a particular site
`java.lang.String` `toString()` Returns the textual description of the contents of the object
`java.lang.String` `toString(java.lang.String lfn)` Returns a textual description of the object.

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

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

### Field Detail

#### mTCMap

    private java.util.Map mTCMap

The TCMap for a dag is stored in this HashMap.

#### mLogger

    private LogManager mLogger

### Constructor Detail

#### TCMap

    public TCMap()

Default constructor. Initializes the tcmap to 10 lfns.

### Method Detail

#### getSiteMap

    public java.util.Map getSiteMap(java.lang.String fqlfn)

Returns a HashMap of sites as keys and a List of TransformationCatalogEntry object as values.

Parameters:
  `fqlfn` - String The fully qualified logical transformation name for which you want the map.
Returns:
  Map Returns NULL if the transformation does not exist in the map.
See Also:
  `org.griphyn.common.catalog.TransformationCatalogEntry`

#### setSiteMap

    public boolean setSiteMap(java.lang.String fqlfn,
                              java.util.Map sitemap)

This method allows to associate a site map with a particular logical transformation

Parameters:
  `fqlfn` - String The transformation for which the sitemap is to be stored
  `sitemap` - Map The sitemap that is to be stored. It is a hashmap with key as the siteid and value as a list of TranformationCatalogEntry objects
Returns:
  boolean
See Also:
  `org.griphyn.common.catalog.TransformationCatalogEntry`

#### getSiteList

    public java.util.List getSiteList(java.lang.String fqlfn)

Returns a List of siteid's that are valid for a particular lfn.

Parameters:
  `fqlfn` - String
Returns:
  List

#### getSiteList

    public java.util.List getSiteList(java.lang.String fqlfn,
                                      java.util.List sites)

Returns a list of siteid's that are valid for a particular lfn and among a list of input sites

Parameters:
  `fqlfn` - The logical name of the transformation
  `sites` - The list of siteids
Returns:
  the list of siteids which are valid.

#### getSiteTCEntries

    public java.util.List getSiteTCEntries(java.lang.String fqlfn,
                                           java.lang.String siteid)

This method returns a list of TransformationCatalogEntry objects for a given transformation and siteid

Parameters:
  `fqlfn` - String The fully qualified logical name of the transformation
  `siteid` - String The siteid for which the Entries are required
Returns:
  List returns NULL if no entries exist.

#### getSitesTCEntries

    public java.util.Map getSitesTCEntries(java.lang.String fqlfn,
                                           java.util.List sites)

Retrieves all the entries matching a particular lfn for the sites passed.

Parameters:
  `fqlfn` - the fully qualified logical name
  `sites` - the list of siteID's for which the entries are required.
Returns:
  a map indexed by site names. Each value is a collection of `TransformationCatalogEntry` objects. Returns null in case of no entry being found.

#### setSiteTCEntries

    public boolean setSiteTCEntries(java.lang.String fqlfn,
                                    java.lang.String siteid,
                                    TransformationCatalogEntry entry)

This method allows to add a TransformationCatalogEntry object in the map to a particular transformation for a particular site

Parameters:
  `fqlfn` - String The fully qualified logical transformation
  `siteid` - String The site for which the TransformationCatalogEntry is valid
  `entry` - TransformationCatalogEntry The Transformation CatalogEntry object to be added.
Returns:
  boolean

#### toString

    public java.lang.String toString()

Returns the textual description of the contents of the object

Overrides:
  `toString` in class `java.lang.Object`
Returns:
  String

#### toString

    public java.lang.String toString(java.lang.String lfn)

Returns a textual description of the object.

Parameters:
  `lfn` - String
Returns:
  the textual description.