use of org.apache.helix.model.ResourceAssignment in project helix by apache.
the class TaskRebalancer method buildEmptyAssignment.
protected ResourceAssignment buildEmptyAssignment(String name, CurrentStateOutput currStateOutput) {
ResourceAssignment assignment = new ResourceAssignment(name);
Set<Partition> partitions = currStateOutput.getCurrentStateMappedPartitions(name);
for (Partition partition : partitions) {
Map<String, String> currentStateMap = currStateOutput.getCurrentStateMap(name, partition);
Map<String, String> replicaMap = Maps.newHashMap();
for (String instanceName : currentStateMap.keySet()) {
replicaMap.put(instanceName, HelixDefinedState.DROPPED.toString());
}
assignment.addReplicaMap(partition, replicaMap);
}
return assignment;
}
Aggregations