コード例 #1
0
        public static ApplicationReport NewInstance(ApplicationId applicationId, ApplicationAttemptId
                                                    applicationAttemptId, string user, string queue, string name, string host, int
                                                    rpcPort, Token clientToAMToken, YarnApplicationState state, string diagnostics,
                                                    string url, long startTime, long finishTime, FinalApplicationStatus finalStatus,
                                                    ApplicationResourceUsageReport appResources, string origTrackingUrl, float progress
                                                    , string applicationType, Token amRmToken)
        {
            ApplicationReport report = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <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(applicationType);
            report.SetAMRMToken(amRmToken);
            return(report);
        }
コード例 #2
0
ファイル: ContainerId.cs プロジェクト: orf53975/hadoop.net
        public static ContainerId NewInstance(ApplicationAttemptId appAttemptId, int containerId
                                              )
        {
            ContainerId id = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <ContainerId>();

            id.SetContainerId(containerId);
            id.SetApplicationAttemptId(appAttemptId);
            id.Build();
            return(id);
        }
コード例 #3
0
ファイル: ContainerId.cs プロジェクト: orf53975/hadoop.net
        /// <exception cref="System.FormatException"/>
        private static ApplicationAttemptId ToApplicationAttemptId(long clusterTimestamp,
                                                                   IEnumerator <string> it)
        {
            ApplicationId appId = ApplicationId.NewInstance(clusterTimestamp, System.Convert.ToInt32
                                                                (it.Next()));
            ApplicationAttemptId appAttemptId = ApplicationAttemptId.NewInstance(appId, System.Convert.ToInt32
                                                                                     (it.Next()));

            return(appAttemptId);
        }
コード例 #4
0
        public static ApplicationAttemptReport NewInstance(ApplicationAttemptId applicationAttemptId
                                                           , string host, int rpcPort, string url, string oUrl, string diagnostics, YarnApplicationAttemptState
                                                           state, ContainerId amContainerId)
        {
            ApplicationAttemptReport report = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <ApplicationAttemptReport
                                                                                             >();

            report.SetApplicationAttemptId(applicationAttemptId);
            report.SetHost(host);
            report.SetRpcPort(rpcPort);
            report.SetTrackingUrl(url);
            report.SetOriginalTrackingUrl(oUrl);
            report.SetDiagnostics(diagnostics);
            report.SetYarnApplicationAttemptState(state);
            report.SetAMContainerId(amContainerId);
            return(report);
        }
コード例 #5
0
ファイル: ContainerId.cs プロジェクト: orf53975/hadoop.net
        public static ContainerId FromString(string containerIdStr)
        {
            IEnumerator <string> it = Splitter.Split(containerIdStr).GetEnumerator();

            if (!it.Next().Equals(ContainerPrefix))
            {
                throw new ArgumentException("Invalid ContainerId prefix: " + containerIdStr);
            }
            try
            {
                string epochOrClusterTimestampStr = it.Next();
                long   epoch = 0;
                ApplicationAttemptId appAttemptID = null;
                if (epochOrClusterTimestampStr.StartsWith(EpochPrefix))
                {
                    string epochStr = epochOrClusterTimestampStr;
                    epoch = System.Convert.ToInt32(Sharpen.Runtime.Substring(epochStr, EpochPrefix.Length
                                                                             ));
                    appAttemptID = ToApplicationAttemptId(it);
                }
                else
                {
                    string clusterTimestampStr = epochOrClusterTimestampStr;
                    long   clusterTimestamp    = long.Parse(clusterTimestampStr);
                    appAttemptID = ToApplicationAttemptId(clusterTimestamp, it);
                }
                long        id          = long.Parse(it.Next());
                long        cid         = (epoch << 40) | id;
                ContainerId containerId = ContainerId.NewContainerId(appAttemptID, cid);
                return(containerId);
            }
            catch (FormatException n)
            {
                throw new ArgumentException("Invalid ContainerId: " + containerIdStr, n);
            }
            catch (NoSuchElementException e)
            {
                throw new ArgumentException("Invalid ContainerId: " + containerIdStr, e);
            }
        }
コード例 #6
0
ファイル: ContainerId.cs プロジェクト: orf53975/hadoop.net
 protected internal abstract void SetApplicationAttemptId(ApplicationAttemptId atId
                                                          );
コード例 #7
0
 public abstract void SetCurrentApplicationAttemptId(ApplicationAttemptId applicationAttemptId
                                                     );