use of com.sequenceiq.cloudbreak.domain.InstanceMetaData in project cloudbreak by hortonworks.
the class StackRepairService method groupInstancesByHostGroups.
private UnhealthyInstances groupInstancesByHostGroups(Stack stack, Iterable<String> unhealthyInstanceIds) {
UnhealthyInstances unhealthyInstances = new UnhealthyInstances();
for (String instanceId : unhealthyInstanceIds) {
InstanceMetaData instanceMetaData = instanceMetaDataRepository.findByInstanceId(stack.getId(), instanceId);
HostMetadata hostMetadata = hostMetadataRepository.findHostInClusterByName(stack.getCluster().getId(), instanceMetaData.getDiscoveryFQDN());
String hostGroupName = hostMetadata.getHostGroup().getName();
unhealthyInstances.addInstance(instanceId, hostGroupName);
}
return unhealthyInstances;
}
Aggregations