public class File extends Abstract implements TransformationCatalog
| Modifier and Type | Field and Description |
|---|---|
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 java.lang.String |
mTCFile
The path to the file based TC.
|
private static File |
mTCFileHandle
The singleton handler to the contents of the transformation catalog.
|
private java.util.Map |
mTreeMap
The Tree Map which stores the contents of the file.
|
protected java.util.List |
mvExecPools
The List containing the user specified list of pools on which he wants
the dag to run.
|
MODIFY_FOR_FILE_URLS_KEY, VERSIONDB_ALL_PREFIX| Constructor and Description |
|---|
File() |
| Modifier and Type | Method and Description |
|---|---|
int |
addLFNProfile(java.lang.String namespace,
java.lang.String name,
java.lang.String version,
java.util.List profiles)
Add additional profile to a logical transformation .
|
int |
addPFNProfile(java.lang.String pfn,
TCType type,
java.lang.String resourcename,
java.util.List profiles)
Add additional profile to a physical transformation.
|
protected boolean |
addTCEntry(java.lang.String namespace,
java.lang.String name,
java.lang.String version,
java.lang.String physicalname,
TCType type,
java.lang.String resourceid,
java.util.List pfnprofiles,
java.util.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()
Explicitely free resources before the garbage collection hits.
|
boolean |
connect(java.util.Properties props)
Establishes a link between the implementation and the thing the
implementation is build upon.
|
int |
deleteLFNProfiles(java.lang.String namespace,
java.lang.String name,
java.lang.String version,
java.util.List profiles)
Delete a list of profiles or all the profiles associated with a logical
transformation.
|
int |
deletePFNProfiles(java.lang.String physicalname,
TCType type,
java.lang.String resourceid,
java.util.List profiles)
Delete a list of profiles or all the profiles associated with a pfn on a
resource and of a type.
|
void |
File()
The default constructor.
|
java.util.List<TransformationCatalogEntry> |
getContents()
List all the contents of the TC
|
java.lang.String |
getDescription()
Returns a textual description of the transformation mode.
|
static TransformationCatalog |
getInstance()
Deprecated.
|
java.util.List<java.lang.String[]> |
getTCLogicalNames(java.lang.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(java.util.List<TransformationCatalogEntry> entries)
Add multiple TCEntries to the Catalog.
|
int |
insert(java.lang.String namespace,
java.lang.String name,
java.lang.String version,
java.lang.String physicalname,
TCType type,
java.lang.String resourceid,
java.util.List pfnprofiles,
java.util.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()
Predicate to check, if the connection with the catalog's
implementation is still active.
|
protected void |
logMessage(java.lang.String msg)
Logs the message to a logging stream.
|
java.util.List<TransformationCatalogEntry> |
lookup(java.lang.String namespace,
java.lang.String name,
java.lang.String version,
java.util.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.
|
java.util.List<TransformationCatalogEntry> |
lookup(java.lang.String namespace,
java.lang.String name,
java.lang.String version,
java.lang.String resourceid,
TCType type)
Returns TC entries for a particular logical transformation and/or on a
particular resource and/or of a particular type.
|
java.util.List<Profile> |
lookupLFNProfiles(java.lang.String namespace,
java.lang.String name,
java.lang.String version)
Get the list of Profiles associated with a particular logical transformation.
|
java.util.List<TransformationCatalogEntry> |
lookupNoProfiles(java.lang.String namespace,
java.lang.String name,
java.lang.String version,
java.lang.String resourceid,
TCType type)
Get the list of PhysicalNames for a particular transformation on a site/sites
for a particular type/types;
|
java.util.List<Profile> |
lookupPFNProfiles(java.lang.String pfn,
java.lang.String resourceid,
TCType type)
Get the list of Profiles associated with a particular physical transformation.
|
java.util.List<java.lang.String> |
lookupSites(java.lang.String namespace,
java.lang.String name,
java.lang.String version,
TCType type)
Get the list of Resource ID's where a particular transformation may reside.
|
private boolean |
populateTC()
Populates the internal copy of the transformation catalog from the file
containing the transformation catalog in the 6 column format.
|
private boolean |
populateTC(java.io.InputStream reader)
Populates the internal copy of the transformation catalog from a byte
stream (input stream).
|
private boolean |
populateTC(java.io.Reader reader)
Adds multiple entries into the TC.
|
int |
removeByLFN(java.lang.String namespace,
java.lang.String name,
java.lang.String version,
java.lang.String resourceid,
TCType type)
Delete all entries in the transformation catalog for a give logical tranformation and/or on a resource and/or of
a particular type
|
int |
removeByPFN(java.lang.String physicalname,
java.lang.String namespace,
java.lang.String name,
java.lang.String version,
java.lang.String resourceid,
TCType type)
Delete all entries in the transformation catalog for pair of logical and physical transformation.
|
int |
removeBySiteID(java.lang.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,
java.lang.String resourceid)
Delete a particular type of transformation, and/or on a particular resource
|
private void |
writeTC() |
modifyForFileURLS, modifyForFileURLSprivate static File mTCFileHandle
protected LogManager mLogger
protected java.util.List mvExecPools
private java.util.Map mTreeMap
private java.lang.String mTCFile
private PegasusProperties mProps
private boolean mFlushOnClose
private boolean modifyFileURL
public static TransformationCatalog getInstance()
public void File()
public void initialize(PegasusBag bag)
initialize in interface TransformationCatalogbag - the bag of Pegasus initialization objects.public java.lang.String getDescription()
getDescription in interface TransformationCatalogpublic java.util.List<TransformationCatalogEntry> lookup(java.lang.String namespace, java.lang.String name, java.lang.String version, java.util.List resourceids, TCType type) throws java.lang.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.java.lang.ExceptionTCType,
edu.isi.pegasus.planner.catalog.TransformationCatalogEntrypublic java.util.List<TransformationCatalogEntry> lookup(java.lang.String namespace, java.lang.String name, java.lang.String version, java.lang.String resourceid, TCType type) throws java.lang.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.java.lang.ExceptionTCType,
edu.isi.pegasus.planner.catalog.TransformationCatalogEntrypublic java.util.List<java.lang.String> lookupSites(java.lang.String namespace,
java.lang.String name,
java.lang.String version,
TCType type)
throws java.lang.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.java.lang.Exception - NotImplementedException if not implementedTCTypepublic java.util.List<TransformationCatalogEntry> lookupNoProfiles(java.lang.String namespace, java.lang.String name, java.lang.String version, java.lang.String resourceid, TCType type) throws java.lang.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. java.lang.Exception - NotImplementedException if not implemented.TCTypepublic java.util.List<java.lang.String[]> getTCLogicalNames(java.lang.String resourceid,
TCType type)
throws java.lang.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. java.lang.Exception - NotImplementedException if not implemented.public java.util.List<Profile> lookupLFNProfiles(java.lang.String namespace, java.lang.String name, java.lang.String version) throws java.lang.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.java.lang.Exception - NotImplementedException if not implemented.org.griphyn.cPlanner.classes.Profilepublic java.util.List<Profile> lookupPFNProfiles(java.lang.String pfn, java.lang.String resourceid, TCType type) throws java.lang.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. java.lang.Exception - NotImplementedException if not implemented.org.griphyn.cPlanner.classes.Profilepublic java.util.List<TransformationCatalogEntry> getContents() throws java.lang.Exception
getContents in interface TransformationCatalogjava.lang.Exceptionpublic int insert(java.util.List<TransformationCatalogEntry> entries) throws java.lang.Exception
insert in interface TransformationCatalogtcentry - List Takes a list of TransformationCatalogEntry objects as inputjava.lang.Exceptionedu.isi.pegasus.planner.catalog.TransformationCatalogEntrypublic int insert(TransformationCatalogEntry entry) throws java.lang.Exception
insert in interface TransformationCatalogtcentry - Takes a single TransformationCatalogEntry object as inputjava.lang.Exceptionedu.isi.pegasus.planner.catalog.TransformationCatalogEntrypublic int insert(TransformationCatalogEntry entry, boolean write) throws java.lang.Exception
insert in interface TransformationCatalogtcentry - Takes a single TransformationCatalogEntry object as inputwrite - boolean enable write commits to backed catalog or not.java.lang.Exceptionedu.isi.pegasus.planner.catalog.TransformationCatalogEntrypublic int insert(java.lang.String namespace,
java.lang.String name,
java.lang.String version,
java.lang.String physicalname,
TCType type,
java.lang.String resourceid,
java.util.List pfnprofiles,
java.util.List lfnprofiles,
SysInfo system)
throws java.lang.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.java.lang.Exceptionedu.isi.pegasus.planner.catalog.TransformationCatalogEntry,
SysInfo,
org.griphyn.cPlanner.classes.Profileprotected boolean addTCEntry(java.lang.String namespace,
java.lang.String name,
java.lang.String version,
java.lang.String physicalname,
TCType type,
java.lang.String resourceid,
java.util.List pfnprofiles,
java.util.List lfnprofiles,
SysInfo system,
Notifications invokes,
boolean write)
throws java.lang.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 catalogjava.lang.Exceptionorg.griphyn.common.catalog.TransformationCatalogEntry,
SysInfo,
org.griphyn.cPlanner.classes.Profilepublic int addLFNProfile(java.lang.String namespace,
java.lang.String name,
java.lang.String version,
java.util.List profiles)
throws java.lang.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.java.lang.Exceptionorg.griphyn.cPlanner.classes.Profilepublic int addPFNProfile(java.lang.String pfn,
TCType type,
java.lang.String resourcename,
java.util.List profiles)
throws java.lang.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.java.lang.Exceptionorg.griphyn.cPlanner.classes.Profilepublic int removeByLFN(java.lang.String namespace,
java.lang.String name,
java.lang.String version,
java.lang.String resourceid,
TCType type)
throws java.lang.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.java.lang.ExceptionTCTypepublic int removeByPFN(java.lang.String physicalname,
java.lang.String namespace,
java.lang.String name,
java.lang.String version,
java.lang.String resourceid,
TCType type)
throws java.lang.Exception
removeByPFN in interface TransformationCatalogphysicalname - String The physical name of the transformationnamespace - String The namespace assocaited 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.java.lang.ExceptionTCTypepublic int removeByType(TCType type, java.lang.String resourceid) throws java.lang.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.java.lang.ExceptionTCTypepublic int removeBySysInfo(SysInfo sysinfo) throws java.lang.Exception
removeBySysInfo in interface TransformationCatalogsysinfo - SysInfo The System Information by which you want to deletejava.lang.ExceptionSysInfopublic int removeBySiteID(java.lang.String resourceid)
throws java.lang.Exception
removeBySiteID in interface TransformationCatalogresourceid - String The resource which you want to remove.java.lang.Exceptionpublic int clear()
throws java.lang.Exception
clear in interface TransformationCatalogjava.lang.Exceptionpublic int deletePFNProfiles(java.lang.String physicalname,
TCType type,
java.lang.String resourceid,
java.util.List profiles)
throws java.lang.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.java.lang.Exceptionorg.griphyn.cPlanner.classes.Profilepublic int deleteLFNProfiles(java.lang.String namespace,
java.lang.String name,
java.lang.String version,
java.util.List profiles)
throws java.lang.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.java.lang.Exceptionorg.griphyn.cPlanner.classes.Profilepublic boolean connect(java.util.Properties props)
CatalogFIXME: The cause for failure is lost without exceptions.
public boolean isClosed()
Catalogclose().isClosed in interface CatalogCatalog.close()public void close()
Catalogprivate void writeTC()
private boolean populateTC(java.io.InputStream reader)
reader - the InputStrean containing the bytes to be
read.private boolean populateTC()
private boolean populateTC(java.io.Reader reader)
reader - the input stream from where to read the contents of the
transformation catalog.protected void logMessage(java.lang.String msg)
msg - the message to be logged.