Search in sources :

Example 1 with EngineVO

use of com.dtstack.taier.develop.vo.console.EngineVO in project Taier by DTStack.

the class ConsoleClusterService method fillEngineQueueInfo.

private ClusterEngineVO fillEngineQueueInfo(Map<Long, Set<MultiEngineType>> clusterEngineMapping, Map<Long, List<Queue>> engineQueueMapping, Cluster cluster) {
    ClusterEngineVO vo = ClusterEngineVO.toVO(cluster);
    Set<MultiEngineType> engineList = clusterEngineMapping.get(vo.getClusterId());
    if (CollectionUtils.isNotEmpty(engineList)) {
        List<EngineVO> engineVOS = new ArrayList<>();
        for (MultiEngineType multiEngineType : engineList) {
            EngineVO engineVO = new EngineVO();
            engineVO.setEngineType(multiEngineType.getType());
            engineVO.setEngineName(multiEngineType.getName());
            engineVO.setClusterId(cluster.getId());
            if (MultiEngineType.HADOOP.equals(multiEngineType)) {
                engineVO.setQueues(QueueVO.toVOs(engineQueueMapping.get(cluster.getId())));
            }
            engineVOS.add(engineVO);
        }
        engineVOS.sort(Comparator.comparingInt(EngineVO::getEngineType));
        vo.setEngines(engineVOS);
    }
    return vo;
}
Also used : MultiEngineType(com.dtstack.taier.common.enums.MultiEngineType) ClusterEngineVO(com.dtstack.taier.develop.vo.console.ClusterEngineVO) EngineVO(com.dtstack.taier.develop.vo.console.EngineVO) ClusterEngineVO(com.dtstack.taier.develop.vo.console.ClusterEngineVO)

Aggregations

MultiEngineType (com.dtstack.taier.common.enums.MultiEngineType)1 ClusterEngineVO (com.dtstack.taier.develop.vo.console.ClusterEngineVO)1 EngineVO (com.dtstack.taier.develop.vo.console.EngineVO)1