edu.isi.pegasus.planner.transfer
Class RemoteTransfer

java.lang.Object
  extended by edu.isi.pegasus.planner.transfer.RemoteTransfer

public class RemoteTransfer
extends Object

A common class, that builds up the state from the properties to determine whether a user wants certain type of transfer jobs for particular site to run remotely. This allows a user to override the default behavior of how Pegasus decides whether a transfer job runs locally ( on the submit host) or remotely.

Version:
$Revision: 2567 $
Author:
Karan Vahi

Nested Class Summary
private  class RemoteTransfer.TransferState
          An inner class that holds the state for a particular site,as to whether to execute transfers remotely or not.
 
Field Summary
static String ALL_SITES
          The constant to apply to all sites.
static String ALL_TRANSFERS_REMOTE_PROPERTY
          The property name to get the sites for which all transfers need to be executed remotely.
static String INTER_TRANSFERS_REMOTE_PROPERTY
          The property name to get the sites for which inter site transfers need to be executed remotely.
private  LogManager mLogger
          The handle to the logging object.
private static Map mPropertyTable
          An internal table that maps remote transfer type to the corresponding property.
private  PegasusProperties mProps
          The handle to the properties object holding the properties relevant to Pegasus.
private  Map mStateMap
          The map indexed by site name, that contains the state for all the sites.
static String STAGE_IN_TRANSFERS_REMOTE_PROPERTY
          The property name to get the sites for which stage-in transfers need to be executed remotely.
static String STAGE_OUT_TRANSFERS_REMOTE_PROPERTY
          The property name to get the sites for which stage-out transfers need to be executed remotely.
 
Constructor Summary
RemoteTransfer()
          The default constructor.
RemoteTransfer(PegasusProperties properties)
          The overloaded constructor.
 
Method Summary
 void buildState()
          Builds up the remote transfers state for all the sites.
private  void buildState(int type)
          Adds to the existing state table, state information for a particular type of transfers.
private  boolean containsKey(String site)
          Returns whether there is an entry for a particular site or not.
private  RemoteTransfer.TransferState get(String site)
          Returns the TPT state for a particular site.
private  Set getThirdPartySites(String value)
          Returns a set of third party sites.
 boolean interOnRemoteSite(String site)
          Returns a boolean indicating whether to execute inter site transfers on remote site or not.
 void print()
          Prints out the third party state for the various sites.
private static Map propertyTable()
          Singleton access to the type table Contains the mapping of a property to the third party transfer type
private  void put(String site, RemoteTransfer.TransferState state)
          Inserts an entry in to the State Map, that maintains state of various sites.
 boolean stageInOnRemoteSite(String site)
          Returns a boolean indicating whether to execute stage-in transfers on remote site or not.
 boolean stageOutOnRemoteSite(String site)
          Returns a boolean indicating whether to execute stage-out transfers on remote site or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL_SITES

public static final String ALL_SITES
The constant to apply to all sites.

See Also:
Constant Field Values

ALL_TRANSFERS_REMOTE_PROPERTY

public static final String ALL_TRANSFERS_REMOTE_PROPERTY
The property name to get the sites for which all transfers need to be executed remotely.

See Also:
Constant Field Values

STAGE_IN_TRANSFERS_REMOTE_PROPERTY

public static final String STAGE_IN_TRANSFERS_REMOTE_PROPERTY
The property name to get the sites for which stage-in transfers need to be executed remotely.

See Also:
Constant Field Values

INTER_TRANSFERS_REMOTE_PROPERTY

public static final String INTER_TRANSFERS_REMOTE_PROPERTY
The property name to get the sites for which inter site transfers need to be executed remotely.

See Also:
Constant Field Values

STAGE_OUT_TRANSFERS_REMOTE_PROPERTY

public static final String STAGE_OUT_TRANSFERS_REMOTE_PROPERTY
The property name to get the sites for which stage-out transfers need to be executed remotely.

See Also:
Constant Field Values

mPropertyTable

private static Map mPropertyTable
An internal table that maps remote transfer type to the corresponding property.


mProps

private PegasusProperties mProps
The handle to the properties object holding the properties relevant to Pegasus.


mLogger

private LogManager mLogger
The handle to the logging object.


mStateMap

private Map mStateMap
The map indexed by site name, that contains the state for all the sites.

Constructor Detail

RemoteTransfer

public RemoteTransfer()
The default constructor.


RemoteTransfer

public RemoteTransfer(PegasusProperties properties)
The overloaded constructor.

Parameters:
properties - handle to the properties required.
Method Detail

propertyTable

private static Map propertyTable()
Singleton access to the type table Contains the mapping of a property to the third party transfer type

Returns:
map

buildState

public void buildState()
Builds up the remote transfers state for all the sites. This reflects what is set in the properties file.


buildState

private void buildState(int type)
Adds to the existing state table, state information for a particular type of transfers.

Parameters:
type - the type of transfer.

stageInOnRemoteSite

public boolean stageInOnRemoteSite(String site)
Returns a boolean indicating whether to execute stage-in transfers on remote site or not.

Returns:
boolean

interOnRemoteSite

public boolean interOnRemoteSite(String site)
Returns a boolean indicating whether to execute inter site transfers on remote site or not.

Returns:
boolean

stageOutOnRemoteSite

public boolean stageOutOnRemoteSite(String site)
Returns a boolean indicating whether to execute stage-out transfers on remote site or not.

Returns:
boolean

print

public void print()
Prints out the third party state for the various sites.


containsKey

private boolean containsKey(String site)
Returns whether there is an entry for a particular site or not.

Parameters:
site - the site handle for a site.
Returns:
boolean

put

private void put(String site,
                 RemoteTransfer.TransferState state)
Inserts an entry in to the State Map, that maintains state of various sites.

Parameters:
site - the site handle for a site.
state - the thirdparty state for the site.

get

private RemoteTransfer.TransferState get(String site)
Returns the TPT state for a particular site.

Parameters:
site - the site handle for the site.
Returns:
state the third party state for the site if there is an entry, else null.

getThirdPartySites

private Set getThirdPartySites(String value)
Returns a set of third party sites. An empty set is returned if value is null.

Parameters:
value - the value in the properties file.
Returns:
Set containing the names of the pools.


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