Search in sources :

Example 41 with ApiHost

use of com.cloudera.api.swagger.model.ApiHost in project cloudbreak by hortonworks.

the class ClouderaManagerHostHealthyStatusChecker method filterForHealthy.

private Set<String> filterForHealthy(ApiHostList hostList) {
    // Recent heartbeat, GOOD_HEALTH
    Set<String> goodHealthSet = new HashSet<>();
    for (ApiHost apiHost : hostList.getItems()) {
        String hostname = apiHost.getHostname();
        Instant lastheatbeat = null;
        if (StringUtils.isNotBlank(apiHost.getLastHeartbeat())) {
            lastheatbeat = Instant.parse(apiHost.getLastHeartbeat());
        }
        ApiHealthSummary healthSummary = apiHost.getHealthSummary();
        boolean inMaintenance = apiHost.getMaintenanceMode();
        ApiCommissionState commissionState = apiHost.getCommissionState();
        LOGGER.trace("CM info for: [{}]: lastHeatbeat={}, lastHeartbeatInstant={}, healthSummary={}, commissionState={}, maint={}", hostname, apiHost.getLastHeartbeat(), lastheatbeat, healthSummary, commissionState, inMaintenance);
        if (lastheatbeat != null && start.isBefore(lastheatbeat) && healthSummary == ApiHealthSummary.GOOD) {
            goodHealthSet.add(hostname);
        }
    }
    LOGGER.info("Found good host count={}", goodHealthSet.size());
    return goodHealthSet;
}
Also used : ApiCommissionState(com.cloudera.api.swagger.model.ApiCommissionState) Instant(java.time.Instant) ApiHealthSummary(com.cloudera.api.swagger.model.ApiHealthSummary) HashSet(java.util.HashSet) ApiHost(com.cloudera.api.swagger.model.ApiHost)

Example 42 with ApiHost

use of com.cloudera.api.swagger.model.ApiHost in project cloudbreak by hortonworks.

the class ClouderaManagerModificationService method upscaleCluster.

@Override
public List<String> upscaleCluster(Map<HostGroup, Set<InstanceMetaData>> instanceMetaDatasByHostGroup) throws CloudbreakException {
    ClustersResourceApi clustersResourceApi = clouderaManagerApiFactory.getClustersResourceApi(apiClient);
    Set<InstanceMetaData> instanceMetaDatas = instanceMetaDatasByHostGroup.values().stream().flatMap(Collection::stream).collect(Collectors.toSet());
    try {
        LOGGER.debug("Starting cluster upscale with hosts: {}.", instanceMetaDatas.stream().map(InstanceMetaData::getDiscoveryFQDN).collect(Collectors.joining(", ")));
        String clusterName = stack.getName();
        Set<String> clusterHostnames = getClusterHostnamesFromCM(clustersResourceApi, clusterName);
        List<ApiHost> hosts = getHostsFromCM();
        LOGGER.debug("Processing outdated cluster hosts. Cluster hostnames from CM: {}", clusterHostnames);
        setHostRackIdForOutdatedClusterHosts(instanceMetaDatas, clusterHostnames, hosts);
        LOGGER.debug("Processing upscaled cluster hosts.");
        Map<String, InstanceMetaData> upscaleInstancesMap = getInstancesMap(clusterHostnames, instanceMetaDatas, true);
        if (!upscaleInstancesMap.isEmpty()) {
            Map<String, ApiHost> upscaleHostsMap = getHostsMap(upscaleInstancesMap, hosts);
            setHostRackIdBatch(upscaleInstancesMap, upscaleHostsMap);
            ApiHostRefList bodyForAddHosts = createUpscaledHostRefList(upscaleInstancesMap, upscaleHostsMap);
            clustersResourceApi.addHosts(clusterName, bodyForAddHosts);
            activateParcels(clustersResourceApi);
            for (HostGroup hostGroup : instanceMetaDatasByHostGroup.keySet()) {
                ApiHostRefList bodyForApplyHostGroupRoles = getBodyForApplyHostGroupRoles(upscaleInstancesMap, upscaleHostsMap, hostGroup);
                applyHostGroupRolesOnUpscaledHosts(bodyForApplyHostGroupRoles, hostGroup.getName());
            }
        } else {
            redistributeParcelsForRecovery();
            activateParcels(clustersResourceApi);
        }
        deployClientConfig(clustersResourceApi, stack);
        clouderaManagerRoleRefreshService.refreshClusterRoles(apiClient, stack);
        LOGGER.debug("Cluster upscale completed.");
        return instanceMetaDatas.stream().map(InstanceMetaData::getDiscoveryFQDN).filter(Objects::nonNull).collect(Collectors.toList());
    } catch (ApiException e) {
        LOGGER.error(String.format("Failed to upscale. Response: %s", e.getResponseBody()), e);
        throw new CloudbreakException("Failed to upscale", e);
    }
}
Also used : ApiHostRefList(com.cloudera.api.swagger.model.ApiHostRefList) HostGroup(com.sequenceiq.cloudbreak.domain.stack.cluster.host.HostGroup) ClustersResourceApi(com.cloudera.api.swagger.ClustersResourceApi) InstanceMetaData(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData) CloudbreakException(com.sequenceiq.cloudbreak.service.CloudbreakException) ApiHost(com.cloudera.api.swagger.model.ApiHost) ApiException(com.cloudera.api.swagger.client.ApiException)

