private String translateHostName(String hostName) {
    // if the hostname in the command is null, replace it with the hostname of the Ambari Server
    // This is because commands (to be) handled by the Ambari Server have a null value for its
    // host designation.
    return (StringUtils.isEmpty(hostName))
        ? StageUtils.getHostName()
        : hostName;
  }
If the hostname is null (or empty), returns the hostname of the Ambari Server; else returns the
supplied hostname value.

@param hostName a hostname
@return the hostname of the Ambari Server if the hostname is null (or empty); else supplied hostname value
ambari-server/src/main/java/org/apache/ambari/server/controller/ShortTaskStatus.java