com.intel.hadoop.graphbuilder.partition.strategy
Class GreedyIngress<VidType>

java.lang.Object
  extended by com.intel.hadoop.graphbuilder.partition.strategy.GreedyIngress<VidType>
Type Parameters:
VidType -
All Implemented Interfaces:
Ingress<VidType>

public class GreedyIngress<VidType>
extends java.lang.Object
implements Ingress<VidType>

Greedy assigns the partition id to minimize the total size of vertex mirrors. This class keeps track of the edges it has seen, and assign the partitions to new edges such that the increase of total vertex mirror size is minimized while the balance among partitions is also maintained.


Constructor Summary
GreedyIngress(int numProcs)
           
 
Method Summary
 short computePid(VidType source, VidType target)
           
 int numProcs()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GreedyIngress

public GreedyIngress(int numProcs)
Method Detail

computePid

public short computePid(VidType source,
                        VidType target)
Specified by:
computePid in interface Ingress<VidType>
Returns:
the partition id for the edge.

numProcs

public int numProcs()
Specified by:
numProcs in interface Ingress<VidType>
Returns:
number of total partitions.