Package org.apache.ambari.server.actionmanager

Examples of org.apache.ambari.server.actionmanager.Request


    stages.get(2).addHostRoleExecutionCommand(hostName1, Role.HBASE_CLIENT,
            RoleCommand.START,
            new ServiceComponentHostStartEvent(Role.HBASE_CLIENT.toString(),
                    hostName1, System.currentTimeMillis()), clusterName, "HBASE");

    Request request = new Request(stages, clusters);
    actionDB.persistActions(request);

    stages.clear();
    stages.add(new Stage(requestId2, "/a4", clusterName, context, CLUSTER_HOST_INFO));
    stages.get(0).setStageId(4);
    stages.get(0).addHostRoleExecutionCommand(hostName1, Role.HBASE_CLIENT,
            RoleCommand.START,
            new ServiceComponentHostStartEvent(Role.HBASE_CLIENT.toString(),
                    hostName1, System.currentTimeMillis()), clusterName, "HBASE");

    stages.add(new Stage(requestId2, "/a5", clusterName, context, CLUSTER_HOST_INFO));
    stages.get(1).setStageId(5);
    stages.get(1).addHostRoleExecutionCommand(hostName1, Role.HBASE_CLIENT,
            RoleCommand.START,
            new ServiceComponentHostStartEvent(Role.HBASE_CLIENT.toString(),
                    hostName1, System.currentTimeMillis()), clusterName, "HBASE");

    request = new Request(stages, clusters);
    actionDB.persistActions(request);


    Set<TaskStatusRequest> taskStatusRequests;
    Set<TaskStatusResponse> taskStatusResponses;
View Full Code Here


  @Test
  public void testPersist() {
    ActionManager actionManager = createStrictMock(ActionManager.class);
    RequestFactory requestFactory = createStrictMock(RequestFactory.class);
    Request request = createStrictMock(Request.class);
    Stage stage1 = createNiceMock(Stage.class);
    Stage stage2 = createNiceMock(Stage.class);
    List<Stage> stages = new ArrayList<Stage>();
    stages.add(stage1);
    stages.add(stage2);

    //expectations
    expect(requestFactory.createNewFromStages(stages)).andReturn(request);
    expect(request.getStages()).andReturn(stages).anyTimes();
    actionManager.sendActions(request, null);

    replay(actionManager, requestFactory, request, stage1, stage2);

    RequestStageContainer requestStages = new RequestStageContainer(1L, stages, requestFactory, actionManager);
View Full Code Here

  /**
   * Persist the stages.
   */
  public void persist() {
    if (!stages.isEmpty()) {
      Request request = requestFactory.createNewFromStages(stages);
      if (request != null && request.getStages()!= null && !request.getStages().isEmpty()) {
        if (LOG.isDebugEnabled()) {
          LOG.debug(String.format("Triggering Action Manager, request=%s", request));
        }
        actionManager.sendActions(request, null);
      }
View Full Code Here

    stages.get(2).addHostRoleExecutionCommand(hostName1, Role.HBASE_CLIENT,
            RoleCommand.START,
            new ServiceComponentHostStartEvent(Role.HBASE_CLIENT.toString(),
                    hostName1, System.currentTimeMillis()), clusterName, "HBASE");

    Request request = new Request(stages, clusters);
    actionDB.persistActions(request);

    stages.clear();
    stages.add(new Stage(requestId2, "/a4", clusterName, 1L, context, CLUSTER_HOST_INFO));
    stages.get(0).setStageId(4);
    stages.get(0).addHostRoleExecutionCommand(hostName1, Role.HBASE_CLIENT,
            RoleCommand.START,
            new ServiceComponentHostStartEvent(Role.HBASE_CLIENT.toString(),
                    hostName1, System.currentTimeMillis()), clusterName, "HBASE");

    stages.add(new Stage(requestId2, "/a5", clusterName, 1L, context, CLUSTER_HOST_INFO));
    stages.get(1).setStageId(5);
    stages.get(1).addHostRoleExecutionCommand(hostName1, Role.HBASE_CLIENT,
            RoleCommand.START,
            new ServiceComponentHostStartEvent(Role.HBASE_CLIENT.toString(),
                    hostName1, System.currentTimeMillis()), clusterName, "HBASE");

    request = new Request(stages, clusters);
    actionDB.persistActions(request);


    Set<TaskStatusRequest> taskStatusRequests;
    Set<TaskStatusResponse> taskStatusResponses;
View Full Code Here

        RoleCommand.START,
        new ServiceComponentHostStartEvent(Role.HBASE_MASTER.toString(),
            DummyHostname1, System.currentTimeMillis()), DummyCluster, HBASE);
    List<Stage> stages = new ArrayList<Stage>();
    stages.add(s);
    Request request = new Request(stages, clusters);
    db.persistActions(request);
  }
View Full Code Here

      new ServiceComponentHostInstallEvent(Role.DATANODE.toString(),
        DummyHostname1, System.currentTimeMillis(), "HDP-1.3.0"),
          DummyCluster, "HDFS");
    List<Stage> stages = new ArrayList<Stage>();
    stages.add(s);
    Request request = new Request(stages, clusters);
    actionDBAccessor.persistActions(request);
    actionDBAccessor.abortHostRole(DummyHostname1, 1, 1, Role.DATANODE.name());

    HeartBeat hb = new HeartBeat();
    hb.setTimestamp(System.currentTimeMillis());
