LOG.debug("Missing configs have been successfully added into Ambari DB.");
}
protected void processDecommissionedDatanodes() {
KeyValueDAO keyValueDAO = injector.getInstance(KeyValueDAO.class);
ClusterDAO clusterDAO = injector.getInstance(ClusterDAO.class);
Gson gson = injector.getInstance(Gson.class);
HostComponentDesiredStateDAO desiredStateDAO = injector.getInstance
(HostComponentDesiredStateDAO.class);
KeyValueEntity keyValueEntity = keyValueDAO.findByKey("decommissionDataNodesTag");
String value = null;
if (keyValueEntity != null) {
value = keyValueEntity.getValue();
if (value != null && !value.isEmpty()) {
List<ClusterEntity> clusterEntities = clusterDAO.findAll();
for (ClusterEntity clusterEntity : clusterEntities) {
Long clusterId = clusterEntity.getClusterId();
ClusterConfigEntityPK configEntityPK = new ClusterConfigEntityPK();
configEntityPK.setClusterId(clusterId);
configEntityPK.setType("hdfs-exclude-file");
configEntityPK.setTag(value.trim());
ClusterConfigEntity configEntity = clusterDAO.findConfig(configEntityPK);
if (configEntity != null) {
String configData = configEntity.getData();
if (configData != null) {
Map<String, String> properties = gson.<Map<String, String>>fromJson(configData, Map.class);
if (properties != null && !properties.isEmpty()) {