class FixTimelineReaderAddress extends AbstractUpgradeServerAction {

  @Override
  public CommandReport execute(ConcurrentMap<String, Object> requestSharedDataContext) throws AmbariException, InterruptedException {
    Cluster cluster = getClusters().getCluster(getExecutionCommand().getClusterName());
    List<String> updatedHosts = new ArrayList<>();
    try {
      for (String propertyName : HOST_PROPERTIES) {
        Config config = cluster.getDesiredConfigByType(YARN_SITE);
        if (config == null) {
          continue;
        }
        String oldHost = config.getProperties().get(propertyName);
        if (oldHost == null) {
          continue;
        }
        String newHost = replace(oldHost, hostNameOf(cluster, "YARN", TIMELINE_READER), defaultPort(propertyName));
        updatedHosts.add(newHost);
        updateConfig(cluster, propertyName, newHost, config);
      }
      return commandReport(String.format("Updated %s hosts to: %s", TIMELINE_READER, join(updatedHosts, ", ")));
    } catch (ObjectNotFoundException e) {
      return commandReport("Skipping " + this.getClass().getSimpleName() + ". Reason: " + e.getMessage());
    }
  }

}