edu.isi.pegasus.planner.catalog.transformation
Class Mapper

java.lang.Object
  extended by edu.isi.pegasus.planner.catalog.transformation.Mapper
Direct Known Subclasses:
All, Installed, Staged, Submit

public abstract class Mapper
extends Object

This is an interface for generating valid TC maps which will be used for executable staging. The interface sort of access as an accessor for Pegasus to the transformation catalog. The map ends up being built as and when the query for a particular lfn is made to it.

Version:
$Revision: 2572 $
Author:
Gaurang Mehta

Field Summary
protected  LogManager mLogger
          Handle to the logger.
protected  PegasusProperties mProps
          Handle to Pegasus Properties
protected  SiteStore mSiteStore
          The handle to the RIC.
protected  TransformationCatalog mTCHandle
          The handle to the tranformation catalog.
protected  TCMap mTCMap
          Handle to the TCMap
static String PACKAGE_NAME
          The name of the package where the implementing classes reside.
 
Constructor Summary
protected Mapper(PegasusBag bag)
          The private constructor.
 
Method Summary
abstract  String getMode()
          Returns the TCMapper Mode.
 List getSiteList(String namespace, String name, String version, List siteids)
          Returns a list of sites that are valid sites for a given lfn and a list of sites.
abstract  Map getSiteMap(String namespace, String name, String version, List siteids)
          This method returns a Map of compute sites to List of TransformationCatalogEntry objects that are valid for that site.
 List getTCList(String namespace, String name, String version, String siteid)
          This method returns a List of TransformationCatalog Objects valid for a particular transformation and for a particular compute site
 boolean isSiteValid(String namespace, String name, String version, String siteid)
          Checks if a give site is valid for a given transformation.
 boolean isStageableMapper()
          Returns whether this instance of mapper is an instance of a Stageable mapper or not.
static Mapper loadTCMapper(String className, PegasusBag bag)
          Loads the implementing class corresponding to the mode specified by the user at runtime in the properties file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PACKAGE_NAME

public static final String PACKAGE_NAME
The name of the package where the implementing classes reside.

See Also:
Constant Field Values

mTCHandle

protected TransformationCatalog mTCHandle
The handle to the tranformation catalog.


mSiteStore

protected SiteStore mSiteStore
The handle to the RIC.


mProps

protected PegasusProperties mProps
Handle to Pegasus Properties


mTCMap

protected TCMap mTCMap
Handle to the TCMap


mLogger

protected LogManager mLogger
Handle to the logger.

Constructor Detail

Mapper

protected Mapper(PegasusBag bag)
The private constructor.

Parameters:
bag - the bag of initialization objects
Method Detail

loadTCMapper

public static Mapper loadTCMapper(String className,
                                  PegasusBag bag)
Loads the implementing class corresponding to the mode specified by the user at runtime in the properties file.

Parameters:
className - The name of the class that implements the mode. It is the name of the class, not the complete name with package. That is added by itself.
bag - the bag of initialization objects
Returns:
Mapper

isStageableMapper

public boolean isStageableMapper()
Returns whether this instance of mapper is an instance of a Stageable mapper or not.

Returns:
boolean

getSiteMap

public abstract Map getSiteMap(String namespace,
                               String name,
                               String version,
                               List siteids)
This method returns a Map of compute sites to List of TransformationCatalogEntry objects that are valid for that site.

Parameters:
namespace - the namespace of the transformation.
name - the name of the transformation.
version - the version of the transformation.
siteids - the sites for which you want the map.
Returns:
Map Key=String SiteId , Values = List of TransformationCatalogEntry object. Returns null if no entries are found.

getMode

public abstract String getMode()
Returns the TCMapper Mode.

Returns:
String

getTCList

public List getTCList(String namespace,
                      String name,
                      String version,
                      String siteid)
This method returns a List of TransformationCatalog Objects valid for a particular transformation and for a particular compute site

Parameters:
namespace - the namespace of the transformation.
name - the name of the transformation.
version - the version of the transformation.
siteid - the compute site for which you want the List.
Returns:
List Returns null if no entries are found.

getSiteList

public List getSiteList(String namespace,
                        String name,
                        String version,
                        List siteids)
Returns a list of sites that are valid sites for a given lfn and a list of sites.

Parameters:
namespace - the namespace of the transformation.
name - the name of the transformation.
version - the version of the transformation.
siteids - the list of sites on which the transformation is to be checked.
Returns:
List

isSiteValid

public boolean isSiteValid(String namespace,
                           String name,
                           String version,
                           String siteid)
Checks if a give site is valid for a given transformation.

Parameters:
namespace - the namespace of the transformation.
name - the name of the transformation.
version - the version of the transformation.
siteid - the site that needs to be checked.
Returns:
boolean


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