I
- Vertex id valueV
- Vertex valueE
- Edge valuepublic class HashPartitionerFactory<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> extends GraphPartitionerFactory<I,V,E>
Constructor and Description |
---|
HashPartitionerFactory() |
Modifier and Type | Method and Description |
---|---|
int |
getPartition(I id,
int partitionCount,
int workerCount)
Calculates in which partition current vertex belongs to,
from interval [0, partitionCount).
|
int |
getWorker(int partition,
int partitionCount,
int workerCount)
Calculates worker that should be responsible for passed partition.
|
createMasterGraphPartitioner, createWorkerGraphPartitioner, getPartitionInRange, getPartitionInRange, initialize
getConf, setConf
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConf
setConf
public int getPartition(I id, int partitionCount, int workerCount)
GraphPartitionerFactory
getPartition
in class GraphPartitionerFactory<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
id
- Vertex idpartitionCount
- Number of partitionsworkerCount
- Number of workerspublic int getWorker(int partition, int partitionCount, int workerCount)
GraphPartitionerFactory
getWorker
in class GraphPartitionerFactory<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
partition
- Current partitionpartitionCount
- Number of partitionsworkerCount
- Number of workersCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.