Esempio n. 1
0
        public static ApplicationReport NewApplicationReport(ApplicationId applicationId,
                                                             ApplicationAttemptId applicationAttemptId, string user, string queue, string name
                                                             , string host, int rpcPort, Org.Apache.Hadoop.Yarn.Api.Records.Token clientToAMToken
                                                             , YarnApplicationState state, string diagnostics, string url, long startTime, long
                                                             finishTime, FinalApplicationStatus finalStatus, ApplicationResourceUsageReport
                                                             appResources, string origTrackingUrl, float progress, string appType, Org.Apache.Hadoop.Yarn.Api.Records.Token
                                                             amRmToken, ICollection <string> tags)
        {
            ApplicationReport report = recordFactory.NewRecordInstance <ApplicationReport>();

            report.SetApplicationId(applicationId);
            report.SetCurrentApplicationAttemptId(applicationAttemptId);
            report.SetUser(user);
            report.SetQueue(queue);
            report.SetName(name);
            report.SetHost(host);
            report.SetRpcPort(rpcPort);
            report.SetClientToAMToken(clientToAMToken);
            report.SetYarnApplicationState(state);
            report.SetDiagnostics(diagnostics);
            report.SetTrackingUrl(url);
            report.SetStartTime(startTime);
            report.SetFinishTime(finishTime);
            report.SetFinalApplicationStatus(finalStatus);
            report.SetApplicationResourceUsageReport(appResources);
            report.SetOriginalTrackingUrl(origTrackingUrl);
            report.SetProgress(progress);
            report.SetApplicationType(appType);
            report.SetAMRMToken(amRmToken);
            report.SetApplicationTags(tags);
            return(report);
        }
        public virtual void TestApplicationReport()
        {
            long timestamp = Runtime.CurrentTimeMillis();
            ApplicationReport appReport1 = CreateApplicationReport(1, 1, timestamp);
            ApplicationReport appReport2 = CreateApplicationReport(1, 1, timestamp);
            ApplicationReport appReport3 = CreateApplicationReport(1, 1, timestamp);

            NUnit.Framework.Assert.AreEqual(appReport1, appReport2);
            NUnit.Framework.Assert.AreEqual(appReport2, appReport3);
            appReport1.SetApplicationId(null);
            NUnit.Framework.Assert.IsNull(appReport1.GetApplicationId());
            NUnit.Framework.Assert.AreNotSame(appReport1, appReport2);
            appReport2.SetCurrentApplicationAttemptId(null);
            NUnit.Framework.Assert.IsNull(appReport2.GetCurrentApplicationAttemptId());
            NUnit.Framework.Assert.AreNotSame(appReport2, appReport3);
            NUnit.Framework.Assert.IsNull(appReport1.GetAMRMToken());
        }