// 2. Send all the partitions to their destination workers in a random
// fashion.
// 3. Notify completion with a ZooKeeper stamp
// 4. Wait for all my dependencies to be done (if any)
// 5. Add the partitions to myself.
PartitionExchange partitionExchange =
workerGraphPartitioner.updatePartitionOwners(
getWorkerInfo(), masterSetPartitionOwners, getPartitionStore());
workerClient.openConnections();
Map<WorkerInfo, List<Integer>> sendWorkerPartitionMap =
partitionExchange.getSendWorkerPartitionMap();
if (!getPartitionStore().isEmpty()) {
sendWorkerPartitions(sendWorkerPartitionMap);
}
Set<WorkerInfo> myDependencyWorkerSet =
partitionExchange.getMyDependencyWorkerSet();
Set<String> workerIdSet = new HashSet<String>();
for (WorkerInfo tmpWorkerInfo : myDependencyWorkerSet) {
if (!workerIdSet.add(tmpWorkerInfo.getHostnameId())) {
throw new IllegalStateException(
"exchangeVertexPartitions: Duplicate entry " + tmpWorkerInfo);