/// <exception cref="System.Exception"/> public virtual void TestGetApplicationAttemptReportOnHA() { ApplicationAttemptReport report = client.GetApplicationAttemptReport(cluster.CreateFakeApplicationAttemptId ()); NUnit.Framework.Assert.IsTrue(report != null); NUnit.Framework.Assert.AreEqual(cluster.CreateFakeApplicationAttemptReport(), report ); }
/// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/> /// <exception cref="System.IO.IOException"/> private ApplicationAttemptReport MonitorCurrentAppAttempt(ApplicationId appId, YarnApplicationAttemptState attemptState) { long startTime = Runtime.CurrentTimeMillis(); ApplicationAttemptId attemptId = null; while (true) { if (attemptId == null) { attemptId = rmClient.GetApplicationReport(appId).GetCurrentApplicationAttemptId(); } ApplicationAttemptReport attemptReport = null; if (attemptId != null) { attemptReport = rmClient.GetApplicationAttemptReport(attemptId); if (attemptState.Equals(attemptReport.GetYarnApplicationAttemptState())) { return(attemptReport); } } Log.Info("Current attempt state of " + appId + " is " + (attemptReport == null ? " N/A " : attemptReport.GetYarnApplicationAttemptState()) + ", waiting for current attempt to reach " + attemptState); try { Sharpen.Thread.Sleep(1000); } catch (Exception) { Log.Warn("Interrupted while waiting for current attempt of " + appId + " to reach " + attemptState); } if (Runtime.CurrentTimeMillis() - startTime > AmStateWaitTimeoutMs) { string errmsg = "Timeout for waiting current attempt of " + appId + " to reach " + attemptState; Log.Error(errmsg); throw new RuntimeException(errmsg); } } }
/// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/> /// <exception cref="System.IO.IOException"/> public override ApplicationAttemptReport GetApplicationAttemptReport(ApplicationAttemptId appAttemptId) { return(client.GetApplicationAttemptReport(appAttemptId)); }