I
- Vertex id typeV
- Vertex value typeE
- Edge value typepublic abstract class MasterGraphPartitionerImpl<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> extends Object implements MasterGraphPartitioner<I,V,E>
Constructor and Description |
---|
MasterGraphPartitionerImpl(ImmutableClassesGiraphConfiguration<I,V,E> conf)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Collection<PartitionOwner> |
createInitialPartitionOwners(Collection<WorkerInfo> availableWorkerInfos,
int maxWorkers)
Set some initial partition owners for the graph.
|
PartitionStats |
createPartitionStats()
Instantiate the
PartitionStats implementation used to read the
worker stats |
Collection<PartitionOwner> |
generateChangedPartitionOwners(Collection<PartitionStats> allPartitionStatsList,
Collection<WorkerInfo> availableWorkers,
int maxWorkers,
long superstep)
After the worker stats have been merged to a single list, the master can
use this information to send commands to the workers for any
Partition changes. |
Collection<PartitionOwner> |
getCurrentPartitionOwners()
Get current partition owners at this time.
|
protected abstract int |
getWorkerIndex(int partition,
int partitionCount,
int workerCount)
Calculates worker that should be responsible for passed partition.
|
void |
setPartitionOwners(Collection<PartitionOwner> partitionOwners)
Sets partition owners for the graph.
|
public MasterGraphPartitionerImpl(ImmutableClassesGiraphConfiguration<I,V,E> conf)
conf
- Configuration used.public Collection<PartitionOwner> createInitialPartitionOwners(Collection<WorkerInfo> availableWorkerInfos, int maxWorkers)
MasterGraphPartitioner
createInitialPartitionOwners
in interface MasterGraphPartitioner<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
availableWorkerInfos
- Workers available for partition assignmentmaxWorkers
- Maximum number of workerspublic void setPartitionOwners(Collection<PartitionOwner> partitionOwners)
MasterGraphPartitioner
setPartitionOwners
in interface MasterGraphPartitioner<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
partitionOwners
- assigned partition owners.public Collection<PartitionOwner> generateChangedPartitionOwners(Collection<PartitionStats> allPartitionStatsList, Collection<WorkerInfo> availableWorkers, int maxWorkers, long superstep)
MasterGraphPartitioner
Partition
changes. This protocol is specific to the
MasterGraphPartitioner
implementation.generateChangedPartitionOwners
in interface MasterGraphPartitioner<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
allPartitionStatsList
- All partition stats from all workers.availableWorkers
- Workers available for partition assignmentmaxWorkers
- Maximum number of workerssuperstep
- Partition owners will be set for this superstepPartitionOwner
objects that changed from
the previous superstep, empty list if no change.public Collection<PartitionOwner> getCurrentPartitionOwners()
MasterGraphPartitioner
getCurrentPartitionOwners
in interface MasterGraphPartitioner<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
PartitionOwner
objectspublic PartitionStats createPartitionStats()
MasterGraphPartitioner
PartitionStats
implementation used to read the
worker statscreatePartitionStats
in interface MasterGraphPartitioner<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
PartitionStats
objectprotected abstract int getWorkerIndex(int partition, int partitionCount, int workerCount)
partition
- Current partitionpartitionCount
- Number of partitionsworkerCount
- Number of workersCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.