Examples of HostComponentDesiredStateEntity


Examples of org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity

      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());
     
      persistComponentEntities(stateEntity, desiredStateEntity, serviceComponentDesiredStateEntity);
    }
  }
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity

                        new HostComponentDesiredStateEntityPK();
                      entityPK.setClusterId(clusterId);
                      entityPK.setServiceName("HDFS");
                      entityPK.setComponentName("DATANODE");
                      entityPK.setHostName(node.trim());
                      HostComponentDesiredStateEntity desiredStateEntity =
                        desiredStateDAO.findByPK(entityPK);
                      desiredStateEntity.setAdminState(HostComponentAdminState.DECOMMISSIONED);
                      desiredStateDAO.merge(desiredStateEntity);
                    }
                  }
                }
              }
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity

    lPK.setClusterId(cluster.getClusterId());
    lPK.setComponentName(componentName);
    lPK.setHostName("h1");
    lPK.setServiceName(serviceName);

    HostComponentDesiredStateEntity desiredStateEntity =
        desiredStateDAO.findByPK(dPK);
    HostComponentStateEntity stateEntity =
        liveStateDAO.findByPK(lPK);

    ServiceComponentHost sch = serviceComponentHostFactory.createExisting(sc,
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity

    stateEntity.setServiceName(serviceComponent.getServiceName());
    stateEntity.setHostName(hostName);
    stateEntity.setCurrentState(stateMachine.getCurrentState());
    stateEntity.setCurrentStackVersion(gson.toJson(new StackId()));

    desiredStateEntity = new HostComponentDesiredStateEntity();
    desiredStateEntity.setClusterId(serviceComponent.getClusterId());
    desiredStateEntity.setComponentName(serviceComponent.getName());
    desiredStateEntity.setServiceName(serviceComponent.getServiceName());
    desiredStateEntity.setHostName(hostName);
    desiredStateEntity.setDesiredState(State.INIT);
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity

    pk.setComponentName(sch1.getServiceComponentName());
    pk.setServiceName(sch1.getServiceName());
    pk.setHostName(hostName);
   
    HostComponentDesiredStateDAO dao = injector.getInstance(HostComponentDesiredStateDAO.class);
    HostComponentDesiredStateEntity entity = dao.findByPK(pk);
    Assert.assertEquals(MaintenanceState.OFF, entity.getMaintenanceState());
    Assert.assertEquals(MaintenanceState.OFF, sch1.getMaintenanceState());
   
    sch1.setMaintenanceState(MaintenanceState.ON);
    Assert.assertEquals(MaintenanceState.ON, sch1.getMaintenanceState());
   
    entity = dao.findByPK(pk);
    Assert.assertEquals(MaintenanceState.ON, entity.getMaintenanceState());

  }
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity

    desiredPK.setClusterId(clusters.getCluster("C1").getClusterId());
    desiredPK.setServiceName("HDFS");
    desiredPK.setComponentName("DATANODE");
    desiredPK.setHostName("h1");

    HostComponentDesiredStateEntity desiredEntity =
        hostComponentDesiredStateDAO.findByPK(desiredPK);
    Assert.assertEquals(3,
        desiredEntity.getHostComponentDesiredConfigMappingEntities().size());

    Map<String, String> oldConfigs = new HashMap<String, String>();
    oldConfigs.put("type1", "v1");
    oldConfigs.put("type2", "v1");
    oldConfigs.put("type3", "v1");
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity

    desiredPK.setClusterId(clusters.getCluster("C1").getClusterId());
    desiredPK.setServiceName("HDFS");
    desiredPK.setComponentName("DATANODE");
    desiredPK.setHostName("h1");

    HostComponentDesiredStateEntity desiredEntity =
        hostComponentDesiredStateDAO.findByPK(desiredPK);
    Assert.assertEquals(3,
        desiredEntity.getHostComponentDesiredConfigMappingEntities().size());

    Map<String, String> oldConfigs = new HashMap<String, String>();
    oldConfigs.put("type1", "v1");
    oldConfigs.put("type2", "v1");
    oldConfigs.put("type3", "v1");
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity

    stateEntity.setServiceName(serviceComponent.getServiceName());
    stateEntity.setHostName(hostName);
    stateEntity.setCurrentState(stateMachine.getCurrentState());
    stateEntity.setCurrentStackVersion(gson.toJson(new StackId()));

    desiredStateEntity = new HostComponentDesiredStateEntity();
    desiredStateEntity.setClusterId(serviceComponent.getClusterId());
    desiredStateEntity.setComponentName(serviceComponent.getName());
    desiredStateEntity.setServiceName(serviceComponent.getServiceName());
    desiredStateEntity.setHostName(hostName);
    desiredStateEntity.setDesiredState(State.INIT);
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity

    stateEntity.setServiceName(serviceComponent.getServiceName());
    stateEntity.setHostName(hostName);
    stateEntity.setCurrentState(stateMachine.getCurrentState());
    stateEntity.setCurrentStackVersion(gson.toJson(new StackId()));

    desiredStateEntity = new HostComponentDesiredStateEntity();
    desiredStateEntity.setClusterId(serviceComponent.getClusterId());
    desiredStateEntity.setComponentName(serviceComponent.getName());
    desiredStateEntity.setServiceName(serviceComponent.getServiceName());
    desiredStateEntity.setHostName(hostName);
    desiredStateEntity.setDesiredState(State.INIT);
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity

    desiredPK.setClusterId(clusters.getCluster("C1").getClusterId());
    desiredPK.setServiceName("HDFS");
    desiredPK.setComponentName("DATANODE");
    desiredPK.setHostName("h1");

    HostComponentDesiredStateEntity desiredEntity =
        hostComponentDesiredStateDAO.findByPK(desiredPK);
    Assert.assertEquals(3,
        desiredEntity.getHostComponentDesiredConfigMappingEntities().size());

    Map<String, String> oldConfigs = new HashMap<String, String>();
    oldConfigs.put("type1", "v1");
    oldConfigs.put("type2", "v1");
    oldConfigs.put("type3", "v1");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.