Example 43 with ApiHost

use of com.cloudera.api.swagger.model.ApiHost in project cloudbreak by hortonworks.

the class ClouderaManagerCommissioner method recommissionNodes.

/**
 * Attempts to recommission the provided list of hosts
 * @param stack the stack under consideration
 * @param hostsToRecommission hosts to decommission
 * @param client api client to communicate with ClouderaManager
 * @return the hostnames for hosts which were successfully recommissioned
 */
public Set<String> recommissionNodes(Stack stack, Map<String, InstanceMetaData> hostsToRecommission, ApiClient client) {
    // TODO CB-15132: Check status of target nodes / previously issued commands - in case of pod restarts etc.
    // Ideally without needing to persist anything (commandId etc)
    // TODO CB-15132: Deal with situations where CM itself is unavailable. Go back and STOP resources on the cloud-provider.
    HostsResourceApi hostsResourceApi = clouderaManagerApiFactory.getHostsResourceApi(client);
    ApiHostList hostRefList;
    try {
        hostRefList = hostsResourceApi.readHosts(null, null, SUMMARY_REQUEST_VIEW);
    } catch (ApiException e) {
        LOGGER.error("Failed to communicate with Cloudera Manager", e);
        throw new CloudbreakServiceException(e.getMessage(), e);
    }
    LOGGER.trace("Target recommissionNodes: count={}, hosts=[{}]", hostsToRecommission.size(), hostsToRecommission.keySet());
    LOGGER.debug("hostsAvailableFromCM: count={}, hosts=[{}]", hostRefList.getItems().size(), hostRefList.getItems().stream().map(ApiHost::getHostname));
    // Not considering the commission states of the nodes. Nodes could be COMMISSIONED with services in STOPPED state.
    List<String> hostsAvailableForRecommission = hostRefList.getItems().stream().filter(apiHostRef -> hostsToRecommission.containsKey(apiHostRef.getHostname())).parallel().map(ApiHost::getHostname).collect(Collectors.toList());
    Set<String> hostsAvailableForRecommissionSet = new HashSet<>(hostsAvailableForRecommission);
    List<String> cmHostsUnavailableForRecommission = hostsToRecommission.keySet().stream().filter(h -> !hostsAvailableForRecommissionSet.contains(h)).collect(Collectors.toList());
    if (cmHostsUnavailableForRecommission.size() != 0) {
        LOGGER.info("Some recommission targets are unavailable in CM: TotalRecommissionTargetCount={}, unavailableInCMCount={}, unavailableInCM=[{}]", hostsToRecommission.size(), cmHostsUnavailableForRecommission.size(), cmHostsUnavailableForRecommission);
    }
    recommissionHosts(stack, client, hostsAvailableForRecommission);
    return hostsAvailableForRecommission.stream().map(hostsToRecommission::get).filter(instanceMetaData -> instanceMetaData.getDiscoveryFQDN() != null).map(InstanceMetaData::getDiscoveryFQDN).collect(Collectors.toSet());
}
Also used : ApiHostList(com.cloudera.api.swagger.model.ApiHostList) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) ApiCommand(com.cloudera.api.swagger.model.ApiCommand) ApiClient(com.cloudera.api.swagger.client.ApiClient) LoggerFactory(org.slf4j.LoggerFactory) ApiHostList(com.cloudera.api.swagger.model.ApiHostList) ApiException(com.cloudera.api.swagger.client.ApiException) ClouderaManagerPollingServiceProvider(com.sequenceiq.cloudbreak.cm.polling.ClouderaManagerPollingServiceProvider) HashSet(java.util.HashSet) Inject(javax.inject.Inject) ApiHost(com.cloudera.api.swagger.model.ApiHost) Map(java.util.Map) ClouderaManagerResourceApi(com.cloudera.api.swagger.ClouderaManagerResourceApi) Logger(org.slf4j.Logger) HostsResourceApi(com.cloudera.api.swagger.HostsResourceApi) Set(java.util.Set) ExtendedPollingResult(com.sequenceiq.cloudbreak.polling.ExtendedPollingResult) ApiHostNameList(com.cloudera.api.swagger.model.ApiHostNameList) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) List(java.util.List) Component(org.springframework.stereotype.Component) HostGroup(com.sequenceiq.cloudbreak.domain.stack.cluster.host.HostGroup) InstanceMetaData(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData) CommandsResourceApi(com.cloudera.api.swagger.CommandsResourceApi) CloudbreakServiceException(com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException) CancellationException(com.sequenceiq.cloudbreak.cloud.scheduler.CancellationException) ClouderaManagerApiFactory(com.sequenceiq.cloudbreak.cm.client.retry.ClouderaManagerApiFactory) CloudbreakServiceException(com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException) HostsResourceApi(com.cloudera.api.swagger.HostsResourceApi) ApiException(com.cloudera.api.swagger.client.ApiException) HashSet(java.util.HashSet)

