Tabnine Logo
TestRMAppTransitions.testCreateAppRunning
Code IndexAdd Tabnine to your IDE (free)

How to use
testCreateAppRunning
method
in
org.apache.hadoop.yarn.server.resourcemanager.rmapp.TestRMAppTransitions

Best Java code snippets using org.apache.hadoop.yarn.server.resourcemanager.rmapp.TestRMAppTransitions.testCreateAppRunning (Showing top 12 results out of 315)

origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

protected RMApp testCreateAppFinalSaving(
  ApplicationSubmissionContext submissionContext) throws IOException {
 RMApp application = testCreateAppRunning(submissionContext);
 RMAppEvent finishingEvent =
   new RMAppEvent(application.getApplicationId(),
    RMAppEventType.ATTEMPT_UNREGISTERED);
 application.handle(finishingEvent);
 assertAppState(RMAppState.FINAL_SAVING, application);
 assertAppFinalStateSaved(application);
 return application;
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

protected RMApp testCreateAppFinalSaving(
  ApplicationSubmissionContext submissionContext) throws IOException {
 RMApp application = testCreateAppRunning(submissionContext);
 RMAppEvent finishingEvent =
   new RMAppEvent(application.getApplicationId(),
    RMAppEventType.ATTEMPT_UNREGISTERED);
 application.handle(finishingEvent);
 assertAppState(RMAppState.FINAL_SAVING, application);
 assertAppFinalStateSaved(application);
 return application;
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@Test
public void testUnmanagedApp() throws IOException {
 ApplicationSubmissionContext subContext = new ApplicationSubmissionContextPBImpl();
 subContext.setUnmanagedAM(true);
 // test success path
 LOG.info("--- START: testUnmanagedAppSuccessPath ---");
 final String diagMsg = "some diagnostics";
 RMApp application = testCreateAppFinished(subContext, diagMsg);
 Assert.assertTrue("Finished app missing diagnostics",
   application.getDiagnostics().indexOf(diagMsg) != -1);
 // reset the counter of Mockito.verify
 reset(writer);
 reset(publisher);
 // test app fails after 1 app attempt failure
 LOG.info("--- START: testUnmanagedAppFailPath ---");
 application = testCreateAppRunning(subContext);
 RMAppEvent event = new RMAppFailedAttemptEvent(
   application.getApplicationId(), RMAppEventType.ATTEMPT_FAILED, "", false);
 application.handle(event);
 rmDispatcher.await();
 RMAppAttempt appAttempt = application.getCurrentAppAttempt();
 Assert.assertEquals(1, appAttempt.getAppAttemptId().getAttemptId());
 sendAppUpdateSavedEvent(application);
 assertFailed(application,
   ".*Unmanaged application.*Failing the application.*");
 assertAppFinalStateSaved(application);
}

origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Test
public void testUnmanagedApp() throws IOException {
 ApplicationSubmissionContext subContext = new ApplicationSubmissionContextPBImpl();
 subContext.setUnmanagedAM(true);
 // test success path
 LOG.info("--- START: testUnmanagedAppSuccessPath ---");
 final String diagMsg = "some diagnostics";
 RMApp application = testCreateAppFinished(subContext, diagMsg);
 Assert.assertTrue("Finished app missing diagnostics",
   application.getDiagnostics().indexOf(diagMsg) != -1);
 // reset the counter of Mockito.verify
 reset(writer);
 reset(publisher);
 // test app fails after 1 app attempt failure
 LOG.info("--- START: testUnmanagedAppFailPath ---");
 application = testCreateAppRunning(subContext);
 RMAppEvent event = new RMAppFailedAttemptEvent(
   application.getApplicationId(), RMAppEventType.ATTEMPT_FAILED, "", false);
 application.handle(event);
 rmDispatcher.await();
 RMAppAttempt appAttempt = application.getCurrentAppAttempt();
 Assert.assertEquals(1, appAttempt.getAppAttemptId().getAttemptId());
 sendAppUpdateSavedEvent(application);
 assertFailed(application,
   ".*Unmanaged application.*Failing the application.*");
 assertAppFinalStateSaved(application);
 verifyRMAppFieldsForFinalTransitions(application);
}

origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

protected RMApp testCreateAppFinished(
  ApplicationSubmissionContext submissionContext,
  String diagnostics) throws IOException {
 // unmanaged AMs don't use the FINISHING state
 RMApp application = null;
 if (submissionContext != null && submissionContext.getUnmanagedAM()) {
  application = testCreateAppRunning(submissionContext);
 } else {
  application = testCreateAppFinishing(submissionContext);
 }
 // RUNNING/FINISHING => FINISHED event RMAppEventType.ATTEMPT_FINISHED
 RMAppEvent finishedEvent = new RMAppEvent(application.getApplicationId(),
   RMAppEventType.ATTEMPT_FINISHED, diagnostics);
 application.handle(finishedEvent);
 assertAppState(RMAppState.FINISHED, application);
 assertTimesAtFinish(application);
 // finished without a proper unregister implies failed
 assertFinalAppStatus(FinalApplicationStatus.FAILED, application);
 Assert.assertTrue("Finished app missing diagnostics",
   application.getDiagnostics().indexOf(diagnostics) != -1);
 return application;
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

protected RMApp testCreateAppFinished(
  ApplicationSubmissionContext submissionContext,
  String diagnostics) throws IOException {
 // unmanaged AMs don't use the FINISHING state
 RMApp application = null;
 if (submissionContext != null && submissionContext.getUnmanagedAM()) {
  application = testCreateAppRunning(submissionContext);
 } else {
  application = testCreateAppFinishing(submissionContext);
 }
 // RUNNING/FINISHING => FINISHED event RMAppEventType.ATTEMPT_FINISHED
 RMAppEvent finishedEvent = new RMAppEvent(application.getApplicationId(),
   RMAppEventType.ATTEMPT_FINISHED, diagnostics);
 application.handle(finishedEvent);
 assertAppState(RMAppState.FINISHED, application);
 assertTimesAtFinish(application);
 // finished without a proper unregister implies failed
 assertFinalAppStatus(FinalApplicationStatus.FAILED, application);
 Assert.assertTrue("Finished app missing diagnostics",
   application.getDiagnostics().indexOf(diagnostics) != -1);
 return application;
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@Test
public void testAppRunningKill() throws IOException {
 LOG.info("--- START: testAppRunningKill ---");
 UserGroupInformation fooUser = UserGroupInformation.createUserForTesting(
   "fooTestAppRunningKill", new String[] { "foo_group" });
 RMApp application = testCreateAppRunning(null);
 // RUNNING => KILLED event RMAppEventType.KILL
 RMAppEvent event = new RMAppKillByClientEvent(
   application.getApplicationId(), "Application killed by user.", fooUser,
   Server.getRemoteIp());
 application.handle(event);
 rmDispatcher.await();
 sendAttemptUpdateSavedEvent(application);
 sendAppUpdateSavedEvent(application);
 assertKilled(application);
 verifyApplicationFinished(RMAppState.KILLED);
 verifyAppRemovedSchedulerEvent(RMAppState.KILLED);
}
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Test
public void testAppRunningKill() throws IOException {
 LOG.info("--- START: testAppRunningKill ---");
 RMApp application = testCreateAppRunning(null);
 // RUNNING => KILLED event RMAppEventType.KILL
 UserGroupInformation fooUser = UserGroupInformation.createUserForTesting(
   "fooTestAppRunningKill", new String[] {"foo_group"});
 // SUBMITTED => KILLED event RMAppEventType.KILL
 RMAppEvent event = new RMAppKillByClientEvent(
   application.getApplicationId(), "Application killed by user.", fooUser,
   Server.getRemoteIp());
 application.handle(event);
 rmDispatcher.await();
 sendAttemptUpdateSavedEvent(application);
 sendAppUpdateSavedEvent(application);
 assertKilled(application);
 verifyApplicationFinished(RMAppState.KILLED);
 verifyAppRemovedSchedulerEvent(RMAppState.KILLED);
 verifyRMAppFieldsForFinalTransitions(application);
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

UserGroupInformation fooUser = UserGroupInformation.createUserForTesting(
  "fooTestAppKilledKill", new String[] { "foo_group" });
RMApp application = testCreateAppRunning(null);
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

LOG.info("--- START: testAppKilledKilled ---");
RMApp application = testCreateAppRunning(null);
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

LOG.info("--- START: testAppRunningFailed ---");
RMApp application = testCreateAppRunning(null);
RMAppAttempt appAttempt = application.getCurrentAppAttempt();
int expectedAttemptId = 1;
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

LOG.info("--- START: testAppRunningFailed ---");
RMApp application = testCreateAppRunning(null);
RMAppAttempt appAttempt = application.getCurrentAppAttempt();
int expectedAttemptId = 1;
org.apache.hadoop.yarn.server.resourcemanager.rmappTestRMAppTransitionstestCreateAppRunning

Popular methods of TestRMAppTransitions

  • assertAppFinalStateNotSaved
  • assertAppFinalStateSaved
  • assertAppState
  • assertFailed
  • assertFinalAppStatus
  • assertKilled
  • assertStartTimeSet
  • assertTimesAtFinish
  • createNewTestApp
  • createRMStateForApplications
  • sendAppUpdateSavedEvent
  • sendAttemptUpdateSavedEvent
  • sendAppUpdateSavedEvent,
  • sendAttemptUpdateSavedEvent,
  • testAppStartState,
  • testCreateAppAccepted,
  • testCreateAppFinalSaving,
  • testCreateAppFinished,
  • testCreateAppFinishing,
  • testCreateAppNewSaving,
  • testCreateAppSubmittedNoRecovery

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • setScale (BigDecimal)
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now