edu.isi.pegasus.planner.partitioner

## Class ClustererCallback

- java.lang.Object
- - edu.isi.pegasus.planner.partitioner.ClustererCallback

All Implemented Interfaces:
  Callback

    public class ClustererCallback
    extends java.lang.Object
    implements Callback

A Callback implementation that passes the partitions detected during the partitioning of the worflow to a Clusterer for clustering. The clusterer is passed off to the callback during the callback initialization.

Version:
  $Revision$
Author:
  Karan Vahi

### Field Summary

Fields
`private Clusterer` `mClusterer` The handle to the clusterer that does the clustering.
`private PegasusProperties` `mProps` The handle to the properties object.

### Constructor Summary

Constructors
Constructor and Description
`ClustererCallback()` The default constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `cbDone()` Callback for the partitioner to signal that it is done with the processing.
`void` `cbParents(java.lang.String child, java.util.List parents)` Callback for when a partitioner determines the relations between partitions that it has previously constructed.
`void` `cbPartition(Partition p)` Callback for when a partitioner determines that partition has been constructed.
`void` `initialize(PegasusProperties properties, Clusterer clusterer)` Initializes the callback.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### mClusterer

    private Clusterer mClusterer

The handle to the clusterer that does the clustering.

#### mProps

    private PegasusProperties mProps

The handle to the properties object.

### Constructor Detail

#### ClustererCallback

    public ClustererCallback()

The default constructor.

### Method Detail

#### initialize

    public void initialize(PegasusProperties properties,
                           Clusterer clusterer)

Initializes the callback.

Parameters:
  `properties` - the properties passed to the planner.
  `clusterer` - the clusterer that has to be called out, in the callback methods.

#### cbPartition

    public void cbPartition(Partition p)

Callback for when a partitioner determines that partition has been constructed. The partition is passed off to the clusterer that the callback has been initialized with.

Specified by:
  `cbPartition` in interface `Callback`
Parameters:
  `p` - the constructed partition.
Throws:
  `java.lang.RuntimeException` - in case of callback not being initialized, or a ClustererException being thrown during the Clusterer operation.

#### cbParents

    public void cbParents(java.lang.String child,
                          java.util.List parents)

Callback for when a partitioner determines the relations between partitions that it has previously constructed.

Specified by:
  `cbParents` in interface `Callback`
Parameters:
  `child` - the id of a partition.
  `parents` - the list of `String` objects that contain the id's of the parents of the partition.
Throws:
  `java.lang.RuntimeException` - in case of callback not being initialized, or a ClustererException being thrown during the Clusterer operation.

#### cbDone

    public void cbDone()

Callback for the partitioner to signal that it is done with the processing.

Specified by:
  `cbDone` in interface `Callback`