Package org.apache.hadoop.yarn.server.resourcemanager.rmapp

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppImpl$AttemptFailedTransition


      if(shouldRecover) {
        LOG.info("Recovering application " + appState.getAppId());
        submitApplication(appState.getApplicationSubmissionContext(),
                        appState.getSubmitTime(), true, appState.getUser());
        // re-populate attempt information in application
        RMAppImpl appImpl = (RMAppImpl) rmContext.getRMApps().get(
                                                        appState.getAppId());
        appImpl.recover(state);
      }
      else {
        store.removeApplication(appState);
      }
    }
View Full Code Here


    conf.set(FairSchedulerConfiguration.USER_AS_DEFAULT_QUEUE, "true");
    scheduler.reinitialize(conf, resourceManager.getRMContext());
    RMContext rmContext = resourceManager.getRMContext();
    Map<ApplicationId, RMApp> appsMap = rmContext.getRMApps();
    ApplicationAttemptId appAttemptId = createAppAttemptId(1, 1);
    RMApp rmApp = new RMAppImpl(appAttemptId.getApplicationId(), rmContext, conf,
        null, null, null, ApplicationSubmissionContext.newInstance(null, null,
            null, null, null, false, false, 0, null, null), null, null, 0, null);
    appsMap.put(appAttemptId.getApplicationId(), rmApp);
   
    AppAddedSchedulerEvent appAddedEvent = new AppAddedSchedulerEvent(
        appAttemptId, "default", "user1");
    scheduler.handle(appAddedEvent);
    assertEquals(1, scheduler.getQueueManager().getLeafQueue("user1", true)
        .getAppSchedulables().size());
    assertEquals(0, scheduler.getQueueManager().getLeafQueue("default", true)
        .getAppSchedulables().size());
    assertEquals("root.user1", rmApp.getQueue());

    conf.set(FairSchedulerConfiguration.USER_AS_DEFAULT_QUEUE, "false");
    scheduler.reinitialize(conf, resourceManager.getRMContext());
    AppAddedSchedulerEvent appAddedEvent2 = new AppAddedSchedulerEvent(
        createAppAttemptId(2, 1), "default", "user2");
View Full Code Here

        BuilderUtils.newContainerLaunchContext(null, null, null, null,
            null, null);
    submissionContext.setApplicationId(applicationId);
    submissionContext.setAMContainerSpec(clc);
    RMApp application =
        new RMAppImpl(applicationId, resourceManager.getRMContext(), conf, name, user,
          queue, submissionContext, scheduler, masterService,
          System.currentTimeMillis(), "YARN");
    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) {
      try {
        Thread.sleep(100);
      } catch (InterruptedException ex) {ex.printStackTrace();}
      numTries++;
    }
    assertEquals("The application doesn't reach SUBMITTED.",
        RMAppState.SUBMITTED, application.getState());

    ApplicationAttemptId attId =
        ApplicationAttemptId.newInstance(applicationId, this.ATTEMPT_ID++);
    scheduler.addApplication(attId, queue, user);

    numTries = 0;
    while (application.getFinishTime() == 0 && numTries < MAX_TRIES) {
      try {
        Thread.sleep(100);
      } catch (InterruptedException ex) {ex.printStackTrace();}
      numTries++;
    }
    assertEquals(FinalApplicationStatus.FAILED, application.getFinalApplicationStatus());
  }
View Full Code Here

          .createApplicationStore(submissionContext.getApplicationId(),
          submissionContext);

      // Create RMApp
      application =
          new RMAppImpl(applicationId, rmContext, this.conf,
            submissionContext.getApplicationName(),
            submissionContext.getUser(), submissionContext.getQueue(),
            submissionContext, clientTokenStr, appStore, this.scheduler,
            this.masterService, submitTime);
View Full Code Here

    return applicationId;
  }

  private RMAppImpl getRMApp(RMContext rmContext, YarnScheduler yarnScheduler,
      ApplicationId applicationId3, YarnConfiguration config, String queueName) {
    return new RMAppImpl(applicationId3, rmContext, config, null, null,
        queueName, null, null, null, yarnScheduler, null, System
            .currentTimeMillis());
  }
View Full Code Here

    return applicationId;
  }

  private RMAppImpl getRMApp(RMContext rmContext, YarnScheduler yarnScheduler,
      ApplicationId applicationId3, YarnConfiguration config, String queueName) {
    return new RMAppImpl(applicationId3, rmContext, config, null, null,
        queueName, null, null, null, yarnScheduler, null, System
            .currentTimeMillis());
  }
View Full Code Here

          .createApplicationStore(submissionContext.getApplicationId(),
          submissionContext);

      // Create RMApp
      application =
          new RMAppImpl(applicationId, rmContext, this.conf,
            submissionContext.getApplicationName(),
            submissionContext.getUser(), submissionContext.getQueue(),
            submissionContext, clientTokenStr, appStore, this.scheduler,
            this.masterService, submitTime);
View Full Code Here

  private RMAppImpl getRMApp(RMContext rmContext, YarnScheduler yarnScheduler,
      ApplicationId applicationId3, YarnConfiguration config, String queueName) {
    ApplicationSubmissionContext asContext = mock(ApplicationSubmissionContext.class);
    when(asContext.getMaxAppAttempts()).thenReturn(1);
    return new RMAppImpl(applicationId3, rmContext, config, null, null,
        queueName, asContext, yarnScheduler, null , System
            .currentTimeMillis(), "YARN");
  }
View Full Code Here

      }
    }

    // Create RMApp
    RMApp application =
        new RMAppImpl(applicationId, rmContext, this.conf,
            submissionContext.getApplicationName(), user,
            submissionContext.getQueue(),
            submissionContext, this.scheduler, this.masterService,
            submitTime, submissionContext.getApplicationType());
View Full Code Here

      if(shouldRecover) {
        LOG.info("Recovering application " + appState.getAppId());
        submitApplication(appState.getApplicationSubmissionContext(),
                        appState.getSubmitTime(), true, appState.getUser());
        // re-populate attempt information in application
        RMAppImpl appImpl = (RMAppImpl) rmContext.getRMApps().get(
                                                        appState.getAppId());
        appImpl.recover(state);
      }
      else {
        store.removeApplication(appState);
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppImpl$AttemptFailedTransition

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.