Example 44 with ApiHost

use of com.cloudera.api.swagger.model.ApiHost in project cloudbreak by hortonworks.

the class ClouderaManagerDecomissioner method decommissionNodesStopStart.

public Set<String> decommissionNodesStopStart(Stack stack, Map<String, InstanceMetaData> hostsToRemove, ApiClient client, long pollingTimeout) {
    HostsResourceApi hostsResourceApi = clouderaManagerApiFactory.getHostsResourceApi(client);
    try {
        ApiHostList hostRefList = hostsResourceApi.readHosts(null, null, SUMMARY_REQUEST_VIEW);
        LOGGER.trace("Target decommissionNodes: count={}, hosts=[{}]", hostsToRemove.size(), hostsToRemove.keySet());
        LOGGER.debug("hostsAvailableFromCM: count={}, hosts=[{}]", hostRefList.getItems().size(), hostRefList.getItems().stream().map(ApiHost::getHostname));
        List<String> stillAvailableRemovableHosts = hostRefList.getItems().stream().filter(apiHostRef -> hostsToRemove.containsKey(apiHostRef.getHostname())).parallel().map(ApiHost::getHostname).collect(Collectors.toList());
        Set<String> hostsAvailableForDecommissionSet = new HashSet<>(stillAvailableRemovableHosts);
        List<String> cmHostsUnavailableForDecommission = hostsToRemove.keySet().stream().filter(h -> !hostsAvailableForDecommissionSet.contains(h)).collect(Collectors.toList());
        if (cmHostsUnavailableForDecommission.size() != 0) {
            LOGGER.info("Some decommission targets are unavailable in CM: TotalDecommissionTargetCount={}, unavailableInCMCount={}, unavailableInCm=[{}]", hostsToRemove.size(), cmHostsUnavailableForDecommission.size(), cmHostsUnavailableForDecommission);
        }
        ClouderaManagerResourceApi apiInstance = clouderaManagerApiFactory.getClouderaManagerResourceApi(client);
        ApiHostNameList body = new ApiHostNameList().items(stillAvailableRemovableHosts);
        ApiCommand apiCommand = apiInstance.hostsDecommissionCommand(body);
        ExtendedPollingResult pollingResult = clouderaManagerPollingServiceProvider.startPollingCmHostsDecommission(stack, client, apiCommand.getId(), pollingTimeout);
        if (pollingResult.isExited()) {
            throw new CancellationException("Cluster was terminated while waiting for host decommission");
        } else if (pollingResult.isTimeout()) {
            String warningMessage = "Cloudera Manager decommission host command {} polling timed out, " + "thus we are aborting the decommission and we are retrying it for lost nodes once again.";
            abortDecommissionWithWarningMessage(apiCommand, client, warningMessage);
            throw new CloudbreakServiceException(String.format("Timeout while Cloudera Manager decommissioned host. CM command Id: %s", apiCommand.getId()));
        }
        return stillAvailableRemovableHosts.stream().map(hostsToRemove::get).filter(instanceMetaData -> instanceMetaData.getDiscoveryFQDN() != null).map(InstanceMetaData::getDiscoveryFQDN).collect(Collectors.toSet());
    } catch (ApiException e) {
        LOGGER.error("Failed to decommission hosts: {}", hostsToRemove.keySet(), e);
        throw new CloudbreakServiceException(e.getMessage(), e);
    }
}
Also used : LoggerFactory(org.slf4j.LoggerFactory) ApiService(com.cloudera.api.swagger.model.ApiService) ApiRole(com.cloudera.api.swagger.model.ApiRole) ApiException(com.cloudera.api.swagger.client.ApiException) ClustersResourceApi(com.cloudera.api.swagger.ClustersResourceApi) ApiRoleState(com.cloudera.api.swagger.model.ApiRoleState) FlowMessageService(com.sequenceiq.cloudbreak.message.FlowMessageService) Map(java.util.Map) ApiHostTemplate(com.cloudera.api.swagger.model.ApiHostTemplate) ClouderaManagerResourceApi(com.cloudera.api.swagger.ClouderaManagerResourceApi) HostTemplatesResourceApi(com.cloudera.api.swagger.HostTemplatesResourceApi) ApiHostTemplateList(com.cloudera.api.swagger.model.ApiHostTemplateList) NotEnoughNodeException(com.sequenceiq.cloudbreak.cluster.service.NotEnoughNodeException) ApiConfig(com.cloudera.api.swagger.model.ApiConfig) ApiHostsToRemoveArgs(com.cloudera.api.swagger.model.ApiHostsToRemoveArgs) ResourceAttributeUtil(com.sequenceiq.cloudbreak.cluster.util.ResourceAttributeUtil) Collection(java.util.Collection) HostsResourceApi(com.cloudera.api.swagger.HostsResourceApi) Set(java.util.Set) Status(com.sequenceiq.cloudbreak.api.endpoint.v4.common.Status) ExtendedPollingResult(com.sequenceiq.cloudbreak.polling.ExtendedPollingResult) ApiHostNameList(com.cloudera.api.swagger.model.ApiHostNameList) VolumeSetAttributes(com.sequenceiq.cloudbreak.cloud.model.VolumeSetAttributes) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) List(java.util.List) ApiServiceConfig(com.cloudera.api.swagger.model.ApiServiceConfig) Stream(java.util.stream.Stream) ApiHealthSummary(com.cloudera.api.swagger.model.ApiHealthSummary) Optional(java.util.Optional) CancellationException(com.sequenceiq.cloudbreak.cloud.scheduler.CancellationException) Joiner(com.google.common.base.Joiner) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) ApiCommand(com.cloudera.api.swagger.model.ApiCommand) HostServiceStatuses(com.sequenceiq.cloudbreak.cluster.status.HostServiceStatuses) HostServiceStatus(com.sequenceiq.cloudbreak.cluster.status.HostServiceStatus) ApiClient(com.cloudera.api.swagger.client.ApiClient) ApiHostList(com.cloudera.api.swagger.model.ApiHostList) Function(java.util.function.Function) ServicesResourceApi(com.cloudera.api.swagger.ServicesResourceApi) ClouderaManagerPollingServiceProvider(com.sequenceiq.cloudbreak.cm.polling.ClouderaManagerPollingServiceProvider) HashSet(java.util.HashSet) Inject(javax.inject.Inject) ApiHost(com.cloudera.api.swagger.model.ApiHost) RolesResourceApi(com.cloudera.api.swagger.RolesResourceApi) NodeIsBusyException(com.sequenceiq.cloudbreak.cluster.service.NodeIsBusyException) Logger(org.slf4j.Logger) ResourceEvent(com.sequenceiq.cloudbreak.event.ResourceEvent) Consumer(java.util.function.Consumer) HostName.hostName(com.sequenceiq.cloudbreak.cloud.model.HostName.hostName) Component(org.springframework.stereotype.Component) HostGroup(com.sequenceiq.cloudbreak.domain.stack.cluster.host.HostGroup) InstanceMetaData(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData) CommandsResourceApi(com.cloudera.api.swagger.CommandsResourceApi) HostName(com.sequenceiq.cloudbreak.cloud.model.HostName) CloudbreakServiceException(com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException) MgmtServiceResourceApi(com.cloudera.api.swagger.MgmtServiceResourceApi) Comparator(java.util.Comparator) ApiRoleRef(com.cloudera.api.swagger.model.ApiRoleRef) ApiServiceList(com.cloudera.api.swagger.model.ApiServiceList) ClouderaManagerApiFactory(com.sequenceiq.cloudbreak.cm.client.retry.ClouderaManagerApiFactory) StringUtils(org.springframework.util.StringUtils) ApiCommand(com.cloudera.api.swagger.model.ApiCommand) CloudbreakServiceException(com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException) ApiHostNameList(com.cloudera.api.swagger.model.ApiHostNameList) ApiHostList(com.cloudera.api.swagger.model.ApiHostList) CancellationException(com.sequenceiq.cloudbreak.cloud.scheduler.CancellationException) HostsResourceApi(com.cloudera.api.swagger.HostsResourceApi) ClouderaManagerResourceApi(com.cloudera.api.swagger.ClouderaManagerResourceApi) ExtendedPollingResult(com.sequenceiq.cloudbreak.polling.ExtendedPollingResult) HashSet(java.util.HashSet) ApiException(com.cloudera.api.swagger.client.ApiException)

