// no jobtracker present probably mapreduce is not installed
if(serviceComponentDesiredStateEntityJT == null)
continue;
HostComponentStateEntity jtHostComponentStateEntity = serviceComponentDesiredStateEntityJT.getHostComponentStateEntities().iterator().next();
HostComponentDesiredStateEntity jtHostComponentDesiredStateEntity = serviceComponentDesiredStateEntityJT.getHostComponentDesiredStateEntities().iterator().next();
String jtHostname = jtHostComponentStateEntity.getHostName();
State jtCurrState = jtHostComponentStateEntity.getCurrentState();
State jtHostComponentDesiredState = jtHostComponentDesiredStateEntity.getDesiredState();
State jtServiceComponentDesiredState = serviceComponentDesiredStateEntityJT.getDesiredState();
ClusterServiceEntityPK pk = new ClusterServiceEntityPK();
pk.setClusterId(clusterEntity.getClusterId());
pk.setServiceName("MAPREDUCE");
ClusterServiceEntity clusterServiceEntity = clusterServiceDAO.findByPK(pk);
final ServiceComponentDesiredStateEntity serviceComponentDesiredStateEntity = new ServiceComponentDesiredStateEntity();
serviceComponentDesiredStateEntity.setComponentName("HISTORYSERVER");
serviceComponentDesiredStateEntity.setDesiredStackVersion(clusterEntity.getDesiredStackVersion());
serviceComponentDesiredStateEntity.setDesiredState(jtServiceComponentDesiredState);
serviceComponentDesiredStateEntity.setClusterServiceEntity(clusterServiceEntity);
serviceComponentDesiredStateEntity.setHostComponentDesiredStateEntities(new ArrayList<HostComponentDesiredStateEntity>());
final HostComponentStateEntity stateEntity = new HostComponentStateEntity();
stateEntity.setHostName(jtHostname);
stateEntity.setCurrentState(jtCurrState);
stateEntity.setCurrentStackVersion(clusterEntity.getDesiredStackVersion());
final HostComponentDesiredStateEntity desiredStateEntity = new HostComponentDesiredStateEntity();
desiredStateEntity.setDesiredState(jtHostComponentDesiredState);
desiredStateEntity.setDesiredStackVersion(clusterEntity.getDesiredStackVersion());