org.griphyn.cPlanner.cluster
Class ClustererFactory

java.lang.Object
  extended by org.griphyn.cPlanner.cluster.ClustererFactory

public class ClustererFactory
extends 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: 450 $
Author:
Karan Vahi vahi@isi.edu

Field Summary
static String DEFAULT_PACKAGE_NAME
          The default package where all the implementations reside.
static String HORIZONTAL_CLUSTERING_CLASS
          The name of the class implementing horizontal clustering.
private static String LABEL_CLUSTERING_TYPE
          The type corresponding to label based clustering.
private static Map mClustererTable
          The table that maps a clustering technique to a clustering impelemntation.
private static Map mPartitionerTable
          The table that maps clustering technique to a partitioner.
static String VERTICAL_CLUSTERING_CLASS
          The name of the class implementing vertical clustering.
 
Constructor Summary
ClustererFactory()
           
 
Method Summary
private static 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, 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, String type, GraphNode root, Map graph)
          Loads the appropriate partitioner on the basis of the clustering type specified in the options passed to the planner.
private static Map partitionerTable()
          Returns a table that maps, the clustering technique to an appropriate partitioning technique.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PACKAGE_NAME

public static final String DEFAULT_PACKAGE_NAME
The default package where all the implementations reside.

See Also:
Constant Field Values

HORIZONTAL_CLUSTERING_CLASS

public static final String HORIZONTAL_CLUSTERING_CLASS
The name of the class implementing horizontal clustering.

See Also:
Constant Field Values

VERTICAL_CLUSTERING_CLASS

public static final String VERTICAL_CLUSTERING_CLASS
The name of the class implementing vertical clustering.

See Also:
Constant Field Values

LABEL_CLUSTERING_TYPE

private static final String LABEL_CLUSTERING_TYPE
The type corresponding to label based clustering.

See Also:
Constant Field Values

mPartitionerTable

private static Map mPartitionerTable
The table that maps clustering technique to a partitioner.


mClustererTable

private static Map mClustererTable
The table that maps a clustering technique to a clustering impelemntation.

Constructor Detail

ClustererFactory

public ClustererFactory()
Method Detail

loadPartitioner

public static Partitioner loadPartitioner(PegasusProperties properties,
                                          String type,
                                          GraphNode root,
                                          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 - the PegasusProperties 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,
                                      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 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 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.


Copyright © 2007 The University of Southern California. All Rights Reserved.