Package edu.isi.pegasus.planner.dax
Class File
java.lang.Object
edu.isi.pegasus.planner.dax.CatalogType
edu.isi.pegasus.planner.dax.File
This class is the container for any File object, either the RC section, or uses
- Version:
- $Revision$
- Author:
- gmehta
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCustom serializer for YAML representation of a Filestatic enumThe linkages that a file can be ofstatic enumThree Transfer modes supported, Transfer this file, don't transfer or stageout as well as optional. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanIs the file an executable.protected File.LINKprotected StringThe logical name of the file.protected StringThe namespace on a file.protected booleanIs the file optionalprotected booleanShould the file be registered in the replica catalogprotected StringFile size of the file no units requiredprotected File.TRANSFERShould the file be transferred on generation.protected StringThe logical version of the file.protected booleanA boolean tracking whether a file is for use of planner i.e.Fields inherited from class edu.isi.pegasus.planner.dax.CatalogType
mLogger, mMetadata, mPFNs, mProfiles -
Constructor Summary
ConstructorsConstructorDescriptionCopy constructorCopy constructor, but change the linkage of the file.Create new file objectCreate new file objectCreate new File objectCreate a new file object -
Method Summary
Modifier and TypeMethodDescriptionclone()Return a clone of this FilebooleanCheck if this File is equal to Object obooleanCheck if the file is an executablegetLink()Get the linkage of the file.getName()Get the name of the fileGet the namespace of the filebooleanCheck the optional flag of the filebooleanGet the register flag of this file.getSize()Return the size of the fileGet the transfer type of the fileGet the version of the fileinthashCode()HashCode of this FilebooleanisFile()Boolean indicating whether is of type fileMark the file as executable.setExecutable(boolean executable) Mark the file as executable.Set the file linkagesetOptional(boolean optionalflag) Set the optional flag on the file.setRegister(boolean registerflag) Set the register flag of the file.Set the size of the file.setTransfer(File.TRANSFER transferflag) Set the transfer type of the fileMark the file to be used for planner.setUseForPlanning(boolean value) Mark the file to be used for planner.edu.isi.pegasus.planner.classes.ReplicaLocationAdapter function to convert File object to Replica Location object so that we can serialize to YAML using existing interface.voidtoXML(edu.isi.pegasus.common.util.XMLWriter writer) Write the file objectvoidtoXML(edu.isi.pegasus.common.util.XMLWriter writer, int indent) Write the file object, with indent level NvoidWrite the file object as XML but render it as the elementnamebooleanReturns boolean indicating whether the file is marked for planner use.Methods inherited from class edu.isi.pegasus.planner.dax.CatalogType
addMetaData, addMetaData, addMetaData, addPhysicalFile, addPhysicalFile, addPhysicalFile, addPhysicalFiles, addProfile, addProfile, addProfiles, addProfiles, getMetaData, getPhysicalFiles, getProfiles, isExecutable
-
Field Details
-
mNamespace
The namespace on a file. This is used for Executables only -
mName
The logical name of the file. -
mVersion
The logical version of the file. This is used for executables only. -
mLink
-
mOptional
protected boolean mOptionalIs the file optional -
mRegister
protected boolean mRegisterShould the file be registered in the replica catalog -
mTransfer
Should the file be transferred on generation. -
mExecutable
protected boolean mExecutableIs the file an executable. -
useForPlanning
protected boolean useForPlanningA boolean tracking whether a file is for use of planner i.e. to be used for planning a sub workflow. -
mSize
File size of the file no units required
-
-
Constructor Details
-
File
Create new file object- Parameters:
name- The name of the file
-
File
Create new file object- Parameters:
name- The name of the filelink- The linkage of the file
-
File
Copy constructor- Parameters:
f- File
-
File
Copy constructor, but change the linkage of the file.- Parameters:
f- Filelink- Link
-
File
Create new File object- Parameters:
namespace- namespacename- the nameversion- the version
-
File
Create a new file object- Parameters:
namespace- The namespace of the filename- The name of the fileversion- The version of the filelink- The linkage of the file.
-
-
Method Details
-
getName
Get the name of the file- Returns:
- the name
-
getNamespace
Get the namespace of the file- Returns:
- the namespace
-
getVersion
Get the version of the file- Returns:
- version
-
getLink
Get the linkage of the file.- Returns:
- linkage
-
setLink
Set the file linkage- Parameters:
link- the linkage- Returns:
- File
- See Also:
-
setOptional
Set the optional flag on the file. Default is false- Parameters:
optionalflag- boolean to indicate if file is optional- Returns:
- File
-
getOptional
public boolean getOptional()Check the optional flag of the file- Returns:
- boolean
-
setRegister
Set the register flag of the file. Default is true- Parameters:
registerflag- register flag- Returns:
- File
-
getRegister
public boolean getRegister()Get the register flag of this file.- Returns:
- boolean
-
setTransfer
Set the transfer type of the file- Parameters:
transferflag- the transfer flag for the file- Returns:
- File
- See Also:
-
getTransfer
Get the transfer type of the file- Returns:
- the transfer flag
-
setExecutable
Mark the file as executable. Default is false- Parameters:
executable- set the file to be an executable- Returns:
- File
-
setExecutable
Mark the file as executable. Default is false- Returns:
- File
-
getExecutable
public boolean getExecutable()Check if the file is an executable- Returns:
- boolean
-
setUseForPlanning
Mark the file to be used for planner.- Parameters:
value- boolean- Returns:
- File
-
setUseForPlanning
Mark the file to be used for planner.- Returns:
- File
-
useForPlanning
public boolean useForPlanning()Returns boolean indicating whether the file is marked for planner use.- Returns:
- boolean
-
setSize
Set the size of the file.- Parameters:
size- size of the file- Returns:
- File
-
getSize
Return the size of the file- Returns:
- empty string if no size defined, otherwise returns the size
-
isFile
public boolean isFile()Boolean indicating whether is of type file- Overrides:
isFilein classCatalogType- Returns:
- boolean
-
equals
Check if this File is equal to Object o -
hashCode
public int hashCode()HashCode of this File -
clone
Return a clone of this File -
toXML
public void toXML(edu.isi.pegasus.common.util.XMLWriter writer) Write the file object- Overrides:
toXMLin classCatalogType- Parameters:
writer- the xml writer- See Also:
-
XMLWriter
-
toXML
public void toXML(edu.isi.pegasus.common.util.XMLWriter writer, int indent) Write the file object, with indent level N- Overrides:
toXMLin classCatalogType- Parameters:
writer- xml writerindent- number of indent spaces- See Also:
-
XMLWriter
-
toXML
Write the file object as XML but render it as the elementname- Parameters:
writer- xml writerindent- number of indent spaceselementname- name of the element
-
toReplicaLocation
public edu.isi.pegasus.planner.classes.ReplicaLocation toReplicaLocation()Adapter function to convert File object to Replica Location object so that we can serialize to YAML using existing interface.- Returns:
- ReplicaLocation object
-