Examples of RMAppEvent


Examples of org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppEvent

    RMApp application =
        new RMAppImpl(applicationId, resourceManager.getRMContext(), conf, name, user,
          queue, submissionContext, scheduler, masterService,
          System.currentTimeMillis(), "YARN", null);
    resourceManager.getRMContext().getRMApps().putIfAbsent(applicationId, application);
    application.handle(new RMAppEvent(applicationId, RMAppEventType.START));

    final int MAX_TRIES=20;
    int numTries = 0;
    while (!application.getState().equals(RMAppState.SUBMITTED) &&
        numTries < MAX_TRIES) {
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppEvent

    // AM should now be in running
    rm.waitForState(am.getApplicationAttemptId(), RMAppAttemptState.RUNNING);

    // Simulate that appAttempt is killed.
    rm.getRMContext().getDispatcher().getEventHandler().handle(
        new RMAppEvent(application.getApplicationId(),
          RMAppEventType.ATTEMPT_KILLED));
    rm.waitForState(application.getApplicationId(), RMAppState.KILLED);

    // test metrics
    metrics = rm.getResourceScheduler().getRootQueueMetrics();
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppEvent

    @SuppressWarnings("rawtypes")
    EventHandler eventHandler = new EventHandler() {
      @Override
      public void handle(Event rawEvent) {
        if (rawEvent instanceof RMAppEvent) {
          RMAppEvent event = (RMAppEvent) rawEvent;
          if (event.getApplicationId().equals(appId1)) {
            try {
              startBarrier.await();
              endBarrier.await();
            } catch (BrokenBarrierException e) {
              LOG.warn("Broken Barrier", e);
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppEvent

      // Tell the AMS. Unregister from the ApplicationMasterService
      appAttempt.masterService.unregisterAttempt(appAttemptId);

      // Tell the application and the scheduler
      ApplicationId applicationId = appAttemptId.getApplicationId();
      RMAppEvent appEvent = null;
      switch (finalAttemptState) {
        case FINISHED:
        {
          appEvent = new RMAppFinishedAttemptEvent(applicationId,
              appAttempt.getDiagnostics());
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppEvent

      // Ideally this should have been done when the scheduler accepted the app.
      // But its here because until the attempt is saved the client should not
      // launch the unmanaged AM. Client waits for the app status to be accepted
      // before doing so. So we have to delay the accepted state until we have
      // completed storing the attempt
      appAttempt.eventHandler.handle(new RMAppEvent(event
          .getApplicationAttemptId().getApplicationId(),
          RMAppEventType.APP_ACCEPTED));
     
      super.transition(appAttempt, event);
    }   
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppEvent

      appAttempt.origTrackingUrl = registrationEvent.getTrackingurl();
      appAttempt.proxiedTrackingUrl =
        appAttempt.generateProxyUriWithoutScheme(appAttempt.origTrackingUrl);

      // Let the app know
      appAttempt.eventHandler.handle(new RMAppEvent(appAttempt
          .getAppAttemptId().getApplicationId(),
          RMAppEventType.ATTEMPT_REGISTERED));
    }
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppEvent

      }
      appAttempt.rmContext.getAMFinishingMonitor().register(appAttemptId);
      ApplicationId applicationId =
          appAttempt.getAppAttemptId().getApplicationId();
      appAttempt.eventHandler.handle(
          new RMAppEvent(applicationId, RMAppEventType.ATTEMPT_UNREGISTERED));
      return RMAppAttemptState.FINISHING;
    }
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppEvent

          + callerUGI.getShortUserName() + " cannot perform operation "
          + ApplicationAccessType.MODIFY_APP.name() + " on " + applicationId));
    }

    this.rmContext.getDispatcher().getEventHandler().handle(
        new RMAppEvent(applicationId, RMAppEventType.KILL));

    RMAuditLogger.logSuccess(callerUGI.getShortUserName(),
        AuditConstants.KILL_APP_REQUEST, "ClientRMService" , applicationId);
    KillApplicationResponse response = recordFactory
        .newRecordInstance(KillApplicationResponse.class);
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppEvent

    @Override
    public RMAppAttemptState transition(RMAppAttemptImpl appAttempt,
        RMAppAttemptEvent event) {
      if (!appAttempt.submissionContext.getUnmanagedAM()) {
        // Send the acceptance to the app
        appAttempt.eventHandler.handle(new RMAppEvent(event
            .getApplicationAttemptId().getApplicationId(),
            RMAppEventType.APP_ACCEPTED));

        // Request a container for the AM.
        ResourceRequest request =
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppEvent

      throw RPCUtil.getRemoteException(ie);
    }

    // All done, start the RMApp
    this.rmContext.getDispatcher().getEventHandler().handle(
        new RMAppEvent(applicationId, isRecovered ? RMAppEventType.RECOVER:
            RMAppEventType.START));
  }
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.