edu.isi.pegasus.planner.transfer.mapper.impl

## 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 properties

     pegasus.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
`private static java.lang.String` `DESCRIPTION` Short description.
`private java.lang.String` `mDirectoryURL` Externally accessible URL
`protected LogManager` `mLogger` The handle to the logger.
`protected java.lang.String` `mOutputSite` The output site where the data needs to be placed.
`protected SiteStore` `mSiteStore` Handle to the Site Catalog contents.
`static java.lang.String` `PROPERTY_PREFIX` The prefix for the property subset for this mapper implementation
`private static java.lang.String` `SHORT_NAME`

### Fields inherited from interface edu.isi.pegasus.planner.transfer.mapper.OutputMapper

`VERSION`

### Constructor Summary

Constructors
Constructor and Description
`Fixed()` The default constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`java.lang.String` `description()` Returns a short description of the mapper.
`protected java.lang.String` `getErrorMessagePrefix()` Returns the prefix message to be attached to an error message
`private java.lang.String` `getShortName()`
`void` `initialize(PegasusBag bag, ADag workflow)` Initializes the mappers.
`java.lang.String` `map(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.String` `map(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.

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

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

### 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

### Constructor Detail

#### Fixed

    public Fixed()

The default constructor.

### Method Detail

#### initialize

    public void initialize(PegasusBag bag,
                           ADag workflow)
                    throws MapperException

Initializes the mappers.

Specified by:
  `initialize` in interface `OutputMapper`
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 MapperException

Maps a LFN to a location on the filsystem of a site and returns a single externally accessible URL corresponding to that location.

Specified by:
  `map` in interface `OutputMapper`
Parameters:
  `lfn` - the lfn
  `site` - the output site
  `operation` - 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 MapperException

Maps a LFN to a location on the filsystem of a site and returns a single externally accessible URL corresponding to that location.

Specified by:
  `map` in interface `OutputMapper`
Parameters:
  `lfn` - the lfn
  `site` - the output site
  `operation` - whether we want a GET or a PUT URL
  `existing` - 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 MapperException

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. In case of the replica backed only one URL is returned and that is the first matching PFN for the output site.

Specified by:
  `mapAll` in interface `OutputMapper`
Parameters:
  `lfn` - the lfn
  `site` - the output site
  `operation` - whether we want a GET or a PUT URL
Returns:
  List<String> 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:
  `description` in interface `OutputMapper`
Returns: