Exemplo n.º 1
0
        /// <exception cref="System.Exception"/>
        public static MockAM LaunchAM(RMApp app, Org.Apache.Hadoop.Yarn.Server.Resourcemanager.MockRM
                                      rm, MockNM nm)
        {
            rm.WaitForState(app.GetApplicationId(), RMAppState.Accepted);
            RMAppAttempt attempt = app.GetCurrentAppAttempt();

            System.Console.Out.WriteLine("Launch AM " + attempt.GetAppAttemptId());
            nm.NodeHeartbeat(true);
            MockAM am = rm.SendAMLaunched(attempt.GetAppAttemptId());

            rm.WaitForState(attempt.GetAppAttemptId(), RMAppAttemptState.Launched);
            return(am);
        }
Exemplo n.º 2
0
        /// <exception cref="System.Exception"/>
        public static MockAM LaunchAndRegisterAM(RMApp app, Org.Apache.Hadoop.Yarn.Server.Resourcemanager.MockRM
                                                 rm, MockNM nm)
        {
            MockAM am = LaunchAM(app, rm, nm);

            am.RegisterAppAttempt();
            rm.WaitForState(app.GetApplicationId(), RMAppState.Running);
            return(am);
        }
Exemplo n.º 3
0
        // Disable webapp
        /// <exception cref="System.Exception"/>
        public static void FinishAMAndVerifyAppState(RMApp rmApp, Org.Apache.Hadoop.Yarn.Server.Resourcemanager.MockRM
                                                     rm, MockNM nm, MockAM am)
        {
            FinishApplicationMasterRequest req = FinishApplicationMasterRequest.NewInstance(FinalApplicationStatus
                                                                                            .Succeeded, string.Empty, string.Empty);

            am.UnregisterAppAttempt(req, true);
            am.WaitForState(RMAppAttemptState.Finishing);
            nm.NodeHeartbeat(am.GetApplicationAttemptId(), 1, ContainerState.Complete);
            am.WaitForState(RMAppAttemptState.Finished);
            rm.WaitForState(rmApp.GetApplicationId(), RMAppState.Finished);
        }