I
- Vertex id valueV
- Vertex valueE
- Edge valuepublic abstract class GraphPartitionerFactory<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> extends DefaultImmutableClassesGiraphConfigurable<I,V,E> implements GraphPartitionerFactoryInterface<I,V,E>
Constructor and Description |
---|
GraphPartitionerFactory() |
Modifier and Type | Method and Description |
---|---|
MasterGraphPartitioner<I,V,E> |
createMasterGraphPartitioner()
Create the
MasterGraphPartitioner used by the master. |
WorkerGraphPartitioner<I,V,E> |
createWorkerGraphPartitioner()
Create the
WorkerGraphPartitioner used by the worker. |
abstract int |
getPartition(I id,
int partitionCount,
int workerCount)
Calculates in which partition current vertex belongs to,
from interval [0, partitionCount).
|
static int |
getPartitionInRange(int value,
int max,
int partitions)
Utility function for calculating in which partition value
from interval [0, max) should belong to.
|
static int |
getPartitionInRange(long value,
long max,
int partitions)
Utility function for calculating in which partition value
from interval [0, max) should belong to.
|
abstract int |
getWorker(int partition,
int partitionCount,
int workerCount)
Calculates worker that should be responsible for passed partition.
|
void |
initialize(LocalData<I,V,E,? extends org.apache.hadoop.io.Writable> localData)
Use some local data present in the worker
|
getConf, setConf
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConf
setConf
public void initialize(LocalData<I,V,E,? extends org.apache.hadoop.io.Writable> localData)
GraphPartitionerFactoryInterface
initialize
in interface GraphPartitionerFactoryInterface<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
localData
- localData present in the workerpublic final MasterGraphPartitioner<I,V,E> createMasterGraphPartitioner()
GraphPartitionerFactoryInterface
MasterGraphPartitioner
used by the master.
Instantiated once by the master and reused.createMasterGraphPartitioner
in interface GraphPartitionerFactoryInterface<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
public final WorkerGraphPartitioner<I,V,E> createWorkerGraphPartitioner()
GraphPartitionerFactoryInterface
WorkerGraphPartitioner
used by the worker.
Instantiated once by every worker and reused.createWorkerGraphPartitioner
in interface GraphPartitionerFactoryInterface<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
public abstract int getPartition(I id, int partitionCount, int workerCount)
id
- Vertex idpartitionCount
- Number of partitionsworkerCount
- Number of workerspublic abstract int getWorker(int partition, int partitionCount, int workerCount)
partition
- Current partitionpartitionCount
- Number of partitionsworkerCount
- Number of workerspublic static int getPartitionInRange(int value, int max, int partitions)
value
- Value for which partition is requestedmax
- Maximum possible valuepartitions
- Number of partitions, equally sized.public static int getPartitionInRange(long value, long max, int partitions)
value
- Value for which partition is requestedmax
- Maximum possible valuepartitions
- Number of partitions, equally sized.Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.