[
https://issues.apache.org/jira/browse/GIRAPH-886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13973312#comment-13973312
]
Lukas Nalezenec commented on GIRAPH-886:
----------------------------------------
The error is in Hash/Range partitioners in method getPartitionOwner. It calls
partitionOwnerList.get(partionId) therefore the list must be sorted by
partitionId.
@Override
public PartitionOwner getPartitionOwner(I vertexId) {
return partitionOwnerList.get(
getPartitionIndex(vertexId, partitionOwnerList.size()));
}
https://github.com/lukasnalezenec/giraph/blob/0172ff0301765ee7189acd95247896ba4ad8a239/giraph-core/src/main/java/org/apache/giraph/partition/SimpleWorkerPartitioner.java#L50
I have added sorting to PartitionBalancer.updatePartitionOwners() because it
adds Collection masterSetPartitionOwners to List partitionOwnerList and
Collection is unsorted by contract and list is sorted by contract. Its not so
important.
https://github.com/lukasnalezenec/giraph/blob/0172ff0301765ee7189acd95247896ba4ad8a239/giraph-core/src/main/java/org/apache/giraph/partition/PartitionBalancer.java#L339
> Partition Balancing does not work
> ---------------------------------
>
> Key: GIRAPH-886
> URL: https://issues.apache.org/jira/browse/GIRAPH-886
> Project: Giraph
> Issue Type: Bug
> Components: graph
> Affects Versions: 1.1.0
> Reporter: Lukas Nalezenec
> Labels: patch
> Fix For: 1.1.0
>
> Attachments: GIRAPH-886.patch
>
>
> PartitionBalancer returns PartitionOwners in list in arbitrary order but both
> Range and Hash partitioners are assuming that list is sorted by partitionId.
--
This message was sent by Atlassian JIRA
(v6.2#6252)