/*
For cluster resume/resize, the blueprint is already exist, we need to check if this blueprint is created by BDE.
So far, just check if all goup names and components exist in Ambari Cluster are included in given blueprint
*/
String clusterName = clusterDef.getName();
ApiBlueprint apiBlueprint = apiManager.getBlueprint(clusterName);
Map<String, Set> GroupNamesWithComponents = new HashMap<String, Set>();
for (AmNodeDef node : clusterDef.getNodes()) {
Set<String> components = new HashSet<String>();
GroupNamesWithComponents.put(node.getName(), components);
}
for (ApiHostGroup apiHostGroup : apiBlueprint.getApiHostGroups()) {
String groupName = apiHostGroup.getName();
if (!GroupNamesWithComponents.containsKey(groupName)) {
throw AmException.BLUEPRINT_ALREADY_EXIST(clusterName);
}
Set<String> components = GroupNamesWithComponents.get(groupName);