@Override
  public Set<String> getServiceComponentsHosts() {
    Set<String> serviceComponentsHosts = new HashSet<>();
    for (ServiceComponentHost serviceComponentHost : getServiceComponentHosts().values()) {
      serviceComponentsHosts.add(serviceComponentHost.getHostName());
    }
    return serviceComponentsHosts;
  }
Set the recoveryEnabled field in the entity object.

@param recoveryEnabled - true or false
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java