use of com.cloudera.api.model.ApiServiceList in project components by Talend.
the class HadoopCMCluster method getHostedServices.
@Override
public Map<HadoopHostedService, HadoopClusterService> getHostedServices() {
ApiServiceList services = cluster.readServices(DataView.SUMMARY);
Map<HadoopHostedService, HadoopClusterService> servicesMapping = new HashMap<HadoopHostedService, HadoopClusterService>();
for (ApiService service : services.getServices()) {
if (HadoopHostedService.isSupport(service.getType())) {
HadoopCMClusterService clusterService = new HadoopCMClusterService(service.getName(), cluster, blacklistParams);
if (clusterService.hasConfigurations()) {
servicesMapping.put(HadoopHostedService.fromString(service.getType()), clusterService);
}
}
}
return servicesMapping;
}
use of com.cloudera.api.model.ApiServiceList in project kylo by Teradata.
the class DefaultClouderaRootResource method getPopulatedClusterList.
/**
* @return cluster list with initialised service health status
*/
public ApiClusterList getPopulatedClusterList() {
ApiClusterList clusters = rootResource.getClustersResource().readClusters(DataView.SUMMARY);
if (clusters != null && clusters.getClusters() != null) {
for (ApiCluster cluster : clusters.getClusters()) {
String clusterName = cluster.getName();
ApiServiceList services = rootResource.getClustersResource().getServicesResource(clusterName).readServices(DataView.SUMMARY);
if (services != null && services.getServices() != null) {
cluster.setServices(services.getServices());
for (ApiService service : services.getServices()) {
String serviceName = service.getName();
ApiHealthSummary healthSummary = service.getHealthSummary();
List<ApiHealthCheck> healthChecks = service.getHealthChecks();
service.setHealthChecks(healthChecks);
service.setHealthSummary(healthSummary);
ApiRoleList roles = rootResource.getClustersResource().getServicesResource(clusterName).getRolesResource(serviceName).readRoles();
if (roles != null && roles.getRoles() != null) {
service.setRoles(roles.getRoles());
for (ApiRole role : roles.getRoles()) {
ApiHealthSummary roleHealthSummary = role.getHealthSummary();
List<ApiHealthCheck> roleHealthChecks = role.getHealthChecks();
role.setHealthSummary(roleHealthSummary);
role.setHealthChecks(roleHealthChecks);
}
}
}
}
}
}
return clusters;
}
Aggregations