helix.graph.algo.c3part.aggregator
Class NodeAggregator

java.lang.Object
  extended by helix.graph.algo.c3part.aggregator.NodeAggregator
Direct Known Subclasses:
CCAggregator, PivotingAggregator

public abstract class NodeAggregator
extends Object

A class to define the way datagraph nodes are aggregated in a multinode. The main method is getTerminals(V, color) that returns the set of datagraph terminals nodes {vi} of given color that can be aggregated to a given multigraph vertex V. This is achieved by calling the isAggregable method (that tells if a datagraph node 'v' can be aggregated to a multigraph vertex 'V') on a proper set of candidates nodes.
To subclass, you have to implement two methods:
The isAggregable(V, v) public method tells if datanode v can be aggregated to multinode V
The getCandidates(V) protected method returns an Iterable of datanodes that are candidates to be terminals
The definition of terminals is therefore:
terminals = {v in getCandidates(V) / isAggregable(V, v)}
Typical subclasses are cliqueAggregator, centeredAggregator


Constructor Summary
NodeAggregator(Graph datagraph, C3PartOptions options)
          required constructor
 
Method Summary
 GraphCleaner getCleanerFor()
          get an instance of a datagraph cleaner for this aggregator default: return a NoCleaner
 C3PartOptions getOptions()
          accessor to current options
 String getParamInfo()
          get optional parameters info this is used only for logging purpose (for user information) so default is to return an empty string
 int getPreferredColor()
          tells if this aggregator has some preferred color (e.g.
 GSet<Vertex> getTerminals(Vertex V, int color)
          returns the set of datagraph terminals nodes {v} of given color that can be aggregated to a given multigraph vertex V = (v1,..., vk).
abstract  boolean isAggregable(Vertex V, Vertex v)
          Check if datagraph node 'v' can be aggregated to multigraph vertex V.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeAggregator

public NodeAggregator(Graph datagraph,
                      C3PartOptions options)
required constructor

Method Detail

isAggregable

public abstract boolean isAggregable(Vertex V,
                                     Vertex v)
Check if datagraph node 'v' can be aggregated to multigraph vertex V.


getTerminals

public GSet<Vertex> getTerminals(Vertex V,
                                 int color)
returns the set of datagraph terminals nodes {v} of given color that can be aggregated to a given multigraph vertex V = (v1,..., vk). this is the default method : it calls the isAggregable on a set of candidates nodes returned by the getCandidates_ internal method : v is terminal <=> v is candidate and isAggregable(V, v)


getOptions

public C3PartOptions getOptions()
accessor to current options


getPreferredColor

public int getPreferredColor()
tells if this aggregator has some preferred color (e.g. pivot) (this is mostly useful for ColorOptimizer's to known which color to start with) default : return < 0 for no preferred color


getCleanerFor

public GraphCleaner getCleanerFor()
get an instance of a datagraph cleaner for this aggregator default: return a NoCleaner


getParamInfo

public String getParamInfo()
get optional parameters info this is used only for logging purpose (for user information) so default is to return an empty string