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

## Class Hashed

- java.lang.Object
- - edu.isi.pegasus.planner.transfer.mapper.impl.AbstractFileFactoryBasedMapper
  - - edu.isi.pegasus.planner.transfer.mapper.impl.Hashed

All Implemented Interfaces:
  OutputMapper

    public class Hashed
    extends AbstractFileFactoryBasedMapper

Maps the output files in a Hashed Directory structure on the output site.

Author:
  Karan Vahi
See Also:
  `org.griphyn.vdl.euryale.VirtualDecimalHashedFileFactory;`

### Field Summary

Fields
`private static java.lang.String` `DESCRIPTION` Short description.
`private static int` `MAX_CACHE_ENTRIES` The maximum number of entries in the map, before the output site map is cleared.
`private int` `mNumberOfExistingLFNS`
`private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>>` `mSiteLFNAddOnMap` A Map that tracks for each output site, the LFN to the Add on's
`static java.lang.String` `SHORT_NAME` The short name for the mapper

### Fields inherited from class edu.isi.pegasus.planner.transfer.mapper.impl.AbstractFileFactoryBasedMapper

`mFactory, mLogger, mOutputSite, mSiteStore, mStageoutDirectory`

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

`VERSION`

### Constructor Summary

Constructors
Constructor and Description
`Hashed()`

### Method Summary

All Methods Instance Methods Concrete Methods
`java.lang.String` `createAndGetAddOn(java.lang.String lfn, java.lang.String site, boolean existing)` Returns the addOn part that is retrieved from the File Factory.
`java.lang.String` `description()` Returns a short description of the mapper.
`java.lang.String` `getShortName()` Returns the short name for the implementation class.
`void` `initialize(PegasusBag bag, ADag workflow)` Initializes the mappers.
`org.griphyn.vdl.euryale.FileFactory` `instantiateFileFactory(PegasusBag bag, ADag workflow)` Method that instantiates the FileFactory
`private void` `resetLFNAddOnCache()` Resets the internal cache.
`private void` `trackLFNAddOn(java.lang.String site, java.lang.String lfn, java.lang.String addOn)` Tracks the lfn with addOn's on the various sites.

### Methods inherited from class edu.isi.pegasus.planner.transfer.mapper.impl.AbstractFileFactoryBasedMapper

`complainForStorageFileServer, constructURL, getErrorMessagePrefix, lookupStorageDirectory, map, map, mapAll`

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

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

### Field Detail

#### SHORT_NAME

    public static final java.lang.String SHORT_NAME

The short name for the mapper

See Also:
  Constant Field Values

#### DESCRIPTION

    private static final java.lang.String DESCRIPTION

Short description.

See Also:
  Constant Field Values

#### mSiteLFNAddOnMap

    private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> mSiteLFNAddOnMap

A Map that tracks for each output site, the LFN to the Add on's

#### MAX_CACHE_ENTRIES

    private static final int MAX_CACHE_ENTRIES

The maximum number of entries in the map, before the output site map is cleared.

See Also:
  Constant Field Values

#### mNumberOfExistingLFNS

    private int mNumberOfExistingLFNS

### Constructor Detail

#### Hashed

    public Hashed()

### Method Detail

#### initialize

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

Initializes the mappers.

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

#### instantiateFileFactory

    public org.griphyn.vdl.euryale.FileFactory instantiateFileFactory(PegasusBag bag,
                                                                      ADag workflow)

Method that instantiates the FileFactory

Specified by:
  `instantiateFileFactory` in class `AbstractFileFactoryBasedMapper`
Parameters:
  `bag` - the bag of objects that is useful for initialization.
  `workflow` - the workflow refined so far.
Returns:
  the handle to the File Factory to use

#### createAndGetAddOn

    public java.lang.String createAndGetAddOn(java.lang.String lfn,
                                              java.lang.String site,
                                              boolean existing)

Returns the addOn part that is retrieved from the File Factory. It creates a new file in the factory for the LFN and returns it.

Specified by:
  `createAndGetAddOn` in class `AbstractFileFactoryBasedMapper`
Parameters:
  `lfn` - the LFN to be used
  `site` - the site at which the LFN resides
  `existing` - indicates whether to create a new location/placement for a file, or rely on existing placement on the site.
Returns:

#### trackLFNAddOn

    private void trackLFNAddOn(java.lang.String site,
                               java.lang.String lfn,
                               java.lang.String addOn)

Tracks the lfn with addOn's on the various sites.

Parameters:
  `site` -
  `lfn` -
  `addOn` -

#### getShortName

    public java.lang.String getShortName()

Returns the short name for the implementation class.

Specified by:
  `getShortName` in class `AbstractFileFactoryBasedMapper`
Returns:

#### description

    public java.lang.String description()

Returns a short description of the mapper.

Returns:

#### resetLFNAddOnCache

    private void resetLFNAddOnCache()

Resets the internal cache.