Class Fixed
- java.lang.Object
-
- edu.isi.pegasus.planner.transfer.mapper.impl.Fixed
-
- All Implemented Interfaces:
OutputMapper
public class Fixed extends java.lang.Object implements OutputMapper
A convenience mapper implementation that stages output files to a fixed directory, specified using properties. The URL set for this needs to be logically consistent with the --output-site option passed to the planner. To use this mapper, user needs to set the following propertiespegasus.dir.storage.mapper Fixed pegasus.dir.storage.mapper.fixed.url externally accessible URL to the directory where output files need to be placed.- Author:
- Karan Vahi
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringDESCRIPTIONShort description.private java.lang.StringmDirectoryURLExternally accessible URLprotected LogManagermLoggerThe handle to the logger.protected java.lang.StringmOutputSiteThe output site where the data needs to be placed.protected SiteStoremSiteStoreHandle to the Site Catalog contents.static java.lang.StringPROPERTY_PREFIXThe prefix for the property subset for this mapper implementationprivate static java.lang.StringSHORT_NAME-
Fields inherited from interface edu.isi.pegasus.planner.transfer.mapper.OutputMapper
VERSION
-
-
Constructor Summary
Constructors Constructor Description Fixed()The default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringdescription()Returns a short description of the mapper.protected java.lang.StringgetErrorMessagePrefix()Returns the prefix message to be attached to an error messageprivate java.lang.StringgetShortName()voidinitialize(PegasusBag bag, ADag workflow)Initializes the mappers.java.lang.Stringmap(java.lang.String lfn, java.lang.String site, FileServerType.OPERATION operation)Maps a LFN to a location on the filsystem of a site and returns a single externally accessible URL corresponding to that location.java.lang.Stringmap(java.lang.String lfn, java.lang.String site, FileServerType.OPERATION operation, boolean existing)Maps a LFN to a location on the filsystem of a site and returns a single externally accessible URL corresponding to that location.java.util.List<java.lang.String>mapAll(java.lang.String lfn, java.lang.String site, FileServerType.OPERATION operation)Maps a LFN to a location on the filesystem of a site and returns all the possible equivalent externally accessible URL corresponding to that location.
-
-
-
Field Detail
-
PROPERTY_PREFIX
public static final java.lang.String PROPERTY_PREFIX
The prefix for the property subset for this mapper implementation- See Also:
- Constant Field Values
-
DESCRIPTION
private static final java.lang.String DESCRIPTION
Short description.- See Also:
- Constant Field Values
-
SHORT_NAME
private static final java.lang.String SHORT_NAME
- See Also:
- Constant Field Values
-
mLogger
protected LogManager mLogger
The handle to the logger.
-
mSiteStore
protected SiteStore mSiteStore
Handle to the Site Catalog contents.
-
mOutputSite
protected java.lang.String mOutputSite
The output site where the data needs to be placed.
-
mDirectoryURL
private java.lang.String mDirectoryURL
Externally accessible URL
-
-
Method Detail
-
initialize
public void initialize(PegasusBag bag, ADag workflow) throws MapperException
Initializes the mappers.- Specified by:
initializein interfaceOutputMapper- Parameters:
bag- the bag of objects that is useful for initialization.workflow- the workflow refined so far.- Throws:
MapperException- if unable to construct URL for any reason
-
map
public java.lang.String map(java.lang.String lfn, java.lang.String site, FileServerType.OPERATION operation) throws MapperExceptionMaps a LFN to a location on the filsystem of a site and returns a single externally accessible URL corresponding to that location.- Specified by:
mapin interfaceOutputMapper- Parameters:
lfn- the lfnsite- the output siteoperation- whether we want a GET or a PUT URL- Returns:
- the URL to file that was mapped
- Throws:
MapperException- if unable to construct URL for any reason
-
map
public java.lang.String map(java.lang.String lfn, java.lang.String site, FileServerType.OPERATION operation, boolean existing) throws MapperExceptionMaps a LFN to a location on the filsystem of a site and returns a single externally accessible URL corresponding to that location.- Specified by:
mapin interfaceOutputMapper- Parameters:
lfn- the lfnsite- the output siteoperation- whether we want a GET or a PUT URLexisting- indicates whether to create a new location/placement for a file, or rely on existing placement on the site.- Returns:
- externally accessible URL to the mapped file.
- Throws:
MapperException- if unable to construct URL for any reason
-
mapAll
public java.util.List<java.lang.String> mapAll(java.lang.String lfn, java.lang.String site, FileServerType.OPERATION operation) throws MapperExceptionMaps a LFN to a location on the filesystem of a site and returns all the possible equivalent externally accessible URL corresponding to that location. In case of the replica backed only one URL is returned and that is the first matching PFN for the output site.- Specified by:
mapAllin interfaceOutputMapper- Parameters:
lfn- the lfnsite- the output siteoperation- whether we want a GET or a PUT URL- Returns:
- List
of externally accessible URLs to the mapped file. - Throws:
MapperException- if unable to construct URL for any reason
-
getErrorMessagePrefix
protected java.lang.String getErrorMessagePrefix()
Returns the prefix message to be attached to an error message- Returns:
-
getShortName
private java.lang.String getShortName()
-
description
public java.lang.String description()
Returns a short description of the mapper.- Specified by:
descriptionin interfaceOutputMapper- Returns:
-
-