use of com.twitter.heron.spi.packing.PackingPlan.InstancePlan in project incubator-heron by apache.
the class PackingPlanProvider method getBoltInstanceNames.
public String[] getBoltInstanceNames(String... boltComponents) {
HashSet<String> boltComponentNames = new HashSet<>();
Collections.addAll(boltComponentNames, boltComponents);
PackingPlan packing = get();
ArrayList<String> boltInstanceNames = new ArrayList<>();
for (ContainerPlan containerPlan : packing.getContainers()) {
for (InstancePlan instancePlan : containerPlan.getInstances()) {
if (!boltComponentNames.contains(instancePlan.getComponentName())) {
continue;
}
String name = "container_" + containerPlan.getId() + "_" + instancePlan.getComponentName() + "_" + instancePlan.getTaskId();
boltInstanceNames.add(name);
}
}
return boltInstanceNames.toArray(new String[boltInstanceNames.size()]);
}
Aggregations