Class Mapper

  • Direct Known Subclasses:
    All, Installed, Staged, Submit

    public abstract class Mapper
    extends java.lang.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$
    Author:
    Gaurang Mehta
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Mapper​(PegasusBag bag)
      The private constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.lang.String getMode()
      Returns the TCMapper Mode.
      java.util.List getSiteList​(java.lang.String namespace, java.lang.String name, java.lang.String version, java.util.List siteids)
      Returns a list of sites that are valid sites for a given lfn and a list of sites.
      abstract java.util.Map getSiteMap​(java.lang.String namespace, java.lang.String name, java.lang.String version, java.util.List siteids)
      This method returns a Map of compute sites to List of TransformationCatalogEntry objects that are valid for that site.
      java.util.List getTCList​(java.lang.String namespace, java.lang.String name, java.lang.String version, java.lang.String siteid)
      This method returns a List of TransformationCatalog Objects valid for a particular transformation and for a particular compute site
      boolean isSiteValid​(java.lang.String namespace, java.lang.String name, java.lang.String version, java.lang.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​(java.lang.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 java.lang.String PACKAGE_NAME
        The name of the package where the implementing classes reside.
        See Also:
        Constant Field Values
      • mSiteStore

        protected SiteStore mSiteStore
        The handle to the RIC.
      • 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​(java.lang.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 java.util.Map getSiteMap​(java.lang.String namespace,
                                                 java.lang.String name,
                                                 java.lang.String version,
                                                 java.util.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 java.lang.String getMode()
        Returns the TCMapper Mode.
        Returns:
        String
      • getTCList

        public java.util.List getTCList​(java.lang.String namespace,
                                        java.lang.String name,
                                        java.lang.String version,
                                        java.lang.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 java.util.List getSiteList​(java.lang.String namespace,
                                          java.lang.String name,
                                          java.lang.String version,
                                          java.util.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​(java.lang.String namespace,
                                   java.lang.String name,
                                   java.lang.String version,
                                   java.lang.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