Package edu.isi.pegasus.planner.cluster
Class ClustererFactory
- java.lang.Object
-
- edu.isi.pegasus.planner.cluster.ClustererFactory
-
public class ClustererFactory extends java.lang.Object
A factory class to load the appropriate Partitioner, and Clusterer Callback for clustering. An abstract factory, as it loads the appropriate partitioner matching a clustering technique.- Version:
- $Revision$
- Author:
- Karan Vahi vahi@isi.edu
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_PACKAGE_NAME
The default package where all the implementations reside.static java.lang.String
HORIZONTAL_CLUSTERING_CLASS
The name of the class implementing horizontal clustering.private static java.lang.String
LABEL_CLUSTERING_TYPE
The type corresponding to label based clustering.private static java.util.Map
mClustererTable
The table that maps a clustering technique to a clustering impelemntation.private static java.util.Map
mPartitionerTable
The table that maps clustering technique to a partitioner.static java.lang.String
VERTICAL_CLUSTERING_CLASS
The name of the class implementing vertical clustering.
-
Constructor Summary
Constructors Constructor Description ClustererFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.util.Map
clustererTable()
Returns a table that maps, the clustering technique to an appropriate class implementing that clustering technique.static Clusterer
loadClusterer(ADag dag, PegasusBag bag, java.lang.String type)
Loads the appropriate clusterer on the basis of the clustering type specified in the options passed to the planner.static Partitioner
loadPartitioner(PegasusProperties properties, java.lang.String type, GraphNode root, java.util.Map graph)
Loads the appropriate partitioner on the basis of the clustering type specified in the options passed to the planner.private static java.util.Map
partitionerTable()
Returns a table that maps, the clustering technique to an appropriate partitioning technique.
-
-
-
Field Detail
-
DEFAULT_PACKAGE_NAME
public static final java.lang.String DEFAULT_PACKAGE_NAME
The default package where all the implementations reside.- See Also:
- Constant Field Values
-
HORIZONTAL_CLUSTERING_CLASS
public static final java.lang.String HORIZONTAL_CLUSTERING_CLASS
The name of the class implementing horizontal clustering.- See Also:
- Constant Field Values
-
VERTICAL_CLUSTERING_CLASS
public static final java.lang.String VERTICAL_CLUSTERING_CLASS
The name of the class implementing vertical clustering.- See Also:
- Constant Field Values
-
LABEL_CLUSTERING_TYPE
private static final java.lang.String LABEL_CLUSTERING_TYPE
The type corresponding to label based clustering.- See Also:
- Constant Field Values
-
mPartitionerTable
private static java.util.Map mPartitionerTable
The table that maps clustering technique to a partitioner.
-
mClustererTable
private static java.util.Map mClustererTable
The table that maps a clustering technique to a clustering impelemntation.
-
-
Method Detail
-
loadPartitioner
public static Partitioner loadPartitioner(PegasusProperties properties, java.lang.String type, GraphNode root, java.util.Map graph) throws ClustererFactoryException
Loads the appropriate partitioner on the basis of the clustering type specified in the options passed to the planner.- Parameters:
properties
- thePegasusProperties
object containing all the properties required by Pegasus.type
- type of clustering to be used.root
- the dummy root node of the graph.graph
- the map containing all the nodes of the graph keyed by the logical id of the nodes.- Returns:
- the instance of the appropriate partitioner.
- Throws:
ClustererFactoryException
- that nests any error that might occur during the instantiation- See Also:
DEFAULT_PACKAGE_NAME
-
loadClusterer
public static Clusterer loadClusterer(ADag dag, PegasusBag bag, java.lang.String type) throws ClustererFactoryException
Loads the appropriate clusterer on the basis of the clustering type specified in the options passed to the planner.- Parameters:
dag
- the workflow being clustered.bag
- the bag of initialization objects.type
- type of clustering to be used.- Returns:
- the instance of the appropriate clusterer.
- Throws:
ClustererFactoryException
- that nests any error that might occur during the instantiation- See Also:
DEFAULT_PACKAGE_NAME
-
clustererTable
private static java.util.Map clustererTable()
Returns a table that maps, the clustering technique to an appropriate class implementing that clustering technique.- Returns:
- a Map indexed by clustering styles, and values as corresponding implementing Clustering classes.
-
partitionerTable
private static java.util.Map partitionerTable()
Returns a table that maps, the clustering technique to an appropriate partitioning technique.- Returns:
- a Map indexed by clustering styles, and values as corresponding Partitioners.
-
-