Package org.apache.hadoop.yarn.event

Examples of org.apache.hadoop.yarn.event.Event


      Path endCommitSuccessFile = MRApps.getEndJobCommitSuccessFile(conf, user,
          jobId);
      Path endCommitFailureFile = MRApps.getEndJobCommitFailureFile(conf, user,
          jobId);

      Event e = waitForItHandler.getAndClearEvent();
      assertNotNull(e);
      assertTrue(e instanceof JobCommitCompletedEvent);
      FileSystem fs = FileSystem.get(conf);
      assertTrue(startCommitFile.toString(), fs.exists(startCommitFile));
      assertTrue(endCommitSuccessFile.toString(), fs.exists(endCommitSuccessFile));
View Full Code Here


      Path endCommitSuccessFile = MRApps.getEndJobCommitSuccessFile(conf, user,
          jobId);
      Path endCommitFailureFile = MRApps.getEndJobCommitFailureFile(conf, user,
          jobId);

      Event e = waitForItHandler.getAndClearEvent();
      assertNotNull(e);
      assertTrue(e instanceof JobCommitFailedEvent);
      FileSystem fs = FileSystem.get(conf);
      assertTrue(fs.exists(startCommitFile));
      assertFalse(fs.exists(endCommitSuccessFile));
View Full Code Here

    public synchronized Event getAndClearEvent() throws InterruptedException {
      if (event == null) {
        //Wait for at most 10 ms
        wait(100);
      }
      Event e = event;
      event = null;
      return e;
    }
View Full Code Here

  Runnable createThread() {
    return new Runnable() {
      @Override
      public void run() {
        while (!stopped && !Thread.currentThread().isInterrupted()) {
          Event event;
          try {
            event = eventQueue.take();
            if(LOG.isDebugEnabled()) {
              LOG.debug(id + ",event take:" + event.getType() + "," + event);
            }
          } catch(InterruptedException ie) {
            if (!stopped) {
              LOG.warn("AsyncDispatcher thread interrupted");
            }
View Full Code Here

    ApplicationId appId =  BuilderUtils.newApplicationId(0, 0);
    delegationTokenRenewer.addApplicationAsync(appId, ts, true);
    int waitCnt = 20;
    while (waitCnt-- >0) {
      if (!eventQueue.isEmpty()) {
        Event evt = eventQueue.take();
        if (evt.getType() == RMAppEventType.APP_REJECTED) {
          Assert.assertTrue(
              ((RMAppEvent) evt).getApplicationId().equals(appId));
          return;
        }
      } else {
View Full Code Here

    // register the tokens for renewal
    ApplicationId applicationId_0 =  BuilderUtils.newApplicationId(0, 0);
    localDtr.addApplicationAsync(applicationId_0, ts, true);
    waitForEventsToGetProcessed(localDtr);
    if (!eventQueue.isEmpty()){
      Event evt = eventQueue.take();
      if (evt instanceof RMAppEvent) {
        Assert.assertEquals(((RMAppEvent)evt).getType(), RMAppEventType.START);
      } else {
        fail("RMAppEvent.START was expected!!");
      }
View Full Code Here

      verify(mockEventHandler, atLeast(2)).handle(arg.capture());
      boolean containerCleaned = false;
     
      for (int i =0; i < arg.getAllValues().size(); i++) {
        LOG.info(arg.getAllValues().get(i).toString());
        Event currentEvent = arg.getAllValues().get(i);
        if (currentEvent.getType() == TaskAttemptEventType.TA_CONTAINER_CLEANED) {
          containerCleaned = true;
        }
      }
      assert(containerCleaned);
     
View Full Code Here

  Runnable createThread() {
    return new Runnable() {
      @Override
      public void run() {
        while (!stopped && !Thread.currentThread().isInterrupted()) {
          Event event;
          try {
            event = eventQueue.take();
            if(LOG.isDebugEnabled()) {
              LOG.debug(id + ",event take:" + event.getType() + "," + event);
            }
          } catch(InterruptedException ie) {
            if (!stopped) {
              LOG.warn("AsyncDispatcher thread interrupted");
            }
View Full Code Here

    mockTask.handle(new TaskEventTAUpdate(mockTask.getLastAttempt()
        .getID(), TaskEventType.T_ATTEMPT_FAILED));

    // The task should still be in the scheduled state
    assertTaskScheduledState();
    Event event = eventHandler.events.get(0);
    Assert.assertEquals(AMNodeEventType.N_TA_ENDED, event.getType());
    event = eventHandler.events.get(eventHandler.events.size()-1);
    Assert.assertEquals(VertexEventType.V_TASK_RESCHEDULED, event.getType());
  }
View Full Code Here

    when(mockStatus.getContainerId()).thenReturn(mockCId);
    when(mockStatus.getDiagnostics()).thenReturn(diagnostics);
    when(mockStatus.getExitStatus()).thenReturn(ContainerExitStatus.PREEMPTED);
    schedulerHandler.containerCompleted(mockTask, mockStatus);
    Assert.assertEquals(1, mockEventHandler.events.size());
    Event event = mockEventHandler.events.get(0);
    Assert.assertEquals(AMContainerEventType.C_COMPLETED, event.getType());
    AMContainerEventCompleted completedEvent = (AMContainerEventCompleted) event;
    Assert.assertEquals(mockCId, completedEvent.getContainerId());
    Assert.assertEquals("Container preempted externally. Container preempted by RM.",
        completedEvent.getDiagnostics());
    Assert.assertTrue(completedEvent.isPreempted());
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.event.Event

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.