Beispiel #1
0
        /// <exception cref="System.IO.IOException"/>
        /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
        private int VerifyApplicationState(ApplicationId appId)
        {
            YarnClient yarnClient = CreateYarnClient();

            try
            {
                ApplicationReport appReport = yarnClient.GetApplicationReport(appId);
                switch (appReport.GetYarnApplicationState())
                {
                case YarnApplicationState.New:
                case YarnApplicationState.NewSaving:
                case YarnApplicationState.Submitted:
                {
                    return(-1);
                }

                case YarnApplicationState.Accepted:
                case YarnApplicationState.Running:
                case YarnApplicationState.Failed:
                case YarnApplicationState.Finished:
                case YarnApplicationState.Killed:
                default:
                {
                    break;
                }
                }
            }
            finally
            {
                yarnClient.Close();
            }
            return(0);
        }