// 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, getPartitionMap());
commService.fixPartitionIdToSocketAddrMap();
Map<WorkerInfo, List<Integer>> workerPartitionMap =
partitionExchange.getSendWorkerPartitionMap();
if (!workerPartitionMap.isEmpty()) {
sendWorkerPartitions(workerPartitionMap);
}
Set<WorkerInfo> myDependencyWorkerSet =
partitionExchange.getMyDependencyWorkerSet();
Set<String> workerIdSet = new HashSet<String>();
for (WorkerInfo workerInfo : myDependencyWorkerSet) {
if (workerIdSet.add(workerInfo.getHostnameId()) != true) {
throw new IllegalStateException(
"exchangeVertexPartitions: Duplicate entry " + workerInfo);