Class OSGMM
- java.lang.Object
-
- edu.isi.pegasus.planner.catalog.site.impl.OSGMM
-
- All Implemented Interfaces:
Catalog
,SiteCatalog
public class OSGMM extends java.lang.Object implements SiteCatalog
The OSGMM implementation of the Site Catalog interface. This implementation also has a method to generate the SRM property mappings to be used by Pegasus. The following pegasus properties are created for the sites that have the SRM information available.pegasus.transfer.srm.[sitename].service.url pegasus.transfer.srm.[sitename].service.mountpoint
- Version:
- $Revision$
- Author:
- Karan Vahi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
OSGMM.ListCallback
An inner class, that implements the StreamGobblerCallback to store all the lines in a List
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_CONDOR_COLLECTOR
The default condor collector to query to for non LIGO VO'sstatic java.lang.String
DEFAULT_CONDOR_COLLECTOR_PROPERTY_KEY
The property key without the pegasus prefix'es to get the condor collector host.static java.lang.String
DEFAULT_GRID
The default Grid to retreive the sites for.static java.lang.String
DEFAULT_GRID_PROPERTY_KEY
The property key without the pegasus prefix'es to get the grid.static java.lang.String
DEFAULT_LIGO_CONDOR_COLLECTOR
The default condor collector to query to for LIGO VOstatic boolean
DEFAULT_RETRIEVE_VALIDATED_SITES
The default VO to use to query the condor collector.static java.lang.String
DEFAULT_RETRIEVE_VALIDATED_SITES_PROPERTY_KEY
The property key without the pegasus prefix'es to get the VO.static java.lang.String
DEFAULT_VO
The default VO to use to query the condor collector.static java.lang.String
DEFAULT_VO_PROPERTY_KEY
The property key without the pegasus prefix'es to get the VO.static java.lang.String
ENGAGE_VO
The name of the ENGAGE VOstatic java.lang.String
LIGO_VO
The name of the LIGO VOprivate java.lang.String
mCollectorHost
The collector host to query to.(package private) java.util.List<java.lang.String>
mCondorStatusError
The List storing the stderr of condor-status.(package private) java.util.List<java.lang.String>
mCondorStatusOutput
The List storing the output of condor-status.private java.lang.String
mGrid
The grid to which the user belongs to.private LogManager
mLogger
The handle to the log manager.private SiteStore
mSiteStore
The SiteStore object where information about the sites is stored.private java.lang.String
mVO
The VO to which the user belongs to.static java.lang.String
PEGASUS_PROPERTY_PREFIX
The pegasus property prefix.-
Fields inherited from interface edu.isi.pegasus.planner.catalog.Catalog
DB_ALL_PREFIX
-
Fields inherited from interface edu.isi.pegasus.planner.catalog.SiteCatalog
c_prefix, VERSION
-
-
Constructor Summary
Constructors Constructor Description OSGMM()
The default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the connection.boolean
connect(java.util.Properties props)
Issues the condor status command, and stores the results retrieved back into a List.private static SiteInfo
convertToSiteInfo(edu.clemson.SiteCatalogGenerator.Site s)
An adapter method that converts the Site object to the SiteInfo object corresponding to the site catalog schema version 2.private java.lang.String
createPropertyKey(java.lang.String site, java.lang.String suffix)
Creates the property keyjava.util.Properties
generateSRMProperties()
Generates SRM properties that can be used by Pegasus to do SRM URL substitution for the case where all the data is accessible on the worker nodes locally.java.util.Properties
generateSRMProperties(java.lang.String line)
Generates SRM properties that can be used by Pegasus to do SRM URL substitution for the case where all the data is accessible on the worker nodes locally for a particular site.int
insert(SiteCatalogEntry entry)
Inserts a new mapping into the Site catalog.boolean
isClosed()
Returns if the connection is closed or not.java.util.Set<java.lang.String>
list()
Lists the site handles for all the sites in the Site Catalog.int
load(java.util.List<java.lang.String> sites)
Loads up the Site Catalog implementation with the sites whose site handles are specified.SiteCatalogEntry
lookup(java.lang.String handle)
Retrieves theSiteCatalogEntry
for a site.int
remove(java.lang.String handle)
Removes a site catalog entry matching the the handle.
-
-
-
Field Detail
-
DEFAULT_CONDOR_COLLECTOR_PROPERTY_KEY
public static final java.lang.String DEFAULT_CONDOR_COLLECTOR_PROPERTY_KEY
The property key without the pegasus prefix'es to get the condor collector host.- See Also:
- Constant Field Values
-
PEGASUS_PROPERTY_PREFIX
public static final java.lang.String PEGASUS_PROPERTY_PREFIX
The pegasus property prefix.- See Also:
- Constant Field Values
-
ENGAGE_VO
public static final java.lang.String ENGAGE_VO
The name of the ENGAGE VO- See Also:
- Constant Field Values
-
DEFAULT_CONDOR_COLLECTOR
public static final java.lang.String DEFAULT_CONDOR_COLLECTOR
The default condor collector to query to for non LIGO VO's- See Also:
- Constant Field Values
-
LIGO_VO
public static final java.lang.String LIGO_VO
The name of the LIGO VO- See Also:
- Constant Field Values
-
DEFAULT_LIGO_CONDOR_COLLECTOR
public static final java.lang.String DEFAULT_LIGO_CONDOR_COLLECTOR
The default condor collector to query to for LIGO VO- See Also:
- Constant Field Values
-
DEFAULT_VO_PROPERTY_KEY
public static final java.lang.String DEFAULT_VO_PROPERTY_KEY
The property key without the pegasus prefix'es to get the VO.- See Also:
- Constant Field Values
-
DEFAULT_VO
public static final java.lang.String DEFAULT_VO
The default VO to use to query the condor collector.- See Also:
- Constant Field Values
-
DEFAULT_GRID_PROPERTY_KEY
public static final java.lang.String DEFAULT_GRID_PROPERTY_KEY
The property key without the pegasus prefix'es to get the grid.- See Also:
- Constant Field Values
-
DEFAULT_GRID
public static final java.lang.String DEFAULT_GRID
The default Grid to retreive the sites for.- See Also:
- Constant Field Values
-
DEFAULT_RETRIEVE_VALIDATED_SITES_PROPERTY_KEY
public static final java.lang.String DEFAULT_RETRIEVE_VALIDATED_SITES_PROPERTY_KEY
The property key without the pegasus prefix'es to get the VO.- See Also:
- Constant Field Values
-
DEFAULT_RETRIEVE_VALIDATED_SITES
public static final boolean DEFAULT_RETRIEVE_VALIDATED_SITES
The default VO to use to query the condor collector.- See Also:
- Constant Field Values
-
mCondorStatusOutput
java.util.List<java.lang.String> mCondorStatusOutput
The List storing the output of condor-status.
-
mCondorStatusError
java.util.List<java.lang.String> mCondorStatusError
The List storing the stderr of condor-status.
-
mSiteStore
private SiteStore mSiteStore
The SiteStore object where information about the sites is stored.
-
mLogger
private LogManager mLogger
The handle to the log manager.
-
mVO
private java.lang.String mVO
The VO to which the user belongs to.
-
mCollectorHost
private java.lang.String mCollectorHost
The collector host to query to.
-
mGrid
private java.lang.String mGrid
The grid to which the user belongs to.
-
-
Method Detail
-
convertToSiteInfo
private static SiteInfo convertToSiteInfo(edu.clemson.SiteCatalogGenerator.Site s) throws java.lang.Exception
An adapter method that converts the Site object to the SiteInfo object corresponding to the site catalog schema version 2.- Parameters:
s
- the Site object to convert.- Returns:
- the coverted SiteInfo object
- Throws:
java.lang.Exception
-
insert
public int insert(SiteCatalogEntry entry) throws SiteCatalogException
Description copied from interface:SiteCatalog
Inserts a new mapping into the Site catalog.- Specified by:
insert
in interfaceSiteCatalog
- Parameters:
entry
- theSiteCatalogEntry
object that describes a site.- Returns:
- number of insertions, should always be 1. On failure, throw an exception, don't use zero.
- Throws:
SiteCatalogException
- in case of error.
-
list
public java.util.Set<java.lang.String> list() throws SiteCatalogException
Description copied from interface:SiteCatalog
Lists the site handles for all the sites in the Site Catalog.- Specified by:
list
in interfaceSiteCatalog
- Returns:
- A set of site handles.
- Throws:
SiteCatalogException
- in case of error.
-
load
public int load(java.util.List<java.lang.String> sites) throws SiteCatalogException
Loads up the Site Catalog implementation with the sites whose site handles are specified. This is a convenience method, that can allow the backend implementations to maintain soft state if required. If the implementation chooses not to implement this, just do an empty implementation. The site handle * is a special handle designating all sites are to be loaded.- Specified by:
load
in interfaceSiteCatalog
- Parameters:
sites
- the list of sites to be loaded.- Returns:
- the number of sites loaded.
- Throws:
SiteCatalogException
- in case of error.
-
lookup
public SiteCatalogEntry lookup(java.lang.String handle) throws SiteCatalogException
Description copied from interface:SiteCatalog
Retrieves theSiteCatalogEntry
for a site.- Specified by:
lookup
in interfaceSiteCatalog
- Parameters:
handle
- the site handle / identifier.- Returns:
- SiteCatalogEntry in case an entry is found , or
null
if no match is found. - Throws:
SiteCatalogException
- in case of error.
-
remove
public int remove(java.lang.String handle) throws SiteCatalogException
Description copied from interface:SiteCatalog
Removes a site catalog entry matching the the handle.- Specified by:
remove
in interfaceSiteCatalog
- Parameters:
handle
- the site handle / identifier.- Returns:
- the number of removed entries.
- Throws:
SiteCatalogException
- in case of error.
-
close
public void close()
Closes the connection. It resets the internal buffers that contain output of the condor_status command.
-
connect
public boolean connect(java.util.Properties props) throws SiteCatalogException
Issues the condor status command, and stores the results retrieved back into a List.- Specified by:
connect
in interfaceCatalog
- Parameters:
props
- is the property table with sufficient settings to to connect to the implementation.- Returns:
- true if connected, false if failed to connect.
- Throws:
SiteCatalogException
-
generateSRMProperties
public java.util.Properties generateSRMProperties()
Generates SRM properties that can be used by Pegasus to do SRM URL substitution for the case where all the data is accessible on the worker nodes locally.- Returns:
- Properties object containing the relevant Properties.
-
generateSRMProperties
public java.util.Properties generateSRMProperties(java.lang.String line)
Generates SRM properties that can be used by Pegasus to do SRM URL substitution for the case where all the data is accessible on the worker nodes locally for a particular site. The condor status output for a single site site is passed as input. Example condor_status output for a siteCIT_CMS_T2;srm://cit-se.ultralight.org:8443/srm/v2/server?SFN=/mnt/hadoop/osg;/mnt/hadoop/osg;/mnt/hadoop/osg;/mnt/hadoop,/mnt/hadoop;
The properties created have the following keyspegasus.transfer.srm.[sitename].service.url pegasus.transfer.srm.[sitename].service.mountpoint
where [sitename] is replaced by the name of the site.- Parameters:
line
- the line from condor_status output for a site.- Returns:
- Properties object containing the relevant Properties.
-
createPropertyKey
private java.lang.String createPropertyKey(java.lang.String site, java.lang.String suffix)
Creates the property key- Parameters:
site
- the name of sitesuffix
- the suffix to be added to site.- Returns:
- the property key.
-
isClosed
public boolean isClosed()
Returns if the connection is closed or not.- Specified by:
isClosed
in interfaceCatalog
- Returns:
- boolean indicating connection is closed.
- See Also:
Catalog.close()
-
-