edu.isi.pegasus.planner.catalog.transformation.impl
public class Text extends Abstract implements TransformationCatalog
tr example::keg:1.0 {
#specify profiles that apply for all the sites for the transformation
#in each site entry the profile can be overriden
profile env "APP_HOME" "/tmp/karan"
profile env "JAVA_HOME" "/bin/java.1.5"
site isi {
profile env "me" "with"
profile condor "more" "test"
profile env "JAVA_HOME" "/bin/java.1.6"
pfn "/path/to/keg"
arch "x86"
os "linux"
osrelease "fc"
osversion "4"
type "installed"
}
site wind {
profile env "me" "with"
profile condor "more" "test"
pfn "/path/to/keg"
arch "x86"
os "linux"
osrelease "fc"
osversion "4"
type "STAGEABLE"
}
}
| Modifier and Type | Field and Description |
|---|---|
static String |
DESCRIPTION
Describes the transformation catalog mode.
|
private boolean |
mFlushOnClose
Boolean indicating whether to flush the contents back to the file on
close.
|
protected LogManager |
mLogger
The LogManager object which is used to log all the messages.
|
private boolean |
modifyFileURL
Boolean indicating whether to modify the file URL or not
|
private PegasusProperties |
mProps
The handle to the properties object.
|
private String |
mTCFile
The path to the file based TC.
|
private TransformationStore |
mTCStore
The transformation store containing the transformations after parsing the
file.
|
private TransformationCatalogTextParser |
mTextParser
Instance to the TextParser.
|
MODIFY_FOR_FILE_URLS_KEY, VERSIONDB_ALL_PREFIX| Constructor and Description |
|---|
Text()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addLFNProfile(String namespace,
String name,
String version,
List profiles)
Add additional profile to a logical transformation .
|
int |
addPFNProfile(String pfn,
TCType type,
String resourcename,
List profiles)
Add additional profile to a physical transformation.
|
protected boolean |
addTCEntry(String namespace,
String name,
String version,
String physicalname,
TCType type,
String resourceid,
List pfnprofiles,
List lfnprofiles,
SysInfo system,
Notifications invokes,
boolean write)
Add an single entry into the transformation catalog.
|
int |
clear()
Deletes the entire transformation catalog.
|
void |
close()
Closes the connection to the back end.
|
private static void |
columnLength(String[] s,
int[] count)
Computes the maximum column lenght for pretty printing.
|
boolean |
connect(Properties props)
Empty for the time being.
|
int |
deleteLFNProfiles(String namespace,
String name,
String version,
List profiles)
Delete a list of profiles or all the profiles associated with a logical
transformation.
|
int |
deletePFNProfiles(String physicalname,
TCType type,
String resourceid,
List profiles)
Delete a list of profiles or all the profiles associated with a pfn on a
resource and of a type.
|
List<TransformationCatalogEntry> |
getContents()
List all the contents of the TC
|
String |
getDescription()
Returns a textual description of the transformation mode.
|
List<String[]> |
getTCLogicalNames(String resourceid,
TCType type)
Get the list of LogicalNames available on a particular resource.
|
void |
initialize(PegasusBag bag)
Initialize the implementation, and return an instance of the implementation.
|
int |
insert(List<TransformationCatalogEntry> entries)
Add multiple TCEntries to the Catalog.
|
int |
insert(String namespace,
String name,
String version,
String physicalname,
TCType type,
String resourceid,
List pfnprofiles,
List lfnprofiles,
SysInfo system)
Add an single entry into the transformation catalog.
|
int |
insert(TransformationCatalogEntry entry)
Add single TCEntry to the Catalog.
|
int |
insert(TransformationCatalogEntry entry,
boolean write)
Add single TCEntry object temporarily to the in memory Catalog.
|
boolean |
isClosed()
Returns whether the connection is closed or not.
|
protected void |
logMessage(String msg)
Logs the message to a logging stream.
|
List<TransformationCatalogEntry> |
lookup(String namespace,
String name,
String version,
List resourceids,
TCType type)
Returns TC entries for a particular logical transformation and/or on a
number of resources and/or of a particular type.
|
List<TransformationCatalogEntry> |
lookup(String namespace,
String name,
String version,
String resourceid,
TCType type)
Returns TC entries for a particular logical transformation and/or on a
particular resource and/or of a particular type.
|
List<Profile> |
lookupLFNProfiles(String namespace,
String name,
String version)
Get the list of Profiles associated with a particular logical transformation.
|
List<TransformationCatalogEntry> |
lookupNoProfiles(String namespace,
String name,
String version,
String resourceid,
TCType type)
Get the list of PhysicalNames for a particular transformation on a site/sites
for a particular type/types;
|
List<Profile> |
lookupPFNProfiles(String pfn,
String resourceid,
TCType type)
Get the list of Profiles associated with a particular physical transformation.
|
List<String> |
lookupSites(String namespace,
String name,
String version,
TCType type)
Get the list of Resource ID's where a particular transformation may reside.
|
int |
removeByLFN(String namespace,
String name,
String version,
String resourceid,
TCType type)
Delete all entries in the transformation catalog for a give logical transformation and/or on a resource and/or of
a particular type
|
int |
removeByPFN(String physicalname,
String namespace,
String name,
String version,
String resourceid,
TCType type)
Delete all entries in the transformation catalog for pair of logical and physical transformation.
|
int |
removeBySiteID(String resourceid)
Delete all entries on a particular resource from the transformation catalog.
|
int |
removeBySysInfo(SysInfo sysinfo)
Deletes entries from the catalog which have a particular system information.
|
int |
removeByType(TCType type,
String resourceid)
Delete a particular type of transformation, and/or on a particular resource
|
modifyForFileURLS, modifyForFileURLSpublic static final String DESCRIPTION
protected LogManager mLogger
private String mTCFile
private PegasusProperties mProps
private TransformationCatalogTextParser mTextParser
private TransformationStore mTCStore
private boolean mFlushOnClose
private boolean modifyFileURL
public void initialize(PegasusBag bag)
initialize in interface TransformationCatalogbag - the bag of Pegasus initialization objects.public boolean connect(Properties props)
public boolean isClosed()
isClosed in interface CatalogCatalog.close()public void close()
public String getDescription()
getDescription in interface TransformationCatalogpublic List<TransformationCatalogEntry> lookup(String namespace, String name, String version, List resourceids, TCType type) throws Exception
lookup in interface TransformationCatalognamespace - String The namespace of the logical transformation.name - String the name of the logical transformation.version - String The version of the logical transformation.resourceids - List The List resourceid where the transformation is located.
If NULL it returns all resources.type - TCType The type of the transformation to search for.
If NULL it returns all types.ExceptionTCType,
edu.isi.pegasus.planner.catalog.TransformationCatalogEntrypublic List<TransformationCatalogEntry> lookup(String namespace, String name, String version, String resourceid, TCType type) throws Exception
lookup in interface TransformationCatalognamespace - String The namespace of the logical transformation.name - String the name of the logical transformation.version - String The version of the logical transformation.resourceid - String The resourceid where the transformation is located.
If NULL it returns all resources.type - TCType The type of the transformation to search for.
If NULL it returns all types.ExceptionTCType,
edu.isi.pegasus.planner.catalog.TransformationCatalogEntrypublic List<String> lookupSites(String namespace, String name, String version, TCType type) throws Exception
lookupSites in interface TransformationCatalognamespace - String The namespace of the transformation to search for.name - String The name of the transformation to search for.version - String The version of the transformation to search for.type - TCType The type of the transformation to search for.Exception - NotImplementedException if not implementedTCTypepublic List<TransformationCatalogEntry> lookupNoProfiles(String namespace, String name, String version, String resourceid, TCType type) throws Exception
lookupNoProfiles in interface TransformationCatalognamespace - String The namespace of the transformation to search for.name - String The name of the transformation to search for.version - String The version of the transformation to search for.resourceid - String The id of the resource on which you want to search. type - TCType The type of the transformation to search for. Exception - NotImplementedException if not implemented.TCTypepublic List<String[]> getTCLogicalNames(String resourceid, TCType type) throws Exception
getTCLogicalNames in interface TransformationCatalogresourceid - String The id of the resource on which you want to searchtype - TCType The type of the transformation to search for. Exception - NotImplementedException if not implemented.public List<Profile> lookupLFNProfiles(String namespace, String name, String version) throws Exception
lookupLFNProfiles in interface TransformationCatalognamespace - String The namespace of the transformation to search for.name - String The name of the transformation to search for.version - String The version of the transformation to search for.Exception - NotImplementedException if not implemented.org.griphyn.cPlanner.classes.Profilepublic List<Profile> lookupPFNProfiles(String pfn, String resourceid, TCType type) throws Exception
lookupPFNProfiles in interface TransformationCatalogpfn - The physical file name to search the transformation by.resourceid - String The id of the resource on which you want to search.type - TCType The type of the transformation to search for. Exception - NotImplementedException if not implemented.org.griphyn.cPlanner.classes.Profilepublic List<TransformationCatalogEntry> getContents() throws Exception
getContents in interface TransformationCatalogExceptionpublic int insert(List<TransformationCatalogEntry> entries) throws Exception
insert in interface TransformationCatalogtcentry - List Takes a list of TransformationCatalogEntry objects as inputExceptionedu.isi.pegasus.planner.catalog.TransformationCatalogEntrypublic int insert(TransformationCatalogEntry entry) throws Exception
insert in interface TransformationCatalogtcentry - Takes a single TransformationCatalogEntry object as inputExceptionedu.isi.pegasus.planner.catalog.TransformationCatalogEntrypublic int insert(TransformationCatalogEntry entry, boolean write) throws Exception
insert in interface TransformationCatalogtcentry - Takes a single TransformationCatalogEntry object as inputwrite - boolean enable write commits to backed catalog or not.Exceptionedu.isi.pegasus.planner.catalog.TransformationCatalogEntrypublic int insert(String namespace, String name, String version, String physicalname, TCType type, String resourceid, List pfnprofiles, List lfnprofiles, SysInfo system) throws Exception
insert in interface TransformationCatalognamespace - String The namespace of the transformation to be added (Can be null)name - String The name of the transformation to be added.version - String The version of the transformation to be added. (Can be null)physicalname - String The physical name/location of the transformation to be added.type - TCType The type of the physical transformation.resourceid - String The resource location id where the transformation is located.lfnprofiles - List The List of Profile objects associated with a Logical Transformation. (can be null)pfnprofiles - List The List of Profile objects associated with a Physical Transformation. (can be null)sysinfo - SysInfo The System information associated with a physical transformation.Exceptionedu.isi.pegasus.planner.catalog.TransformationCatalogEntry,
SysInfo,
org.griphyn.cPlanner.classes.Profileprotected boolean addTCEntry(String namespace, String name, String version, String physicalname, TCType type, String resourceid, List pfnprofiles, List lfnprofiles, SysInfo system, Notifications invokes, boolean write) throws Exception
namespace - the namespace of the transformation to be added (Can be null)name - the name of the transformation to be added.version - the version of the transformation to be added. (Can be null)physicalname - the physical name/location of the transformation to be added.type - the type of the physical transformation.resourceid - the resource location id where the transformation is located.lfnprofiles - the List of Profile objects associated
with a Logical Transformation. (can be null)pfnprofiles - the list of Profile objects associated
with a Physical Transformation. (can be null)system - the System information associated with a physical
transformation.invokes - the Notifications associated with the
transformation.write - boolean to commit changes to backend catalogExceptionedu.isi.pegasus.planner.catalog.TransformationCatalogEntry,
SysInfo,
org.griphyn.cPlanner.classes.Profilepublic int addLFNProfile(String namespace, String name, String version, List profiles) throws Exception
addLFNProfile in interface TransformationCatalognamespace - String The namespace of the transformation to be added. (can be null)name - String The name of the transformation to be added.version - String The version of the transformation to be added. (can be null)profiles - List The List of Profile objects that are to be added
to the transformation.Exceptionorg.griphyn.cPlanner.classes.Profilepublic int addPFNProfile(String pfn, TCType type, String resourcename, List profiles) throws Exception
addPFNProfile in interface TransformationCatalogpfn - String The physical name of the transformationtype - TCType The type of transformation that the profile is
associated with.resourcename - String The resource on which the physical transformation existsprofiles - The List of Profile objects that are to be added
to the transformation.Exceptionorg.griphyn.cPlanner.classes.Profilepublic int removeByLFN(String namespace, String name, String version, String resourceid, TCType type) throws Exception
removeByLFN in interface TransformationCatalognamespace - String The namespace of the transformation to be deleted. (can be null)name - String The name of the transformation to be deleted.version - String The version of the transformation to be deleted. ( can be null)resourceid - String The resource id for which the transformation is to be deleted.
If NULL then transformation on all resource are deletedtype - TCType The type of the transformation. If NULL then all types are deleted for the transformation.ExceptionTCTypepublic int removeByPFN(String physicalname, String namespace, String name, String version, String resourceid, TCType type) throws Exception
removeByPFN in interface TransformationCatalogphysicalname - String The physical name of the transformationnamespace - String The namespace associated in the logical name of the transformation.name - String The name of the logical transformation.version - String The version number of the logical transformation.resourceid - String The resource on which the transformation is to be deleted.
If NULL then it searches all the resource id.type - TCType The type of transformation. If NULL then it search and deletes entries for all types.ExceptionTCTypepublic int removeByType(TCType type, String resourceid) throws Exception
removeByType in interface TransformationCatalogtype - TCType The type of the transformationresourceid - String The resource on which the transformation exists.
If NULL then that type of transformation is deleted from all the resources.ExceptionTCTypepublic int removeBySysInfo(SysInfo sysinfo) throws Exception
removeBySysInfo in interface TransformationCatalogsysinfo - SysInfo The System Information by which you want to deleteExceptionSysInfopublic int removeBySiteID(String resourceid) throws Exception
removeBySiteID in interface TransformationCatalogresourceid - String The resource which you want to remove.Exceptionpublic int clear()
throws Exception
clear in interface TransformationCatalogExceptionpublic int deletePFNProfiles(String physicalname, TCType type, String resourceid, List profiles) throws Exception
deletePFNProfiles in interface TransformationCatalogphysicalname - String The physical name of the transformation.type - TCType The type of the transformation.resourceid - String The resource of the transformation.profiles - List The list of profiles to be deleted. If NULL then all profiles for that pfn+resource+type are deleted.Exceptionorg.griphyn.cPlanner.classes.Profilepublic int deleteLFNProfiles(String namespace, String name, String version, List profiles) throws Exception
deleteLFNProfiles in interface TransformationCatalognamespace - String The namespace of the logical transformation.name - String The name of the logical transformation.version - String The version of the logical transformation.profiles - List The List of profiles to be deleted. If NULL
then all profiles for the logical transformation are deleted.Exceptionorg.griphyn.cPlanner.classes.Profileprivate static void columnLength(String[] s, int[] count)
s - String[]count - int[]protected void logMessage(String msg)
msg - the message to be logged.