allPreviousDecisionMap.putAll(currStateOutput.getPendingStateMap(resourceId, partition));
currentMapping.put(partition, allPreviousDecisionMap);
}
// Get the assignment keyed on partition
AutoRebalanceStrategy strategy =
new AutoRebalanceStrategy(resourceId, partitions, states, Integer.MAX_VALUE,
new AutoRebalanceStrategy.DefaultPlacementScheme());
List<ParticipantId> allNodes =
Lists.newArrayList(getEligibleInstances(jobCfg, currStateOutput, instances, cache));
Collections.sort(allNodes);
ZNRecord record = strategy.typedComputePartitionAssignment(allNodes, currentMapping, allNodes);
Map<String, List<String>> preferenceLists = record.getListFields();
// Convert to an assignment keyed on participant
Map<ParticipantId, SortedSet<Integer>> taskAssignment = Maps.newHashMap();
for (Map.Entry<String, List<String>> e : preferenceLists.entrySet()) {