Package edu.isi.pegasus.planner.parser
Class DAXParserFactory
- java.lang.Object
-
- edu.isi.pegasus.planner.parser.DAXParserFactory
-
public class DAXParserFactory extends java.lang.Object
A factory class to load the appropriate DAX Parser and Callback implementations that need to be passed to the DAX Parser.- Version:
- $Revision$
- Author:
- Karan Vahi
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DAX_PARSER2_CLASS
The DAXParser3 classnamestatic java.lang.String
DAX_PARSER3_CLASS
The DAXParser3 classnamestatic long
DAX_VERSION_3_2_0
static java.lang.String
DEFAULT_CALLBACK_PACKAGE_NAME
Package to prefix "just" class names with.static java.lang.String
DEFAULT_DAX_PARSER_CLASS
The default DAXParser classnamestatic java.lang.String
DEFAULT_PARSER_PACKAGE_NAME
Package to prefix "just" class names with.static java.lang.String
LABEL_CALLBACK_CLASS
The default callback for label partitioning.
-
Constructor Summary
Constructors Constructor Description DAXParserFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map
getDAXMetadata(PegasusBag bag, java.lang.String dax)
Returns the metadata stored in the root adag element in the DAXstatic DAXParser
loadDAXParser(PegasusBag bag, Callback c, java.lang.String daxFile)
Loads the appropriate DAXParser looking at the dax schema that is specified in the DAX file.static DAXParser
loadDAXParser(PegasusBag bag, java.lang.String callbackClass, java.lang.String daxFile)
Loads the appropriate DAXParser looking at the dax schema that is specified by the user.static DAXParser
loadDAXParser(java.lang.String classname, PegasusBag bag, Callback c)
Loads the appropriate DAXParser looking at the dax schema that is specified by the user.static Callback
loadDAXParserCallback(PegasusBag bag, java.lang.String dax, java.lang.String className)
Loads the implementing class corresponding to the type specified by the user.static Callback
loadDAXParserCallback(java.lang.String type, PegasusBag bag, java.lang.String dax)
Loads the implementing class corresponding to the type specified by the user.
-
-
-
Field Detail
-
LABEL_CALLBACK_CLASS
public static java.lang.String LABEL_CALLBACK_CLASS
The default callback for label partitioning.
-
DEFAULT_PARSER_PACKAGE_NAME
public static final java.lang.String DEFAULT_PARSER_PACKAGE_NAME
Package to prefix "just" class names with.- See Also:
- Constant Field Values
-
DEFAULT_CALLBACK_PACKAGE_NAME
public static final java.lang.String DEFAULT_CALLBACK_PACKAGE_NAME
Package to prefix "just" class names with.- See Also:
- Constant Field Values
-
DAX_VERSION_3_2_0
public static final long DAX_VERSION_3_2_0
-
DEFAULT_DAX_PARSER_CLASS
public static final java.lang.String DEFAULT_DAX_PARSER_CLASS
The default DAXParser classname- See Also:
- Constant Field Values
-
DAX_PARSER2_CLASS
public static final java.lang.String DAX_PARSER2_CLASS
The DAXParser3 classname- See Also:
- Constant Field Values
-
DAX_PARSER3_CLASS
public static final java.lang.String DAX_PARSER3_CLASS
The DAXParser3 classname- See Also:
- Constant Field Values
-
-
Method Detail
-
loadDAXParser
public static DAXParser loadDAXParser(PegasusBag bag, java.lang.String callbackClass, java.lang.String daxFile) throws DAXParserFactoryException
Loads the appropriate DAXParser looking at the dax schema that is specified by the user.- Parameters:
bag
- bag of Pegasus intialization objectscallbackClass
- the dax callback classdax
- file the dax file- Returns:
- the DAXParser loaded.
- Throws:
DAXParserFactoryException
- that nests any error that might occur during the instantiation- See Also:
DEFAULT_CALLBACK_PACKAGE_NAME
-
loadDAXParser
public static DAXParser loadDAXParser(PegasusBag bag, Callback c, java.lang.String daxFile) throws DAXParserFactoryException
Loads the appropriate DAXParser looking at the dax schema that is specified in the DAX file.- Parameters:
bag
- bag of Pegasus intialization objectsc
- the dax callback.daxFile
- the dax file to parser- Returns:
- the DAXParser loaded.
- Throws:
DAXParserFactoryException
- that nests any error that might occur during the instantiation- See Also:
DEFAULT_CALLBACK_PACKAGE_NAME
-
loadDAXParser
public static final DAXParser loadDAXParser(java.lang.String classname, PegasusBag bag, Callback c)
Loads the appropriate DAXParser looking at the dax schema that is specified by the user.- Parameters:
classname
- the classname of the parser class that needs to be loadedbag
- bag of Pegasus intialization objectsc
- the DAX Callback to use- Returns:
- the DAXParser loaded.
- Throws:
DAXParserFactoryException
- that nests any error that might occur during the instantiation- See Also:
DEFAULT_CALLBACK_PACKAGE_NAME
-
loadDAXParserCallback
public static Callback loadDAXParserCallback(java.lang.String type, PegasusBag bag, java.lang.String dax) throws DAXParserFactoryException
Loads the implementing class corresponding to the type specified by the user. The properties object passed should not be null. The callback that is loaded, is the one referred to in the properties by the user, unless the type of partitioning is label. In that case DAX2LabelGraph is loaded always.- Parameters:
properties
- thePegasusProperties
object containing all the properties required by Pegasus.type
- the type of partitioning the user specified.dax
- the path to the DAX file that has to be parsed.- Returns:
- the instance of the class implementing this interface.
- Throws:
DAXParserFactoryException
- that nests any error that might occur during the instantiation- See Also:
DEFAULT_CALLBACK_PACKAGE_NAME
,PegasusProperties.getPartitionerDAXCallback()
-
getDAXMetadata
public static java.util.Map getDAXMetadata(PegasusBag bag, java.lang.String dax)
Returns the metadata stored in the root adag element in the DAX- Parameters:
bag
- the bag of initialization objectsdax
- the dax file.- Returns:
- Map containing the metadata, else an empty map
-
loadDAXParserCallback
public static Callback loadDAXParserCallback(PegasusBag bag, java.lang.String dax, java.lang.String className) throws DAXParserFactoryException
Loads the implementing class corresponding to the type specified by the user. The properties object passed should not be null. The callback that is loaded, is the one referred to by the className parameter passed.- Parameters:
bag
- the bag of initialization objects containing the logger and the properties handlerdax
- the path to the DAX file that has to be parsed.className
- the name of the implementing class.- Returns:
- the instance of the class implementing this interface.
- Throws:
DAXParserFactoryException
- that nests any error that might occur during the instantiation- See Also:
DEFAULT_CALLBACK_PACKAGE_NAME
-
-