use of com.dtstack.taier.develop.vo.console.ClusterVO in project Taier by DTStack.
the class ConsoleClusterService method getConsoleClusterInfo.
/**
* 获取集群信息详情 需要根据组件分组
*
* @param clusterId
* @return
*/
public ClusterVO getConsoleClusterInfo(Long clusterId) {
Cluster cluster = clusterMapper.getOne(clusterId);
if (null == cluster) {
return new ClusterVO();
}
ClusterVO clusterVO = ClusterVO.toVO(cluster);
// 查询默认版本或者多个版本
List<com.dtstack.taier.dao.domain.Component> components = componentMapper.listByClusterId(clusterId, null, false);
List<IComponentVO> componentConfigs = componentConfigService.getComponentVoByComponent(components, true, clusterId, true, true);
Table<Integer, String, KerberosConfig> kerberosTable = null;
// kerberos的配置
kerberosTable = HashBasedTable.create();
for (KerberosConfig kerberosConfig : consoleKerberosMapper.getByClusters(clusterId)) {
kerberosTable.put(kerberosConfig.getComponentType(), StringUtils.isBlank(kerberosConfig.getComponentVersion()) ? StringUtils.EMPTY : kerberosConfig.getComponentVersion(), kerberosConfig);
}
Map<EComponentScheduleType, List<IComponentVO>> scheduleType = new HashMap<>(4);
// 组件根据用途分组(计算,资源)
if (CollectionUtils.isNotEmpty(componentConfigs)) {
scheduleType = componentConfigs.stream().collect(Collectors.groupingBy(c -> EComponentType.getScheduleTypeByComponent(c.getComponentTypeCode())));
}
List<SchedulingVo> schedulingVos = convertComponentToScheduling(kerberosTable, scheduleType);
clusterVO.setScheduling(schedulingVos);
clusterVO.setCanModifyMetadata(checkMetadata(clusterId, components));
return clusterVO;
}
Aggregations