View Full Code Here

      new ServiceComponentHostInstallEvent(Role.NAMENODE.toString(),
        DummyHostname1, System.currentTimeMillis(), "HDP-1.3.0"),
          DummyCluster, "HDFS");
    List<Stage> stages = new ArrayList<Stage>();
    stages.add(s);
    Request request = new Request(stages, clusters);
    actionDBAccessor.persistActions(request);
    CommandReport cr = new CommandReport();
    cr.setActionId(StageUtils.getActionId(requestId, stageId));
    cr.setTaskId(1);
    cr.setClusterName(DummyCluster);
View Full Code Here

    stages.get(2).addHostRoleExecutionCommand(hostName1, Role.HBASE_CLIENT,
            RoleCommand.START,
            new ServiceComponentHostStartEvent(Role.HBASE_CLIENT.toString(),
                    hostName1, System.currentTimeMillis()), clusterName, "HBASE");

    Request request = new Request(stages, clusters);
    actionDB.persistActions(request);

    stages.clear();
    stages.add(new Stage(requestId2, "/a4", clusterName, context, CLUSTER_HOST_INFO));
    stages.get(0).setStageId(4);
    stages.get(0).addHostRoleExecutionCommand(hostName1, Role.HBASE_CLIENT,
            RoleCommand.START,
            new ServiceComponentHostStartEvent(Role.HBASE_CLIENT.toString(),
                    hostName1, System.currentTimeMillis()), clusterName, "HBASE");

    stages.add(new Stage(requestId2, "/a5", clusterName, context, CLUSTER_HOST_INFO));
    stages.get(1).setStageId(5);
    stages.get(1).addHostRoleExecutionCommand(hostName1, Role.HBASE_CLIENT,
            RoleCommand.START,
            new ServiceComponentHostStartEvent(Role.HBASE_CLIENT.toString(),
                    hostName1, System.currentTimeMillis()), clusterName, "HBASE");

    request = new Request(stages, clusters);
    actionDB.persistActions(request);


    Set<TaskStatusRequest> taskStatusRequests;
    Set<TaskStatusResponse> taskStatusResponses;
View Full Code Here

    stages.get(2).addHostRoleExecutionCommand(hostName1, Role.HBASE_CLIENT,
            RoleCommand.START,
            new ServiceComponentHostStartEvent(Role.HBASE_CLIENT.toString(),
                    hostName1, System.currentTimeMillis()), clusterName, "HBASE");

    Request request = new Request(stages, clusters);
    actionDB.persistActions(request);

    stages.clear();
    stages.add(new Stage(requestId2, "/a4", clusterName, context, CLUSTER_HOST_INFO));
    stages.get(0).setStageId(4);
    stages.get(0).addHostRoleExecutionCommand(hostName1, Role.HBASE_CLIENT,
            RoleCommand.START,
            new ServiceComponentHostStartEvent(Role.HBASE_CLIENT.toString(),
                    hostName1, System.currentTimeMillis()), clusterName, "HBASE");

    stages.add(new Stage(requestId2, "/a5", clusterName, context, CLUSTER_HOST_INFO));
    stages.get(1).setStageId(5);
    stages.get(1).addHostRoleExecutionCommand(hostName1, Role.HBASE_CLIENT,
            RoleCommand.START,
            new ServiceComponentHostStartEvent(Role.HBASE_CLIENT.toString(),
                    hostName1, System.currentTimeMillis()), clusterName, "HBASE");

    request = new Request(stages, clusters);
    actionDB.persistActions(request);


    Set<TaskStatusRequest> taskStatusRequests;
    Set<TaskStatusResponse> taskStatusResponses;
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.actionmanager.Request

Copyright © 2018 www.massapicom. 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.