class UpgradeCatalog260 extends AbstractUpgradeCatalog {

  protected void updateHiveConfigs() throws AmbariException {
    AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class);
    Clusters clusters = ambariManagementController.getClusters();
    if (clusters != null) {
      Map<String, Cluster> clusterMap = getCheckedClusterMap(clusters);
      if (clusterMap != null && !clusterMap.isEmpty()) {
        for (final Cluster cluster : clusterMap.values()) {
          // Updating YARN->NodeManager kerebros descriptor : (1). 'llap_zk_hive' and (2). 'llap_task_hive''s associated configs
          // hive-interactive-site/hive.llap.zk.sm.keytab.file and hive-interactive-site/hive.llap.task.keytab.file respectively,
          // based on what hive-interactive-site/hive.llap.daemon.keytab.file has.
          Config hsiSiteConfig = cluster.getDesiredConfigByType(HIVE_INTERACTIVE_SITE);
          if (hsiSiteConfig != null) {
            Map<String, String> hsiSiteConfigProperties = hsiSiteConfig.getProperties();
            if (hsiSiteConfigProperties != null &&
                    hsiSiteConfigProperties.containsKey(HIVE_LLAP_DAEMON_KEYTAB_FILE)) {
              String[] identities = {HIVE_LLAP_ZK_SM_KEYTAB_FILE, HIVE_LLAP_TASK_KEYTAB_FILE};
              Map<String, String> newProperties = new HashMap<>();
              for (String identity : identities) {
                // Update only if we were able to modify the corresponding kerberos descriptor,
                // reflected in list 'getYarnKerberosDescUpdatedList'.
                if (getYarnKerberosDescUpdatedList().contains(identity) && hsiSiteConfigProperties.containsKey(identity)) {
                  newProperties.put(identity, hsiSiteConfigProperties.get(HIVE_LLAP_DAEMON_KEYTAB_FILE));
                }
              }

              // Update step.
              if (newProperties.size() > 0) {
                try {
                  updateConfigurationPropertiesForCluster(cluster, HIVE_INTERACTIVE_SITE, newProperties, true, false);
                  LOG.info("Updated HSI config(s) : " + newProperties.keySet() + " with value(s) = " + newProperties.values() + " respectively.");
                } catch (AmbariException e) {
                  e.printStackTrace();
                }
              }
            }
          }
        }
      }
    }
  }

  @Inject public  UpgradeCatalog260(Injector injector);

}