I
- Vertex id typeV
- Vertex value typeE
- Edge value typepublic abstract class WorkerGraphPartitionerImpl<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> extends Object implements WorkerGraphPartitioner<I,V,E>
Constructor and Description |
---|
WorkerGraphPartitionerImpl() |
Modifier and Type | Method and Description |
---|---|
PartitionOwner |
createPartitionOwner()
Instantiate the
PartitionOwner implementation used to read the
master assignments. |
void |
extractAvailableWorkers()
Update availableWorkers
|
Collection<PartitionStats> |
finalizePartitionStats(Collection<PartitionStats> workerPartitionStats,
PartitionStore<I,V,E> partitionStore)
At the end of a superstep, workers have
PartitionStats generated
for each of their partitions. |
protected abstract int |
getPartitionIndex(I id,
int partitionCount,
int workerCount)
Calculates in which partition current vertex belongs to,
from interval [0, partitionCount).
|
PartitionOwner |
getPartitionOwner(I vertexId)
Figure out the owner of a vertex
|
Collection<? extends PartitionOwner> |
getPartitionOwners()
Get a collection of the
PartitionOwner objects. |
PartitionExchange |
updatePartitionOwners(WorkerInfo myWorkerInfo,
Collection<? extends PartitionOwner> masterSetPartitionOwners)
Get the partitions owners and update locally.
|
public PartitionOwner createPartitionOwner()
WorkerGraphPartitioner
PartitionOwner
implementation used to read the
master assignments.createPartitionOwner
in interface WorkerGraphPartitioner<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
PartitionOwner
objectpublic PartitionOwner getPartitionOwner(I vertexId)
WorkerGraphPartitioner
getPartitionOwner
in interface WorkerGraphPartitioner<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
vertexId
- Vertex id to get the partition forpublic Collection<PartitionStats> finalizePartitionStats(Collection<PartitionStats> workerPartitionStats, PartitionStore<I,V,E> partitionStore)
WorkerGraphPartitioner
PartitionStats
generated
for each of their partitions. This method will allow the user to
modify or create their own PartitionStats
interfaces to send to
the master.finalizePartitionStats
in interface WorkerGraphPartitioner<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
workerPartitionStats
- Stats generated by the infrastructure during
the supersteppartitionStore
- Partition store for this worker
(could be used to provide more useful stat information)public PartitionExchange updatePartitionOwners(WorkerInfo myWorkerInfo, Collection<? extends PartitionOwner> masterSetPartitionOwners)
WorkerGraphPartitioner
updatePartitionOwners
in interface WorkerGraphPartitioner<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
myWorkerInfo
- Worker info.masterSetPartitionOwners
- Master set partition owners, received
prior to beginning the supersteppublic Collection<? extends PartitionOwner> getPartitionOwners()
WorkerGraphPartitioner
PartitionOwner
objects.getPartitionOwners
in interface WorkerGraphPartitioner<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
public void extractAvailableWorkers()
protected abstract int getPartitionIndex(I id, int partitionCount, int workerCount)
id
- Vertex idpartitionCount
- Number of partitionsworkerCount
- Number of active workersCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.