ClouderaManagerImpl extends AbstractSoftwareManager implements SoftwareManager { @Override public boolean onDeleteNodes(ClusterBlueprint blueprint, List<String> nodeNames) throws SoftwareManagementPluginException { CmClusterDef clusterDef = null; try { clusterDef = new CmClusterDef(blueprint); syncHostsId(clusterDef); List<ApiHost> hosts = new ArrayList<>(); for (CmNodeDef nodeDef : clusterDef.getNodes()) { if (nodeNames.contains(nodeDef.getName()) && !nodeDef.getName().equals(nodeDef.getNodeId())) { try { ApiHost host = apiResourceRootV6.getHostsResource().readHost(nodeDef.getNodeId()); if (host != null) { hosts.add(host); } } catch (NotFoundException e) { logger.debug("Host " + nodeDef.getNodeId() + " is not found from Cloudera Manager."); continue; } } } removeHosts(clusterDef, hosts); clusterDef.getCurrentReport().setProgress(100); clusterDef.getCurrentReport().setAction(""); } catch (Exception e) { logger.error("Failed to remove hosts " + nodeNames, e); } return true; } ClouderaManagerImpl();  ClouderaManagerImpl(String cmServerHost, int port, String user,
         String password, String privateKey);  ClouderaManagerImpl(URL url, String user, String password,
         String privateKey); RootResourceV6 getApiResourceRootV6(); @Override boolean validateServerVersion(); @Override String getName(); @Override String getDescription(); @Override String getType(); @Override List<HadoopStack> getSupportedStacks(); @Override String getSupportedConfigs(HadoopStack hadoopStack); @Override boolean validateBlueprint(ClusterBlueprint blueprint); @Override boolean createCluster(ClusterBlueprint blueprint,
         ClusterReportQueue reportQueue); @Override /** * @TODO better use a event-listener mode to decouple the reportQueue. lixl */ boolean reconfigCluster(ClusterBlueprint blueprint,
         ClusterReportQueue reportQueue); @Override boolean scaleOutCluster(ClusterBlueprint blueprint, List<String> addedNodeNames,
         ClusterReportQueue reportQueue, boolean forceScaleOut); @Override boolean deleteCluster(ClusterBlueprint clusterBlueprint,
         ClusterReportQueue reports); @Override boolean onStopCluster(ClusterBlueprint clusterBlueprint,
         ClusterReportQueue reportQueue); @Override boolean onDeleteCluster(ClusterBlueprint clusterBlueprint,
         ClusterReportQueue reports); @Override boolean onDeleteNodes(ClusterBlueprint blueprint, List<String> nodeNames); @Override boolean decomissionNodes(String clusterName, List<NodeInfo> nodes,
         ClusterReportQueue reports); @Override void decommissionNode(ClusterBlueprint blueprint, String nodeGroupName, String nodeName, ClusterReportQueue reportQueue); @Override boolean recomissionNode(String clusterName, NodeInfo node, ClusterReportQueue reportQueue); @Override boolean comissionNodes(String clusterName, List<NodeInfo> nodes,
         ClusterReportQueue reports); @Override boolean startNodes(String clusterName, List<NodeInfo> nodes,
         ClusterReportQueue reports); @Override boolean stopNodes(String clusterName, List<NodeInfo> nodes,
         ClusterReportQueue reports); @Override String exportBlueprint(String clusterName); @Override ClusterReport queryClusterStatus(ClusterBlueprint blueprint); @Override boolean echo(); @Override HealthStatus getStatus(); boolean startCluster(ClusterBlueprint clusterBlueprint, ClusterReportQueue reportQueue); @Override boolean startCluster(ClusterBlueprint clusterBlueprint, ClusterReportQueue reportQueue, boolean forceStart); String getCmServerHostId(); @Override List<String> validateRolesForScaleOut(NodeGroupInfo group); void validateRolesForShrink(NodeGroupInfo groupInfo); @Override void updateInfrastructure(ClusterBlueprint blueprint); @Override boolean hasHbase(ClusterBlueprint blueprint); @Override boolean hasMgmtRole(List<String> roles); @Override boolean isComputeOnlyRoles(List<String> roles); @Override boolean twoDataDisksRequired(NodeGroupInfo group); @Override boolean hasComputeMasterGroup(ClusterBlueprint blueprint); @Override String getVersion(); @Override HadoopStack getDefaultStack(); @Override boolean hasMountPointStartwithDatax(String clusterName); @Override void restartClusterRequiredServices(ClusterBlueprint blueprint,
         ClusterReportQueue reports); final String MIN_SUPPORTED_VERSION; }
@Test ( groups = {"TestClouderaManagerImpl"}, dependsOnMethods = { "testStartStoppedCluster" } ) public void testOnDeleteNodes() { List<String> nodeNames = new ArrayList<>(); List<NodeGroupInfo> nodeGroupInfos = blueprint.getNodeGroups(); for (NodeGroupInfo info : nodeGroupInfos) { List<NodeInfo> nodeInfos = info.getNodes(); for (NodeInfo nodeInfo : nodeInfos) { if (!CommonUtil.isBlank(nodeInfo.getName())) { nodeNames.add(nodeInfo.getName()); } } } Assert.assertTrue(!nodeNames.isEmpty()); Assert.assertTrue(provider.onDeleteNodes(blueprint, nodeNames)); }