Examples of HostComponentStateEntity


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

      // 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());
     
View Full Code Here

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

    lPK.setHostName("h1");
    lPK.setServiceName(serviceName);

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

    ServiceComponentHost sch = serviceComponentHostFactory.createExisting(sc,
        stateEntity, desiredStateEntity);
    Assert.assertNotNull(sch);
View Full Code Here

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

    }

    this.serviceComponent = serviceComponent;
    this.clusterGlobalLock = serviceComponent.getClusterGlobalLock();

    stateEntity = new HostComponentStateEntity();
    stateEntity.setClusterId(serviceComponent.getClusterId());
    stateEntity.setComponentName(serviceComponent.getName());
    stateEntity.setServiceName(serviceComponent.getServiceName());
    stateEntity.setHostName(hostName);
    stateEntity.setCurrentState(stateMachine.getCurrentState());
View Full Code Here

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

        new HostComponentStateEntityPK();
    primaryKey.setClusterId(clusters.getCluster("C1").getClusterId());
    primaryKey.setServiceName("HDFS");
    primaryKey.setComponentName("DATANODE");
    primaryKey.setHostName("h1");
    HostComponentStateEntity entity =
        hostComponentStateDAO.findByPK(primaryKey);
    Collection<HostComponentConfigMappingEntity> entities =
        entity.getHostComponentConfigMappingEntities();
    Assert.assertEquals(0, entities.size());

    impl.setConfigs(oldConfigs);
    impl.persist();

    Assert.assertEquals(3, impl.getConfigVersions().size());
    entity = hostComponentStateDAO.findByPK(primaryKey);
    entities = entity.getHostComponentConfigMappingEntities();
    Assert.assertEquals(3, entities.size());

    Map<String, String> newConfigs = new HashMap<String, String>();
    newConfigs.put("type1", "v1");
    newConfigs.put("type2", "v3");
    newConfigs.put("type4", "v5");

    ServiceComponentHostStartEvent startEvent =
        new ServiceComponentHostStartEvent("DATANODE", "h1", 1, newConfigs);

    impl.handleEvent(startEvent);

    Assert.assertEquals(newConfigs.size(),
        impl.getConfigVersions().size());

    entity = hostComponentStateDAO.findByPK(primaryKey);
    entities = entity.getHostComponentConfigMappingEntities();
    Assert.assertEquals(3, entities.size());

    for (HostComponentConfigMappingEntity e : entities) {
      LOG.debug("Found live config "
          + e.getConfigType() + ":" + e.getVersionTag());
View Full Code Here

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

        new HostComponentStateEntityPK();
    primaryKey.setClusterId(clusters.getCluster("C1").getClusterId());
    primaryKey.setServiceName("HDFS");
    primaryKey.setComponentName("DATANODE");
    primaryKey.setHostName("h1");
    HostComponentStateEntity entity =
        hostComponentStateDAO.findByPK(primaryKey);
    Collection<HostComponentConfigMappingEntity> entities =
        entity.getHostComponentConfigMappingEntities();
    Assert.assertEquals(0, entities.size());

    impl.setConfigs(oldConfigs);
    impl.persist();

    Assert.assertEquals(3, impl.getConfigVersions().size());
    entity = hostComponentStateDAO.findByPK(primaryKey);
    entities = entity.getHostComponentConfigMappingEntities();
    Assert.assertEquals(3, entities.size());

    Map<String, String> newConfigs = new HashMap<String, String>();
    newConfigs.put("type1", "v1");
    newConfigs.put("type2", "v3");
    newConfigs.put("type4", "v5");

    ServiceComponentHostStartEvent startEvent =
        new ServiceComponentHostStartEvent("DATANODE", "h1", 1, newConfigs);

    impl.handleEvent(startEvent);

    Assert.assertEquals(newConfigs.size(),
        impl.getConfigVersions().size());

    entity = hostComponentStateDAO.findByPK(primaryKey);
    entities = entity.getHostComponentConfigMappingEntities();
    Assert.assertEquals(3, entities.size());

    for (HostComponentConfigMappingEntity e : entities) {
      LOG.debug("Found live config "
          + e.getConfigType() + ":" + e.getVersionTag());
View Full Code Here

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

    }

    this.serviceComponent = serviceComponent;
    this.clusterGlobalLock = serviceComponent.getClusterGlobalLock();

    stateEntity = new HostComponentStateEntity();
    stateEntity.setClusterId(serviceComponent.getClusterId());
    stateEntity.setComponentName(serviceComponent.getName());
    stateEntity.setServiceName(serviceComponent.getServiceName());
    stateEntity.setHostName(hostName);
    stateEntity.setCurrentState(stateMachine.getCurrentState());
View Full Code Here

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

    ReadWriteLock rwLock = new ReentrantReadWriteLock();
    this.readLock = rwLock.readLock();
    this.writeLock = rwLock.writeLock();
    this.serviceComponent = serviceComponent;

    stateEntity = new HostComponentStateEntity();
    stateEntity.setClusterId(serviceComponent.getClusterId());
    stateEntity.setComponentName(serviceComponent.getName());
    stateEntity.setServiceName(serviceComponent.getServiceName());
    stateEntity.setHostName(hostName);
    stateEntity.setCurrentState(stateMachine.getCurrentState());
View Full Code Here

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

        new HostComponentStateEntityPK();
    primaryKey.setClusterId(clusters.getCluster("C1").getClusterId());
    primaryKey.setServiceName("HDFS");
    primaryKey.setComponentName("DATANODE");
    primaryKey.setHostName("h1");
    HostComponentStateEntity entity =
        hostComponentStateDAO.findByPK(primaryKey);
    Collection<HostComponentConfigMappingEntity> entities =
        entity.getHostComponentConfigMappingEntities();
    Assert.assertEquals(0, entities.size());

    impl.setConfigs(oldConfigs);
    impl.persist();

    Assert.assertEquals(3, impl.getConfigVersions().size());
    entity = hostComponentStateDAO.findByPK(primaryKey);
    entities = entity.getHostComponentConfigMappingEntities();
    Assert.assertEquals(3, entities.size());

    Map<String, String> newConfigs = new HashMap<String, String>();
    newConfigs.put("type1", "v1");
    newConfigs.put("type2", "v3");
    newConfigs.put("type4", "v5");

    ServiceComponentHostStartEvent startEvent =
        new ServiceComponentHostStartEvent("DATANODE", "h1", 1, newConfigs);

    impl.handleEvent(startEvent);

    Assert.assertEquals(newConfigs.size(),
        impl.getConfigVersions().size());

    entity = hostComponentStateDAO.findByPK(primaryKey);
    entities = entity.getHostComponentConfigMappingEntities();
    Assert.assertEquals(3, entities.size());

    for (HostComponentConfigMappingEntity e : entities) {
      LOG.debug("Found live config "
          + e.getConfigType() + ":" + e.getVersionTag());
View Full Code Here

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

    lPK.setHostName("h1");
    lPK.setServiceName(serviceName);

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

    ServiceComponentHost sch = serviceComponentHostFactory.createExisting(sc,
        stateEntity, desiredStateEntity);
    Assert.assertNotNull(sch);
View Full Code Here

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

    ReadWriteLock rwLock = new ReentrantReadWriteLock();
    this.readLock = rwLock.readLock();
    this.writeLock = rwLock.writeLock();
    this.serviceComponent = serviceComponent;

    stateEntity = new HostComponentStateEntity();
    stateEntity.setClusterId(serviceComponent.getClusterId());
    stateEntity.setComponentName(serviceComponent.getName());
    stateEntity.setServiceName(serviceComponent.getServiceName());
    stateEntity.setHostName(hostName);
    stateEntity.setCurrentState(stateMachine.getCurrentState());
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.