Package org.apache.ambari.server.controller

Examples of org.apache.ambari.server.controller.HostsMap


  }

  @Test
  public void testTaskInProgressHandling() throws AmbariException, InvalidStateTransitionException {
    ActionManager am = new ActionManager(0, 0, null, null,
            new ActionDBInMemoryImpl(), new HostsMap((String) null));
    clusters.addHost(DummyHostname1);
    clusters.getHost(DummyHostname1).setOsType(DummyOsType);
    clusters.getHost(DummyHostname1).persist();
    clusters.addCluster(DummyCluster);
View Full Code Here


    clusters.addHost(DummyHostname1);
    clusters.getHost(DummyHostname1).persist();
    clusters.addCluster(DummyCluster);
    ActionDBAccessor db = injector.getInstance(ActionDBAccessorImpl.class);
    ActionManager am = new ActionManager(5000, 1200000, new ActionQueue(), clusters, db,
        new HostsMap((String) null), null, unitOfWork, injector.getInstance(RequestFactory.class), null);
    populateActionDB(db, DummyHostname1);
    Stage stage = db.getAllStages(requestId).get(0);
    Assert.assertEquals(stageId, stage.getStageId());
    stage.setHostRoleStatus(DummyHostname1, HBASE_MASTER, HostRoleStatus.QUEUED);
    db.hostRoleScheduled(stage, DummyHostname1, HBASE_MASTER);
View Full Code Here

    assertEquals(expected.getComponents(), actual.getComponents());
  }

  private ActionManager getMockActionManager() {
    return new ActionManager(0, 0, null, null,
        actionDBAccessor, new HostsMap((String) null), null, unitOfWork,
        injector.getInstance(RequestFactory.class), null);
  }
View Full Code Here

    when(db.getStagesInProgress()).thenReturn(stages);

    //Keep large number of attempts so that the task is not expired finally
    //Small action timeout to test rescheduling
    ActionScheduler scheduler = new ActionScheduler(100, 100, db, aq, fsm,
        10000, new HostsMap((String) null), null, unitOfWork, conf);
    scheduler.setTaskTimeoutAdjustment(false);
    // Start the thread
    scheduler.start();

    List<AgentCommand> ac = waitForQueueSize(hostname, aq, 1);
View Full Code Here

    }).when(db).timeoutHostRole(anyString(), anyLong(), anyLong(), anyString());


    //Small action timeout to test rescheduling
    ActionScheduler scheduler = new ActionScheduler(100, 50, db, aq, fsm, 3,
        new HostsMap((String) null), null, unitOfWork, conf);
    scheduler.setTaskTimeoutAdjustment(false);
    // Start the thread
    scheduler.start();

    while (!stages.get(0).getHostRoleStatus(hostname, "NAMENODE")
View Full Code Here

    }).when(db).timeoutHostRole(anyString(), anyLong(), anyLong(), anyString());


    //Small action timeout to test rescheduling
    ActionScheduler scheduler = new ActionScheduler(100, 50, db, aq, fsm, 3,
      new HostsMap((String) null), null, unitOfWork, conf);
    scheduler.setTaskTimeoutAdjustment(false);
    // Start the thread
    scheduler.start();

    while (!stages.get(0).getHostRoleStatus(hostname, "NAMENODE")
View Full Code Here

    ArgumentCaptor<ServiceComponentHostEvent> eventsCapture2 =
      ArgumentCaptor.forClass(ServiceComponentHostEvent.class);

    // Make sure the NN install doesn't timeout
    ActionScheduler scheduler = new ActionScheduler(100, 50000, db, aq, fsm, 3,
      new HostsMap((String) null), null, unitOfWork, conf);
    scheduler.setTaskTimeoutAdjustment(false);
    // Start the thread
    scheduler.start();

    while (!stages.get(0).getHostRoleStatus(hostname1, "DATANODE")
View Full Code Here

      }
    }).when(db).updateHostRoleState(anyString(), anyLong(), anyLong(), anyString(), any(CommandReport.class));


    ActionScheduler scheduler = new ActionScheduler(100, 50, db, aq, fsm, 3,
        new HostsMap((String) null), new ServerActionManagerImpl(fsm),
        unitOfWork, conf);
    scheduler.start();

    while (!stages.get(0).getHostRoleStatus(hostname, "AMBARI_SERVER_ACTION")
        .equals(HostRoleStatus.COMPLETED)) {
View Full Code Here

      }
    }).when(db).updateHostRoleState(anyString(), anyLong(), anyLong(), anyString(), any(CommandReport.class));


    ActionScheduler scheduler = new ActionScheduler(100, 50, db, aq, fsm, 3,
        new HostsMap((String) null), new ServerActionManagerImpl(fsm), unitOfWork, conf);
    scheduler.start();

    while (!stages.get(0).getHostRoleStatus(hostname, "AMBARI_SERVER_ACTION")
        .equals(HostRoleStatus.FAILED)) {
      Thread.sleep(100);
View Full Code Here

    when(db.getStagesInProgress()).thenReturn(stages);

    Properties properties = new Properties();
    Configuration conf = new Configuration(properties);
    ActionScheduler scheduler = new ActionScheduler(100, 50, db, aq, fsm, 3,
            new HostsMap((String) null), new ServerActionManagerImpl(fsm),
            unitOfWork, conf);

    ActionManager am = new ActionManager(
            2, 2, aq, fsm, db, new HostsMap((String) null),
            new ServerActionManagerImpl(fsm), unitOfWork, requestFactory, conf);

    scheduler.doWork();

    Assert.assertEquals(HostRoleStatus.QUEUED, stages.get(0).getHostRoleStatus(hostname1, "DATANODE"));
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.controller.HostsMap

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.