Examples of findByPK()


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

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

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

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

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

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

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

                      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.dao.HostComponentDesiredStateDAO.findByPK()

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

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

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

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

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

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

    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
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.