Package edu.isi.pegasus.planner.client
Class RankDAX
- java.lang.Object
-
- edu.isi.pegasus.planner.client.Executable
-
- edu.isi.pegasus.planner.client.RankDAX
-
public class RankDAX extends Executable
A client that ranks the DAX'es corresponding to the request id.- Version:
- $Revision$
- Author:
- Karan Vahi
-
-
Field Summary
Fields Modifier and Type Field Description private PegasusBag
mBag
The bag of objects that Pegasus requires.private java.lang.String
mBaseDir
The base directory where the ranked daxes are kept.private java.lang.String
mOutputFile
The output file that lists the daxes in sorted order.private PlannerOptions
mPlannerOptions
The options to be passed ahead to pegasus plan.private java.lang.String
mRequestID
The request id to get the daxes.private java.util.List
mSites
The list of grid sites where the daxes can run.private int
mTopNum
The top n workflows to execute and put in the rankings file-
Fields inherited from class edu.isi.pegasus.planner.client.Executable
mLogger, mLogMsg, mProps, mVersion
-
-
Constructor Summary
Constructors Constructor Description RankDAX()
The default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
executeCommand()
Executes the command on the basis of the options specified.private java.util.List
generateList(java.lang.String str)
Generates a List by parsing a comma separated string.gnu.getopt.LongOpt[]
generateValidOptions()
It generates the LongOpt which contain the valid options that the command will accept.void
initialize(java.lang.String[] opts)
Initialize the executable objectvoid
loadProperties()
Loads all the properties that would be needed by the Toolkit classes.static void
main(java.lang.String[] args)
The main program for the CPlanner.void
parseCommandLineArguments(java.lang.String[] args)
Parses the command line arguments using GetOpt and sets the class member variables.void
printLongVersion()
This method is used to print the long version of the command.void
printShortHelp()
This is used to print the short version of the command.void
printShortVersion()
This is used to print the short version of the command.protected static void
sanityCheck(java.io.File dir)
Checks the destination location for existence, if it can be created, if it is writable etc.protected void
writeOutRankings(java.io.File file, java.util.Collection<Ranking> rankings)
Writes out the ranking to the file.-
Methods inherited from class edu.isi.pegasus.planner.client.Executable
convertException, convertException, getCommandLineOptions, getEnvValue, getGVDSVersion, initialize, log, lookupConfProperty, sanityCheckOnProperties, setupLogging
-
-
-
-
Field Detail
-
mBaseDir
private java.lang.String mBaseDir
The base directory where the ranked daxes are kept.
-
mSites
private java.util.List mSites
The list of grid sites where the daxes can run.
-
mOutputFile
private java.lang.String mOutputFile
The output file that lists the daxes in sorted order.
-
mRequestID
private java.lang.String mRequestID
The request id to get the daxes.
-
mBag
private PegasusBag mBag
The bag of objects that Pegasus requires.
-
mPlannerOptions
private PlannerOptions mPlannerOptions
The options to be passed ahead to pegasus plan.
-
mTopNum
private int mTopNum
The top n workflows to execute and put in the rankings file
-
-
Method Detail
-
initialize
public void initialize(java.lang.String[] opts)
Description copied from class:Executable
Initialize the executable object- Overrides:
initialize
in classExecutable
- Parameters:
opts
- the command line argument passed to the executable
-
main
public static void main(java.lang.String[] args)
The main program for the CPlanner.- Parameters:
args
- the main arguments passed to the planner.
-
parseCommandLineArguments
public void parseCommandLineArguments(java.lang.String[] args)
Parses the command line arguments using GetOpt and sets the class member variables.- Parameters:
args
- the arguments passed by the user at command line.
-
executeCommand
public void executeCommand()
Executes the command on the basis of the options specified.- Parameters:
args
- the command line options.
-
writeOutRankings
protected void writeOutRankings(java.io.File file, java.util.Collection<Ranking> rankings) throws java.io.IOException
Writes out the ranking to the file. If the file is null then it is written out to a file named ranked_daxes.txt in the directory where the daxes reside- Parameters:
file
- Stringrankings
- Collection- Throws:
java.io.IOException
-
sanityCheck
protected static void sanityCheck(java.io.File dir) throws java.io.IOException
Checks 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.
-
loadProperties
public void loadProperties()
Loads all the properties that would be needed by the Toolkit classes. Empty implementation.- Specified by:
loadProperties
in classExecutable
-
printLongVersion
public void printLongVersion()
This method is used to print the long version of the command.- Specified by:
printLongVersion
in classExecutable
-
printShortVersion
public void printShortVersion()
This is used to print the short version of the command.- Specified by:
printShortVersion
in classExecutable
-
printShortHelp
public void printShortHelp()
This is used to print the short version of the command.
-
generateValidOptions
public gnu.getopt.LongOpt[] generateValidOptions()
It generates the LongOpt which contain the valid options that the command will accept.- Specified by:
generateValidOptions
in classExecutable
- Returns:
- array of
LongOpt
objects , corresponding to the valid options
-
generateList
private java.util.List generateList(java.lang.String str)
Generates a List by parsing a comma separated string.- Parameters:
str
- the comma separted String.- Returns:
- List containing the parsed values, in case of a null string an empty List is returned.
-
-