Example 45 with ApiHost

use of com.cloudera.api.swagger.model.ApiHost in project cloudbreak by hortonworks.

the class ClouderaManagerDecomissioner method collectDownscaleCandidates.

public Set<InstanceMetaData> collectDownscaleCandidates(ApiClient client, Stack stack, HostGroup hostGroup, Integer scalingAdjustment, Set<InstanceMetaData> instanceMetaDatasInStack) {
    LOGGER.debug("Collecting downscale candidates");
    Set<InstanceMetaData> instancesForHostGroup = instanceMetaDatasInStack.stream().filter(instanceMetaData -> instanceMetaData.getInstanceGroup().getGroupName().equals(hostGroup.getName())).collect(Collectors.toSet());
    HostsResourceApi hostsResourceApi = clouderaManagerApiFactory.getHostsResourceApi(client);
    try {
        HostTemplatesResourceApi hostTemplatesResourceApi = clouderaManagerApiFactory.getHostTemplatesResourceApi(client);
        ApiHostTemplateList hostTemplates = hostTemplatesResourceApi.readHostTemplates(stack.getName());
        int replication = hostGroupNodesAreDataNodes(hostTemplates, hostGroup.getName()) ? getReplicationFactor(client, stack.getName()) : 0;
        verifyNodeCount(replication, scalingAdjustment, instancesForHostGroup.size(), 0, stack);
        ApiHostList hostRefList = hostsResourceApi.readHosts(null, null, SUMMARY_REQUEST_VIEW);
        Set<InstanceMetaData> instancesToRemove = getUnusedInstances(scalingAdjustment, instancesForHostGroup, hostRefList);
        List<ApiHost> apiHosts = hostRefList.getItems().stream().filter(host -> instancesForHostGroup.stream().filter(instanceMetaData -> instanceMetaData.getDiscoveryFQDN() != null).anyMatch(instanceMetaData -> instanceMetaData.getDiscoveryFQDN().equals(host.getHostname()))).collect(Collectors.toList());
        Set<String> hostsToRemove = apiHosts.stream().sorted(hostHealthComparator).limit(Math.abs(scalingAdjustment) - instancesToRemove.size()).map(ApiHost::getHostname).collect(Collectors.toSet());
        Set<InstanceMetaData> clouderaManagerNodesToRemove = instancesForHostGroup.stream().filter(instanceMetaData -> hostsToRemove.contains(instanceMetaData.getDiscoveryFQDN())).collect(Collectors.toSet());
        instancesToRemove.addAll(clouderaManagerNodesToRemove);
        LOGGER.debug("Downscale candidates: [{}]", instancesToRemove);
        return instancesToRemove;
    } catch (ApiException e) {
        LOGGER.error("Failed to get host list for cluster: {}", stack.getName(), e);
        throw new CloudbreakServiceException(e.getMessage(), e);
    }
}
Also used : LoggerFactory(org.slf4j.LoggerFactory) ApiService(com.cloudera.api.swagger.model.ApiService) ApiRole(com.cloudera.api.swagger.model.ApiRole) ApiException(com.cloudera.api.swagger.client.ApiException) ClustersResourceApi(com.cloudera.api.swagger.ClustersResourceApi) ApiRoleState(com.cloudera.api.swagger.model.ApiRoleState) FlowMessageService(com.sequenceiq.cloudbreak.message.FlowMessageService) Map(java.util.Map) ApiHostTemplate(com.cloudera.api.swagger.model.ApiHostTemplate) ClouderaManagerResourceApi(com.cloudera.api.swagger.ClouderaManagerResourceApi) HostTemplatesResourceApi(com.cloudera.api.swagger.HostTemplatesResourceApi) ApiHostTemplateList(com.cloudera.api.swagger.model.ApiHostTemplateList) NotEnoughNodeException(com.sequenceiq.cloudbreak.cluster.service.NotEnoughNodeException) ApiConfig(com.cloudera.api.swagger.model.ApiConfig) ApiHostsToRemoveArgs(com.cloudera.api.swagger.model.ApiHostsToRemoveArgs) ResourceAttributeUtil(com.sequenceiq.cloudbreak.cluster.util.ResourceAttributeUtil) Collection(java.util.Collection) HostsResourceApi(com.cloudera.api.swagger.HostsResourceApi) Set(java.util.Set) Status(com.sequenceiq.cloudbreak.api.endpoint.v4.common.Status) ExtendedPollingResult(com.sequenceiq.cloudbreak.polling.ExtendedPollingResult) ApiHostNameList(com.cloudera.api.swagger.model.ApiHostNameList) VolumeSetAttributes(com.sequenceiq.cloudbreak.cloud.model.VolumeSetAttributes) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) List(java.util.List) ApiServiceConfig(com.cloudera.api.swagger.model.ApiServiceConfig) Stream(java.util.stream.Stream) ApiHealthSummary(com.cloudera.api.swagger.model.ApiHealthSummary) Optional(java.util.Optional) CancellationException(com.sequenceiq.cloudbreak.cloud.scheduler.CancellationException) Joiner(com.google.common.base.Joiner) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) ApiCommand(com.cloudera.api.swagger.model.ApiCommand) HostServiceStatuses(com.sequenceiq.cloudbreak.cluster.status.HostServiceStatuses) HostServiceStatus(com.sequenceiq.cloudbreak.cluster.status.HostServiceStatus) ApiClient(com.cloudera.api.swagger.client.ApiClient) ApiHostList(com.cloudera.api.swagger.model.ApiHostList) Function(java.util.function.Function) ServicesResourceApi(com.cloudera.api.swagger.ServicesResourceApi) ClouderaManagerPollingServiceProvider(com.sequenceiq.cloudbreak.cm.polling.ClouderaManagerPollingServiceProvider) HashSet(java.util.HashSet) Inject(javax.inject.Inject) ApiHost(com.cloudera.api.swagger.model.ApiHost) RolesResourceApi(com.cloudera.api.swagger.RolesResourceApi) NodeIsBusyException(com.sequenceiq.cloudbreak.cluster.service.NodeIsBusyException) Logger(org.slf4j.Logger) ResourceEvent(com.sequenceiq.cloudbreak.event.ResourceEvent) Consumer(java.util.function.Consumer) HostName.hostName(com.sequenceiq.cloudbreak.cloud.model.HostName.hostName) Component(org.springframework.stereotype.Component) HostGroup(com.sequenceiq.cloudbreak.domain.stack.cluster.host.HostGroup) InstanceMetaData(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData) CommandsResourceApi(com.cloudera.api.swagger.CommandsResourceApi) HostName(com.sequenceiq.cloudbreak.cloud.model.HostName) CloudbreakServiceException(com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException) MgmtServiceResourceApi(com.cloudera.api.swagger.MgmtServiceResourceApi) Comparator(java.util.Comparator) ApiRoleRef(com.cloudera.api.swagger.model.ApiRoleRef) ApiServiceList(com.cloudera.api.swagger.model.ApiServiceList) ClouderaManagerApiFactory(com.sequenceiq.cloudbreak.cm.client.retry.ClouderaManagerApiFactory) StringUtils(org.springframework.util.StringUtils) HostTemplatesResourceApi(com.cloudera.api.swagger.HostTemplatesResourceApi) CloudbreakServiceException(com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException) InstanceMetaData(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData) ApiHostList(com.cloudera.api.swagger.model.ApiHostList) HostsResourceApi(com.cloudera.api.swagger.HostsResourceApi) ApiHostTemplateList(com.cloudera.api.swagger.model.ApiHostTemplateList) ApiHost(com.cloudera.api.swagger.model.ApiHost) ApiException(com.cloudera.api.swagger.client.ApiException)

