com.intel.hadoop.graphbuilder.partition.strategy
Class GreedyIngress<VidType>
java.lang.Object
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.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GreedyIngress
public GreedyIngress(int numProcs)
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.