Examples of findByPK()


Examples of org.apache.ambari.server.orm.dao.ClusterServiceDAO.findByPK()

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

Examples of org.apache.ambari.server.orm.dao.ClusterServiceDAO.findByPK()

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

Examples of org.apache.ambari.server.orm.dao.ClusterServiceDAO.findByPK()

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

Examples of org.apache.ambari.server.orm.dao.ClusterStateDAO.findByPK()

    }

    ClusterStateDAO clusterStateDAO = injector.getInstance(ClusterStateDAO.class);

    for (Long clusterId : clusterIds) {
      ClusterStateEntity clusterStateEntity = clusterStateDAO.findByPK(clusterId);
      String currentStackVersion = clusterStateEntity.getCurrentStackVersion();
      clusterStateEntity.setCurrentStackVersion(getStackIdString
        (currentStackVersion, stackName, stackVersion));
      clusterStateDAO.merge(clusterStateEntity);
    }
View Full Code Here

Examples of org.apache.ambari.server.orm.dao.ClusterStateDAO.findByPK()

      public void run() {
        ClusterDAO clusterDAO = injector.getInstance(ClusterDAO.class);
        ClusterStateDAO clusterStateDAO = injector.getInstance(ClusterStateDAO.class);
        List<ClusterEntity> clusterEntities = clusterDAO.findAll();
        for (ClusterEntity clusterEntity : clusterEntities) {
          if (clusterStateDAO.findByPK(clusterEntity.getClusterId()) == null) {
            ClusterStateEntity clusterStateEntity = new ClusterStateEntity();
            clusterStateEntity.setClusterEntity(clusterEntity);
            clusterStateEntity.setCurrentStackVersion(clusterEntity.getDesiredStackVersion());

            clusterStateDAO.create(clusterStateEntity);
View Full Code Here

Examples of org.apache.ambari.server.orm.dao.ClusterStateDAO.findByPK()

    }

    ClusterStateDAO clusterStateDAO = injector.getInstance(ClusterStateDAO.class);

    for (Long clusterId : clusterIds) {
      ClusterStateEntity clusterStateEntity = clusterStateDAO.findByPK(clusterId);
      String currentStackVersion = clusterStateEntity.getCurrentStackVersion();
      clusterStateEntity.setCurrentStackVersion(getStackIdString
        (currentStackVersion, stackName, stackVersion));
      clusterStateDAO.merge(clusterStateEntity);
    }
View Full Code Here

Examples of org.apache.ambari.server.orm.dao.ClusterStateDAO.findByPK()

      public void run() {
        ClusterDAO clusterDAO = injector.getInstance(ClusterDAO.class);
        ClusterStateDAO clusterStateDAO = injector.getInstance(ClusterStateDAO.class);
        List<ClusterEntity> clusterEntities = clusterDAO.findAll();
        for (ClusterEntity clusterEntity : clusterEntities) {
          if (clusterStateDAO.findByPK(clusterEntity.getClusterId()) == null) {
            ClusterStateEntity clusterStateEntity = new ClusterStateEntity();
            clusterStateEntity.setClusterEntity(clusterEntity);
            clusterStateEntity.setCurrentStackVersion(clusterEntity.getDesiredStackVersion());

            clusterStateDAO.create(clusterStateEntity);
View Full Code Here

Examples of org.apache.ambari.server.orm.dao.ClusterStateDAO.findByPK()

    }

    ClusterStateDAO clusterStateDAO = injector.getInstance(ClusterStateDAO.class);

    for (Long clusterId : clusterIds) {
      ClusterStateEntity clusterStateEntity = clusterStateDAO.findByPK(clusterId);
      String currentStackVersion = clusterStateEntity.getCurrentStackVersion();
      clusterStateEntity.setCurrentStackVersion(getStackIdString
        (currentStackVersion, stackName, stackVersion));
      clusterStateDAO.merge(clusterStateEntity);
    }
View Full Code Here

Examples of org.apache.ambari.server.orm.dao.ClusterStateDAO.findByPK()

      public void run() {
        ClusterDAO clusterDAO = injector.getInstance(ClusterDAO.class);
        ClusterStateDAO clusterStateDAO = injector.getInstance(ClusterStateDAO.class);
        List<ClusterEntity> clusterEntities = clusterDAO.findAll();
        for (ClusterEntity clusterEntity : clusterEntities) {
          if (clusterStateDAO.findByPK(clusterEntity.getClusterId()) == null) {
            ClusterStateEntity clusterStateEntity = new ClusterStateEntity();
            clusterStateEntity.setClusterEntity(clusterEntity);
            clusterStateEntity.setCurrentStackVersion(clusterEntity.getDesiredStackVersion());

            clusterStateDAO.create(clusterStateEntity);
View Full Code Here

Examples of org.apache.ambari.server.orm.dao.ExecutionCommandDAO.findByPK()

    List<HostRoleCommand> storedTasks = actionDB.getRequestTasks(response.getRequestId());
    Stage stage = actionDB.getAllStages(response.getRequestId()).get(0);

    //Check configs not stored with execution command
    ExecutionCommandDAO executionCommandDAO = injector.getInstance(ExecutionCommandDAO.class);
    ExecutionCommandEntity commandEntity = executionCommandDAO.findByPK(task.getTaskId());
    ExecutionCommand executionCommand =
        StageUtils.fromJson(new String(commandEntity.getCommand()), ExecutionCommand.class);

    assertFalse(executionCommand.getConfigurationTags().isEmpty());
    assertTrue(executionCommand.getConfigurations() == null || executionCommand.getConfigurations().isEmpty());
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.