Aggregations

ApiHost (com.cloudera.api.swagger.model.ApiHost)49 ApiHostList (com.cloudera.api.swagger.model.ApiHostList)30 InstanceMetaData (com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData)26 Test (org.junit.Test)23 HostsResourceApi (com.cloudera.api.swagger.HostsResourceApi)16 ApiException (com.cloudera.api.swagger.client.ApiException)16 List (java.util.List)14 ApiClient (com.cloudera.api.swagger.client.ApiClient)13 Set (java.util.Set)13 Collectors (java.util.stream.Collectors)13 ClouderaManagerApiFactory (com.sequenceiq.cloudbreak.cm.client.retry.ClouderaManagerApiFactory)12 ApiCommand (com.cloudera.api.swagger.model.ApiCommand)11 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)11 HostGroup (com.sequenceiq.cloudbreak.domain.stack.cluster.host.HostGroup)11 ApiHealthSummary (com.cloudera.api.swagger.model.ApiHealthSummary)10 ApiRoleRef (com.cloudera.api.swagger.model.ApiRoleRef)10 ClouderaManagerPollingServiceProvider (com.sequenceiq.cloudbreak.cm.polling.ClouderaManagerPollingServiceProvider)10 Logger (org.slf4j.Logger)10 LoggerFactory (org.slf4j.LoggerFactory)10 ClouderaManagerResourceApi (com.cloudera.api.swagger.ClouderaManagerResourceApi)9