@Test public void testAmsEnvUpdateConfigs() throws Exception { Map<String, String> oldPropertiesAmsEnv = new HashMap<String, String>() { { put("content", "\n" + "# AMS Collector heapsize\n" + "export AMS_COLLECTOR_HEAPSIZE={{metrics_collector_heapsize}}\n" + "\n" + "# HBase normalizer enabled\n" + "export AMS_HBASE_NORMALIZER_ENABLED={{ams_hbase_normalizer_enabled}}\n" + "\n" + "# HBase compaction policy enabled\n" + "export HBASE_FIFO_COMPACTION_POLICY_ENABLED={{ams_hbase_fifo_compaction_policy_enabled}}\n" + "\n" + "# HBase Tables Initialization check enabled\n" + "export AMS_HBASE_INIT_CHECK_ENABLED={{ams_hbase_init_check_enabled}}\n"); } }; Map<String, String> newPropertiesAmsEnv = new HashMap<String, String>() { { put("content", "\n" + "# AMS Collector heapsize\n" + "export AMS_COLLECTOR_HEAPSIZE={{metrics_collector_heapsize}}\n" + "\n" + "# HBase Tables Initialization check enabled\n" + "export AMS_HBASE_INIT_CHECK_ENABLED={{ams_hbase_init_check_enabled}}\n"); } }; EasyMockSupport easyMockSupport = new EasyMockSupport(); Config mockAmsEnv = easyMockSupport.createNiceMock(Config.class); reset(clusters, cluster); expect(clusters.getClusters()).andReturn(new HashMap<String, Cluster>() {{ put("normal", cluster); }}).once(); expect(cluster.getDesiredConfigByType("ams-env")).andReturn(mockAmsEnv).atLeastOnce(); expect(mockAmsEnv.getProperties()).andReturn(oldPropertiesAmsEnv).anyTimes(); replay(clusters, mockAmsEnv, cluster); AmbariManagementControllerImpl controller = createMockBuilder(AmbariManagementControllerImpl.class) .addMockedMethod("createConfiguration") .addMockedMethod("getClusters", new Class[]{}) .addMockedMethod("createConfig") .withConstructor(actionManager, clusters, injector) .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); Capture<Map<String, String>> propertiesCapture = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(), EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(config).once(); replay(controller, injector2); new UpgradeCatalog250(injector2).updateAMSConfigs(); easyMockSupport.verifyAll(); Map<String, String> updatedProperties = propertiesCapture.getValue(); assertTrue(Maps.difference(newPropertiesAmsEnv, updatedProperties).areEqual()); }
protected void updateAMSConfigs() throws AmbariException { AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class); Clusters clusters = ambariManagementController.getClusters(); if (clusters != null) { Map<String, Cluster> clusterMap = clusters.getClusters(); if (clusterMap != null && !clusterMap.isEmpty()) { for (final Cluster cluster : clusterMap.values()) { Config amsEnv = cluster.getDesiredConfigByType(AMS_ENV); if (amsEnv != null) { Map<String, String> amsEnvProperties = amsEnv.getProperties(); String content = amsEnvProperties.get("content"); Map<String, String> newProperties = new HashMap<>(); newProperties.put("content", updateAmsEnvContent(content)); updateConfigurationPropertiesForCluster(cluster, AMS_ENV, newProperties, true, true); } boolean isDistributed = false; Config amsSite = cluster.getDesiredConfigByType(AMS_SITE); if (amsSite != null) { if ("distributed".equals(amsSite.getProperties().get(AMS_MODE))) { isDistributed = true; } Map<String, String> amsSiteProperties = amsSite.getProperties(); if (amsSiteProperties != null && amsSiteProperties.containsKey("timeline.metrics.hbase.fifo.compaction.enabled")) { LOG.info("Removing timeline.metrics.hbase.fifo.compaction.enabled from ams-site"); removeConfigurationPropertiesFromCluster(cluster, AMS_SITE, Collections.singleton("timeline.metrics.hbase.fifo.compaction.enabled")); } } if (isDistributed) { Config amsHbaseSite = cluster.getDesiredConfigByType(AMS_HBASE_SITE); if (amsHbaseSite != null) { Map<String, String> amsHbaseSiteProperties = amsHbaseSite.getProperties(); String rootDir = amsHbaseSiteProperties.get(HBASE_ROOTDIR); if (StringUtils.isNotEmpty(rootDir) && rootDir.startsWith("hdfs: int indexOfSlash = rootDir.indexOf("/", 7); Map<String, String> newProperties = new HashMap<>(); String newRootdir = rootDir.substring(indexOfSlash); newProperties.put(HBASE_ROOTDIR, newRootdir); LOG.info("Changing ams-hbase-site rootdir to " + newRootdir); updateConfigurationPropertiesForCluster(cluster, AMS_HBASE_SITE, newProperties, true, true); } } } Config amsLog4jProperties = cluster.getDesiredConfigByType(AMS_LOG4J); if(amsLog4jProperties != null){ Map<String, String> newProperties = new HashMap<>(); String content = amsLog4jProperties.getProperties().get("content"); content = SchemaUpgradeUtil.extractProperty(content,"ams_log_max_backup_size","ams_log_max_backup_size","log4j.appender.file.MaxFileSize=(\\w+)MB","80",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_log_number_of_backup_files","ams_log_number_of_backup_files","log4j.appender.file.MaxBackupIndex=(\\w+)","60",newProperties); newProperties.put("content",content); updateConfigurationPropertiesForCluster(cluster,AMS_LOG4J,newProperties,true,true); } Config amsHbaseLog4jProperties = cluster.getDesiredConfigByType(AMS_HBASE_LOG4J); if(amsHbaseLog4jProperties != null){ Map<String, String> newProperties = new HashMap<>(); String content = amsHbaseLog4jProperties.getProperties().get("content"); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_log_maxfilesize","ams_hbase_log_maxfilesize","hbase.log.maxfilesize=(\\w+)MB","256",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_log_maxbackupindex","ams_hbase_log_maxbackupindex","hbase.log.maxbackupindex=(\\w+)","20",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_security_log_maxfilesize","ams_hbase_security_log_maxfilesize","hbase.security.log.maxfilesize=(\\w+)MB","256",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_security_log_maxbackupindex","ams_hbase_security_log_maxbackupindex","hbase.security.log.maxbackupindex=(\\w+)","20",newProperties); newProperties.put("content",content); updateConfigurationPropertiesForCluster(cluster,AMS_HBASE_LOG4J,newProperties,true,true); } Config amsGrafanaIni = cluster.getDesiredConfigByType(AMS_GRAFANA_INI); if (amsGrafanaIni != null) { Map<String, String> amsGrafanaIniProperties = amsGrafanaIni.getProperties(); String content = amsGrafanaIniProperties.get("content"); Map<String, String> newProperties = new HashMap<>(); newProperties.put("content", updateAmsGrafanaIniContent(content)); updateConfigurationPropertiesForCluster(cluster, AMS_GRAFANA_INI, newProperties, true, true); } } } } }
UpgradeCatalog250 extends AbstractUpgradeCatalog { protected void updateAMSConfigs() throws AmbariException { AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class); Clusters clusters = ambariManagementController.getClusters(); if (clusters != null) { Map<String, Cluster> clusterMap = clusters.getClusters(); if (clusterMap != null && !clusterMap.isEmpty()) { for (final Cluster cluster : clusterMap.values()) { Config amsEnv = cluster.getDesiredConfigByType(AMS_ENV); if (amsEnv != null) { Map<String, String> amsEnvProperties = amsEnv.getProperties(); String content = amsEnvProperties.get("content"); Map<String, String> newProperties = new HashMap<>(); newProperties.put("content", updateAmsEnvContent(content)); updateConfigurationPropertiesForCluster(cluster, AMS_ENV, newProperties, true, true); } boolean isDistributed = false; Config amsSite = cluster.getDesiredConfigByType(AMS_SITE); if (amsSite != null) { if ("distributed".equals(amsSite.getProperties().get(AMS_MODE))) { isDistributed = true; } Map<String, String> amsSiteProperties = amsSite.getProperties(); if (amsSiteProperties != null && amsSiteProperties.containsKey("timeline.metrics.hbase.fifo.compaction.enabled")) { LOG.info("Removing timeline.metrics.hbase.fifo.compaction.enabled from ams-site"); removeConfigurationPropertiesFromCluster(cluster, AMS_SITE, Collections.singleton("timeline.metrics.hbase.fifo.compaction.enabled")); } } if (isDistributed) { Config amsHbaseSite = cluster.getDesiredConfigByType(AMS_HBASE_SITE); if (amsHbaseSite != null) { Map<String, String> amsHbaseSiteProperties = amsHbaseSite.getProperties(); String rootDir = amsHbaseSiteProperties.get(HBASE_ROOTDIR); if (StringUtils.isNotEmpty(rootDir) && rootDir.startsWith("hdfs: int indexOfSlash = rootDir.indexOf("/", 7); Map<String, String> newProperties = new HashMap<>(); String newRootdir = rootDir.substring(indexOfSlash); newProperties.put(HBASE_ROOTDIR, newRootdir); LOG.info("Changing ams-hbase-site rootdir to " + newRootdir); updateConfigurationPropertiesForCluster(cluster, AMS_HBASE_SITE, newProperties, true, true); } } } Config amsLog4jProperties = cluster.getDesiredConfigByType(AMS_LOG4J); if(amsLog4jProperties != null){ Map<String, String> newProperties = new HashMap<>(); String content = amsLog4jProperties.getProperties().get("content"); content = SchemaUpgradeUtil.extractProperty(content,"ams_log_max_backup_size","ams_log_max_backup_size","log4j.appender.file.MaxFileSize=(\\w+)MB","80",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_log_number_of_backup_files","ams_log_number_of_backup_files","log4j.appender.file.MaxBackupIndex=(\\w+)","60",newProperties); newProperties.put("content",content); updateConfigurationPropertiesForCluster(cluster,AMS_LOG4J,newProperties,true,true); } Config amsHbaseLog4jProperties = cluster.getDesiredConfigByType(AMS_HBASE_LOG4J); if(amsHbaseLog4jProperties != null){ Map<String, String> newProperties = new HashMap<>(); String content = amsHbaseLog4jProperties.getProperties().get("content"); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_log_maxfilesize","ams_hbase_log_maxfilesize","hbase.log.maxfilesize=(\\w+)MB","256",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_log_maxbackupindex","ams_hbase_log_maxbackupindex","hbase.log.maxbackupindex=(\\w+)","20",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_security_log_maxfilesize","ams_hbase_security_log_maxfilesize","hbase.security.log.maxfilesize=(\\w+)MB","256",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_security_log_maxbackupindex","ams_hbase_security_log_maxbackupindex","hbase.security.log.maxbackupindex=(\\w+)","20",newProperties); newProperties.put("content",content); updateConfigurationPropertiesForCluster(cluster,AMS_HBASE_LOG4J,newProperties,true,true); } Config amsGrafanaIni = cluster.getDesiredConfigByType(AMS_GRAFANA_INI); if (amsGrafanaIni != null) { Map<String, String> amsGrafanaIniProperties = amsGrafanaIni.getProperties(); String content = amsGrafanaIniProperties.get("content"); Map<String, String> newProperties = new HashMap<>(); newProperties.put("content", updateAmsGrafanaIniContent(content)); updateConfigurationPropertiesForCluster(cluster, AMS_GRAFANA_INI, newProperties, true, true); } } } } } }
UpgradeCatalog250 extends AbstractUpgradeCatalog { protected void updateAMSConfigs() throws AmbariException { AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class); Clusters clusters = ambariManagementController.getClusters(); if (clusters != null) { Map<String, Cluster> clusterMap = clusters.getClusters(); if (clusterMap != null && !clusterMap.isEmpty()) { for (final Cluster cluster : clusterMap.values()) { Config amsEnv = cluster.getDesiredConfigByType(AMS_ENV); if (amsEnv != null) { Map<String, String> amsEnvProperties = amsEnv.getProperties(); String content = amsEnvProperties.get("content"); Map<String, String> newProperties = new HashMap<>(); newProperties.put("content", updateAmsEnvContent(content)); updateConfigurationPropertiesForCluster(cluster, AMS_ENV, newProperties, true, true); } boolean isDistributed = false; Config amsSite = cluster.getDesiredConfigByType(AMS_SITE); if (amsSite != null) { if ("distributed".equals(amsSite.getProperties().get(AMS_MODE))) { isDistributed = true; } Map<String, String> amsSiteProperties = amsSite.getProperties(); if (amsSiteProperties != null && amsSiteProperties.containsKey("timeline.metrics.hbase.fifo.compaction.enabled")) { LOG.info("Removing timeline.metrics.hbase.fifo.compaction.enabled from ams-site"); removeConfigurationPropertiesFromCluster(cluster, AMS_SITE, Collections.singleton("timeline.metrics.hbase.fifo.compaction.enabled")); } } if (isDistributed) { Config amsHbaseSite = cluster.getDesiredConfigByType(AMS_HBASE_SITE); if (amsHbaseSite != null) { Map<String, String> amsHbaseSiteProperties = amsHbaseSite.getProperties(); String rootDir = amsHbaseSiteProperties.get(HBASE_ROOTDIR); if (StringUtils.isNotEmpty(rootDir) && rootDir.startsWith("hdfs: int indexOfSlash = rootDir.indexOf("/", 7); Map<String, String> newProperties = new HashMap<>(); String newRootdir = rootDir.substring(indexOfSlash); newProperties.put(HBASE_ROOTDIR, newRootdir); LOG.info("Changing ams-hbase-site rootdir to " + newRootdir); updateConfigurationPropertiesForCluster(cluster, AMS_HBASE_SITE, newProperties, true, true); } } } Config amsLog4jProperties = cluster.getDesiredConfigByType(AMS_LOG4J); if(amsLog4jProperties != null){ Map<String, String> newProperties = new HashMap<>(); String content = amsLog4jProperties.getProperties().get("content"); content = SchemaUpgradeUtil.extractProperty(content,"ams_log_max_backup_size","ams_log_max_backup_size","log4j.appender.file.MaxFileSize=(\\w+)MB","80",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_log_number_of_backup_files","ams_log_number_of_backup_files","log4j.appender.file.MaxBackupIndex=(\\w+)","60",newProperties); newProperties.put("content",content); updateConfigurationPropertiesForCluster(cluster,AMS_LOG4J,newProperties,true,true); } Config amsHbaseLog4jProperties = cluster.getDesiredConfigByType(AMS_HBASE_LOG4J); if(amsHbaseLog4jProperties != null){ Map<String, String> newProperties = new HashMap<>(); String content = amsHbaseLog4jProperties.getProperties().get("content"); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_log_maxfilesize","ams_hbase_log_maxfilesize","hbase.log.maxfilesize=(\\w+)MB","256",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_log_maxbackupindex","ams_hbase_log_maxbackupindex","hbase.log.maxbackupindex=(\\w+)","20",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_security_log_maxfilesize","ams_hbase_security_log_maxfilesize","hbase.security.log.maxfilesize=(\\w+)MB","256",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_security_log_maxbackupindex","ams_hbase_security_log_maxbackupindex","hbase.security.log.maxbackupindex=(\\w+)","20",newProperties); newProperties.put("content",content); updateConfigurationPropertiesForCluster(cluster,AMS_HBASE_LOG4J,newProperties,true,true); } Config amsGrafanaIni = cluster.getDesiredConfigByType(AMS_GRAFANA_INI); if (amsGrafanaIni != null) { Map<String, String> amsGrafanaIniProperties = amsGrafanaIni.getProperties(); String content = amsGrafanaIniProperties.get("content"); Map<String, String> newProperties = new HashMap<>(); newProperties.put("content", updateAmsGrafanaIniContent(content)); updateConfigurationPropertiesForCluster(cluster, AMS_GRAFANA_INI, newProperties, true, true); } } } } } @Inject  UpgradeCatalog250(Injector injector); }
UpgradeCatalog250 extends AbstractUpgradeCatalog { protected void updateAMSConfigs() throws AmbariException { AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class); Clusters clusters = ambariManagementController.getClusters(); if (clusters != null) { Map<String, Cluster> clusterMap = clusters.getClusters(); if (clusterMap != null && !clusterMap.isEmpty()) { for (final Cluster cluster : clusterMap.values()) { Config amsEnv = cluster.getDesiredConfigByType(AMS_ENV); if (amsEnv != null) { Map<String, String> amsEnvProperties = amsEnv.getProperties(); String content = amsEnvProperties.get("content"); Map<String, String> newProperties = new HashMap<>(); newProperties.put("content", updateAmsEnvContent(content)); updateConfigurationPropertiesForCluster(cluster, AMS_ENV, newProperties, true, true); } boolean isDistributed = false; Config amsSite = cluster.getDesiredConfigByType(AMS_SITE); if (amsSite != null) { if ("distributed".equals(amsSite.getProperties().get(AMS_MODE))) { isDistributed = true; } Map<String, String> amsSiteProperties = amsSite.getProperties(); if (amsSiteProperties != null && amsSiteProperties.containsKey("timeline.metrics.hbase.fifo.compaction.enabled")) { LOG.info("Removing timeline.metrics.hbase.fifo.compaction.enabled from ams-site"); removeConfigurationPropertiesFromCluster(cluster, AMS_SITE, Collections.singleton("timeline.metrics.hbase.fifo.compaction.enabled")); } } if (isDistributed) { Config amsHbaseSite = cluster.getDesiredConfigByType(AMS_HBASE_SITE); if (amsHbaseSite != null) { Map<String, String> amsHbaseSiteProperties = amsHbaseSite.getProperties(); String rootDir = amsHbaseSiteProperties.get(HBASE_ROOTDIR); if (StringUtils.isNotEmpty(rootDir) && rootDir.startsWith("hdfs: int indexOfSlash = rootDir.indexOf("/", 7); Map<String, String> newProperties = new HashMap<>(); String newRootdir = rootDir.substring(indexOfSlash); newProperties.put(HBASE_ROOTDIR, newRootdir); LOG.info("Changing ams-hbase-site rootdir to " + newRootdir); updateConfigurationPropertiesForCluster(cluster, AMS_HBASE_SITE, newProperties, true, true); } } } Config amsLog4jProperties = cluster.getDesiredConfigByType(AMS_LOG4J); if(amsLog4jProperties != null){ Map<String, String> newProperties = new HashMap<>(); String content = amsLog4jProperties.getProperties().get("content"); content = SchemaUpgradeUtil.extractProperty(content,"ams_log_max_backup_size","ams_log_max_backup_size","log4j.appender.file.MaxFileSize=(\\w+)MB","80",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_log_number_of_backup_files","ams_log_number_of_backup_files","log4j.appender.file.MaxBackupIndex=(\\w+)","60",newProperties); newProperties.put("content",content); updateConfigurationPropertiesForCluster(cluster,AMS_LOG4J,newProperties,true,true); } Config amsHbaseLog4jProperties = cluster.getDesiredConfigByType(AMS_HBASE_LOG4J); if(amsHbaseLog4jProperties != null){ Map<String, String> newProperties = new HashMap<>(); String content = amsHbaseLog4jProperties.getProperties().get("content"); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_log_maxfilesize","ams_hbase_log_maxfilesize","hbase.log.maxfilesize=(\\w+)MB","256",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_log_maxbackupindex","ams_hbase_log_maxbackupindex","hbase.log.maxbackupindex=(\\w+)","20",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_security_log_maxfilesize","ams_hbase_security_log_maxfilesize","hbase.security.log.maxfilesize=(\\w+)MB","256",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_security_log_maxbackupindex","ams_hbase_security_log_maxbackupindex","hbase.security.log.maxbackupindex=(\\w+)","20",newProperties); newProperties.put("content",content); updateConfigurationPropertiesForCluster(cluster,AMS_HBASE_LOG4J,newProperties,true,true); } Config amsGrafanaIni = cluster.getDesiredConfigByType(AMS_GRAFANA_INI); if (amsGrafanaIni != null) { Map<String, String> amsGrafanaIniProperties = amsGrafanaIni.getProperties(); String content = amsGrafanaIniProperties.get("content"); Map<String, String> newProperties = new HashMap<>(); newProperties.put("content", updateAmsGrafanaIniContent(content)); updateConfigurationPropertiesForCluster(cluster, AMS_GRAFANA_INI, newProperties, true, true); } } } } } @Inject  UpgradeCatalog250(Injector injector); @Override String getTargetVersion(); @Override String getSourceVersion(); }
UpgradeCatalog250 extends AbstractUpgradeCatalog { protected void updateAMSConfigs() throws AmbariException { AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class); Clusters clusters = ambariManagementController.getClusters(); if (clusters != null) { Map<String, Cluster> clusterMap = clusters.getClusters(); if (clusterMap != null && !clusterMap.isEmpty()) { for (final Cluster cluster : clusterMap.values()) { Config amsEnv = cluster.getDesiredConfigByType(AMS_ENV); if (amsEnv != null) { Map<String, String> amsEnvProperties = amsEnv.getProperties(); String content = amsEnvProperties.get("content"); Map<String, String> newProperties = new HashMap<>(); newProperties.put("content", updateAmsEnvContent(content)); updateConfigurationPropertiesForCluster(cluster, AMS_ENV, newProperties, true, true); } boolean isDistributed = false; Config amsSite = cluster.getDesiredConfigByType(AMS_SITE); if (amsSite != null) { if ("distributed".equals(amsSite.getProperties().get(AMS_MODE))) { isDistributed = true; } Map<String, String> amsSiteProperties = amsSite.getProperties(); if (amsSiteProperties != null && amsSiteProperties.containsKey("timeline.metrics.hbase.fifo.compaction.enabled")) { LOG.info("Removing timeline.metrics.hbase.fifo.compaction.enabled from ams-site"); removeConfigurationPropertiesFromCluster(cluster, AMS_SITE, Collections.singleton("timeline.metrics.hbase.fifo.compaction.enabled")); } } if (isDistributed) { Config amsHbaseSite = cluster.getDesiredConfigByType(AMS_HBASE_SITE); if (amsHbaseSite != null) { Map<String, String> amsHbaseSiteProperties = amsHbaseSite.getProperties(); String rootDir = amsHbaseSiteProperties.get(HBASE_ROOTDIR); if (StringUtils.isNotEmpty(rootDir) && rootDir.startsWith("hdfs: int indexOfSlash = rootDir.indexOf("/", 7); Map<String, String> newProperties = new HashMap<>(); String newRootdir = rootDir.substring(indexOfSlash); newProperties.put(HBASE_ROOTDIR, newRootdir); LOG.info("Changing ams-hbase-site rootdir to " + newRootdir); updateConfigurationPropertiesForCluster(cluster, AMS_HBASE_SITE, newProperties, true, true); } } } Config amsLog4jProperties = cluster.getDesiredConfigByType(AMS_LOG4J); if(amsLog4jProperties != null){ Map<String, String> newProperties = new HashMap<>(); String content = amsLog4jProperties.getProperties().get("content"); content = SchemaUpgradeUtil.extractProperty(content,"ams_log_max_backup_size","ams_log_max_backup_size","log4j.appender.file.MaxFileSize=(\\w+)MB","80",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_log_number_of_backup_files","ams_log_number_of_backup_files","log4j.appender.file.MaxBackupIndex=(\\w+)","60",newProperties); newProperties.put("content",content); updateConfigurationPropertiesForCluster(cluster,AMS_LOG4J,newProperties,true,true); } Config amsHbaseLog4jProperties = cluster.getDesiredConfigByType(AMS_HBASE_LOG4J); if(amsHbaseLog4jProperties != null){ Map<String, String> newProperties = new HashMap<>(); String content = amsHbaseLog4jProperties.getProperties().get("content"); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_log_maxfilesize","ams_hbase_log_maxfilesize","hbase.log.maxfilesize=(\\w+)MB","256",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_log_maxbackupindex","ams_hbase_log_maxbackupindex","hbase.log.maxbackupindex=(\\w+)","20",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_security_log_maxfilesize","ams_hbase_security_log_maxfilesize","hbase.security.log.maxfilesize=(\\w+)MB","256",newProperties); content = SchemaUpgradeUtil.extractProperty(content,"ams_hbase_security_log_maxbackupindex","ams_hbase_security_log_maxbackupindex","hbase.security.log.maxbackupindex=(\\w+)","20",newProperties); newProperties.put("content",content); updateConfigurationPropertiesForCluster(cluster,AMS_HBASE_LOG4J,newProperties,true,true); } Config amsGrafanaIni = cluster.getDesiredConfigByType(AMS_GRAFANA_INI); if (amsGrafanaIni != null) { Map<String, String> amsGrafanaIniProperties = amsGrafanaIni.getProperties(); String content = amsGrafanaIniProperties.get("content"); Map<String, String> newProperties = new HashMap<>(); newProperties.put("content", updateAmsGrafanaIniContent(content)); updateConfigurationPropertiesForCluster(cluster, AMS_GRAFANA_INI, newProperties, true, true); } } } } } @Inject  UpgradeCatalog250(Injector injector); @Override String getTargetVersion(); @Override String getSourceVersion(); static final String COMPONENT_TABLE; static final String COMPONENT_VERSION_TABLE; static final String COMPONENT_VERSION_PK; static final String COMPONENT_VERSION_FK_COMPONENT; static final String COMPONENT_VERSION_FK_REPO_VERSION; }