private Map<String, Host> getHostsMap(Collection<String> hostSet) throws
      HostNotFoundException {

    Map<String, Host> hostMap = new HashMap<>();
    Host host = null;
    for (String hostName : hostSet) {
      if (null != hostName) {
          host= getHostsByName().get(hostName);
        if (host == null) {
          throw new HostNotFoundException(hostName);
        }
      } else {
        throw new HostNotFoundException(hostName);
      }

      hostMap.put(hostName, host);
    }

    return hostMap;
  }
Register a host by creating a {@link HostEntity} object in the database and setting its state to
{@link HostState#INIT}. This does not add the host the cluster.
@param hostname Host to be added
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java