public static ApplicationSubmissionContext NewInstance(ApplicationId applicationId
                                                        , string applicationName, string queue, Priority priority, ContainerLaunchContext
                                                        amContainer, bool isUnmanagedAM, bool cancelTokensWhenComplete, int maxAppAttempts
                                                        , Resource resource)
 {
     return(NewInstance(applicationId, applicationName, queue, priority, amContainer,
                        isUnmanagedAM, cancelTokensWhenComplete, maxAppAttempts, resource, null));
 }
Пример #2
0
        /// <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);
        }
Пример #3
0
        public override int GetHashCode()
        {
            // Generated by eclipse.
            int           prime  = 347671;
            int           result = 5501;
            ApplicationId appId  = GetApplicationId();

            result = prime * result + appId.GetHashCode();
            result = prime * result + GetAttemptId();
            return(result);
        }
Пример #4
0
        public static ApplicationAttemptId NewInstance(ApplicationId appId, int attemptId
                                                       )
        {
            ApplicationAttemptId appAttemptId = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord
                                                <ApplicationAttemptId>();

            appAttemptId.SetApplicationId(appId);
            appAttemptId.SetAttemptId(attemptId);
            appAttemptId.Build();
            return(appAttemptId);
        }
        public static ApplicationSubmissionContext NewInstance(ApplicationId applicationId
                                                               , string applicationName, string queue, Priority priority, ContainerLaunchContext
                                                               amContainer, bool isUnmanagedAM, bool cancelTokensWhenComplete, int maxAppAttempts
                                                               , Resource resource, string applicationType, bool keepContainers, LogAggregationContext
                                                               logAggregationContext)
        {
            ApplicationSubmissionContext context = NewInstance(applicationId, applicationName
                                                               , queue, priority, amContainer, isUnmanagedAM, cancelTokensWhenComplete, maxAppAttempts
                                                               , resource, applicationType, keepContainers);

            context.SetLogAggregationContext(logAggregationContext);
            return(context);
        }
Пример #6
0
        /// <returns>
        /// A string representation of containerId. The format is
        /// container_e*epoch*_*clusterTimestamp*_*appId*_*attemptId*_*containerId
        /// when epoch is larger than 0
        /// (e.g. container_e17_1410901177871_0001_01_000005).
        /// *epoch* is increased when RM restarts or fails over.
        /// When epoch is 0, epoch is omitted
        /// (e.g. container_1410901177871_0001_01_000005).
        /// </returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(ContainerPrefix + "_");
            long epoch = GetContainerId() >> 40;

            if (epoch > 0)
            {
                sb.Append(EpochPrefix).Append(appAttemptIdAndEpochFormat.Get().Format(epoch)).Append
                    ("_");
            }
            ApplicationId appId = GetApplicationAttemptId().GetApplicationId();

            sb.Append(appId.GetClusterTimestamp()).Append("_");
            sb.Append(ApplicationId.appIdFormat.Get().Format(appId.GetId())).Append("_");
            sb.Append(appAttemptIdAndEpochFormat.Get().Format(GetApplicationAttemptId().GetAttemptId
                                                                  ())).Append("_");
            sb.Append(containerIdFormat.Get().Format(ContainerIdBitmask & GetContainerId()));
            return(sb.ToString());
        }
        public static ApplicationSubmissionContext NewInstance(ApplicationId applicationId
                                                               , string applicationName, string queue, ContainerLaunchContext amContainer, bool
                                                               isUnmanagedAM, bool cancelTokensWhenComplete, int maxAppAttempts, string applicationType
                                                               , bool keepContainers, string appLabelExpression, ResourceRequest resourceRequest
                                                               )
        {
            ApplicationSubmissionContext context = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord
                                                   <ApplicationSubmissionContext>();

            context.SetApplicationId(applicationId);
            context.SetApplicationName(applicationName);
            context.SetQueue(queue);
            context.SetAMContainerSpec(amContainer);
            context.SetUnmanagedAM(isUnmanagedAM);
            context.SetCancelTokensWhenComplete(cancelTokensWhenComplete);
            context.SetMaxAppAttempts(maxAppAttempts);
            context.SetApplicationType(applicationType);
            context.SetKeepContainersAcrossApplicationAttempts(keepContainers);
            context.SetNodeLabelExpression(appLabelExpression);
            context.SetAMContainerResourceRequest(resourceRequest);
            return(context);
        }
Пример #8
0
 protected internal abstract void SetApplicationId(ApplicationId appID);
 public abstract void SetApplicationId(ApplicationId applicationId);