Package edu.isi.pegasus.planner.client
Class VDS2PegasusProperties
- java.lang.Object
-
- edu.isi.pegasus.planner.client.Executable
-
- edu.isi.pegasus.planner.client.VDS2PegasusProperties
-
public class VDS2PegasusProperties extends Executable
A Central Properties class that keeps track of all the properties used by Pegasus. All other classes access the methods in this class to get the value of the property. It access the VDSProperties class to read the property file.- Version:
- $Revision$
- Author:
- Karan Vahi, Gaurang Mehta
- See Also:
org.griphyn.common.util.VDSProperties
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.Pattern[]mCompiledPatternsStores compiled patterns at first use, quasi-Singleton.private java.lang.StringmInputFileThe input directory containing the kickstart records.private java.lang.StringmOutputDirThe output directory where to generate the ploticus output.private static java.lang.String[]mRegexExpressionStore the regular expressions necessary to match the * properties.private static java.lang.String[][]mStarReplacementsReplacement 2 D Array for the above properties.private static java.util.MapmTXFERImplTableAn internal table that resolves the old transfer mode property, to the corresponding transfer implementation.private static java.util.MapmTXFERRefinerTableAn internal table that resolves the old transfer mode property, to the corresponding transfer refiner.private static java.util.MapmVDSToPegasusPropertiesTableThe handle to the internal map, that maps vds properties to pegasus properties.-
Fields inherited from class edu.isi.pegasus.planner.client.Executable
mLogger, mLogMsg, mProps, mVersion
-
-
Constructor Summary
Constructors Constructor Description VDS2PegasusProperties()The default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static voidassociate(java.lang.String vdsProperty, java.lang.String pegasusProperty)Associates a VDS property with the new pegasus property.java.lang.Stringconvert(java.lang.String input, java.lang.String directory)Convert a VDS Properties file to Pegasus properties.voidexecuteCommand()Executes the command on the basis of the options specified.gnu.getopt.LongOpt[]generateValidOptions()Tt generates the LongOpt which contain the valid options that the command will accept.voidinitialize(java.lang.String[] opts)Initialize the executable objectvoidloadProperties()Loads all the properties that would be needed by the Toolkit classes.static voidmain(java.lang.String[] args)The main test program.protected java.lang.StringmatchForStarProperties(java.lang.String vds)Returns a matching pegasus property for a VDS star property.java.util.PropertiesmatchingSubset(java.util.Properties properties, java.lang.String prefix, boolean keepPrefix)Extracts a specific property key subset from the known properties.voidparseCommandLineArguments(java.lang.String[] args)Parses the command line arguments using GetOpt and returns aPlannerOptionscontains all the options passed by the user at the command line.voidprintLongVersion()Prints the long description, displaying in detail what the various options to the command stand for.voidprintShortVersion()Prints out a short description of what the command does.protected static voidsanityCheck(java.io.File dir)Checks the destination location for existence, if it can be created, if it is writable etc.private static java.util.MaptransferImplementationTable()Singleton access to the transfer implementation table.private static java.util.MaptransferRefinerTable()Singleton access to the transfer refiner table.private static java.util.MapvdsToPegasusPropertiesTable()Singleton access to the transfer implementation table.-
Methods inherited from class edu.isi.pegasus.planner.client.Executable
convertException, convertException, getCommandLineOptions, getEnvValue, getGVDSVersion, initialize, log, lookupConfProperty, sanityCheckOnProperties, setupLogging
-
-
-
-
Field Detail
-
mVDSToPegasusPropertiesTable
private static java.util.Map mVDSToPegasusPropertiesTable
The handle to the internal map, that maps vds properties to pegasus properties.
-
mTXFERImplTable
private static java.util.Map mTXFERImplTable
An internal table that resolves the old transfer mode property, to the corresponding transfer implementation.
-
mTXFERRefinerTable
private static java.util.Map mTXFERRefinerTable
An internal table that resolves the old transfer mode property, to the corresponding transfer refiner.
-
mRegexExpression
private static final java.lang.String[] mRegexExpression
Store the regular expressions necessary to match the * properties.
-
mStarReplacements
private static final java.lang.String[][] mStarReplacements
Replacement 2 D Array for the above properties.
-
mCompiledPatterns
private static java.util.regex.Pattern[] mCompiledPatterns
Stores compiled patterns at first use, quasi-Singleton.
-
mInputFile
private java.lang.String mInputFile
The input directory containing the kickstart records.
-
mOutputDir
private java.lang.String mOutputDir
The output directory where to generate the ploticus output.
-
-
Method Detail
-
initialize
public void initialize(java.lang.String[] opts)
Description copied from class:ExecutableInitialize the executable object- Overrides:
initializein classExecutable- Parameters:
opts- the command line argument passed to the executable
-
transferImplementationTable
private static java.util.Map transferImplementationTable()
Singleton access to the transfer implementation table. Contains the mapping of the old transfer property value to the new transfer implementation property value.- Returns:
- map
-
transferRefinerTable
private static java.util.Map transferRefinerTable()
Singleton access to the transfer refiner table. Contains the mapping of the old transfer property value to the new transfer refiner property value.- Returns:
- map
-
vdsToPegasusPropertiesTable
private static java.util.Map vdsToPegasusPropertiesTable()
Singleton access to the transfer implementation table. Contains the mapping of the old transfer property value to the new transfer implementation property value.- Returns:
- map
-
convert
public java.lang.String convert(java.lang.String input, java.lang.String directory) throws java.io.IOExceptionConvert a VDS Properties file to Pegasus properties.- Parameters:
input- the path to the VDS Properties file.directory- the directory where the Pegasus properties file needs to be written out to.- Returns:
- path to the properties file that is written.
- Throws:
java.io.IOException
-
matchForStarProperties
protected java.lang.String matchForStarProperties(java.lang.String vds)
Returns a matching pegasus property for a VDS star property.- Parameters:
vds- the vds property.- Returns:
- the new Pegasus Property if found else, null.
-
main
public static void main(java.lang.String[] args)
The main test program.- Parameters:
args- the arguments to the program.
-
executeCommand
public void executeCommand()
Executes the command on the basis of the options specified.- Parameters:
args- the command line options.
-
parseCommandLineArguments
public void parseCommandLineArguments(java.lang.String[] args)
Parses the command line arguments using GetOpt and returns aPlannerOptionscontains all the options passed by the user at the command line.- Parameters:
args- the arguments passed by the user at command line.
-
generateValidOptions
public gnu.getopt.LongOpt[] generateValidOptions()
Tt generates the LongOpt which contain the valid options that the command will accept.- Specified by:
generateValidOptionsin classExecutable- Returns:
- array of
LongOptobjects , corresponding to the valid options
-
printShortVersion
public void printShortVersion()
Prints out a short description of what the command does.- Specified by:
printShortVersionin classExecutable
-
printLongVersion
public void printLongVersion()
Prints the long description, displaying in detail what the various options to the command stand for.- Specified by:
printLongVersionin classExecutable
-
loadProperties
public void loadProperties()
Loads all the properties that would be needed by the Toolkit classes.- Specified by:
loadPropertiesin classExecutable
-
sanityCheck
protected static void sanityCheck(java.io.File dir) throws java.io.IOExceptionChecks the destination location for existence, if it can be created, if it is writable etc.- Parameters:
dir- is the new base directory to optionally create.- Throws:
java.io.IOException- in case of error while writing out files.
-
matchingSubset
public java.util.Properties matchingSubset(java.util.Properties properties, java.lang.String prefix, boolean keepPrefix)Extracts a specific property key subset from the known properties. The prefix may be removed from the keys in the resulting dictionary, or it may be kept. In the latter case, exact matches on the prefix will also be copied into the resulting dictionary.- Parameters:
properties- is the properties from where to get the subset.prefix- is the key prefix to filter the properties by.keepPrefix- if true, the key prefix is kept in the resulting dictionary. As side-effect, a key that matches the prefix exactly will also be copied. If false, the resulting dictionary's keys are shortened by the prefix. An exact prefix match will not be copied, as it would result in an empty string key.- Returns:
- a property dictionary matching the filter key. May be an empty dictionary, if no prefix matches were found.
-
associate
private static void associate(java.lang.String vdsProperty, java.lang.String pegasusProperty)Associates a VDS property with the new pegasus property.- Parameters:
vdsProperty- the old VDS property.pegasusProperty- the new Pegasus property.
-
-