private Set<String> calculateDecommissionedNodes(Service service, String slaveCompType) throws AmbariException {
    Set<String> decommissionedHostsSet = new HashSet<>();
    ServiceComponent serviceComponent = service.getServiceComponent(slaveCompType);
    for (ServiceComponentHost serviceComponentHost : serviceComponent.getServiceComponentHosts().values()) {
      if (serviceComponentHost.getComponentAdminState() == HostComponentAdminState.DECOMMISSIONED) {
        decommissionedHostsSet.add(serviceComponentHost.getHostName());
      }
    }
    return decommissionedHostsSet;
  }
Processes decommission command. Modifies the host components as needed and then
calls into the implementation of a custom command
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java