public static ContainerLaunchContext NewInstance(IDictionary <string, LocalResource
                                                                      > localResources, IDictionary <string, string> environment, IList <string> commands
                                                         , IDictionary <string, ByteBuffer> serviceData, ByteBuffer tokens, IDictionary <ApplicationAccessType
                                                                                                                                         , string> acls)
        {
            ContainerLaunchContext container = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <
                ContainerLaunchContext>();

            container.SetLocalResources(localResources);
            container.SetEnvironment(environment);
            container.SetCommands(commands);
            container.SetServiceData(serviceData);
            container.SetTokens(tokens);
            container.SetApplicationACLs(acls);
            return(container);
        }
 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)
 {
     return(NewInstance(applicationId, applicationName, queue, priority, amContainer,
                        isUnmanagedAM, cancelTokensWhenComplete, maxAppAttempts, resource, applicationType
                        , keepContainers, null, null));
 }
        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, string appLabelExpression
                                                               , string amContainerLabelExpression)
        {
            ApplicationSubmissionContext context = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord
                                                   <ApplicationSubmissionContext>();

            context.SetApplicationId(applicationId);
            context.SetApplicationName(applicationName);
            context.SetQueue(queue);
            context.SetPriority(priority);
            context.SetAMContainerSpec(amContainer);
            context.SetUnmanagedAM(isUnmanagedAM);
            context.SetCancelTokensWhenComplete(cancelTokensWhenComplete);
            context.SetMaxAppAttempts(maxAppAttempts);
            context.SetApplicationType(applicationType);
            context.SetKeepContainersAcrossApplicationAttempts(keepContainers);
            context.SetNodeLabelExpression(appLabelExpression);
            context.SetResource(resource);
            ResourceRequest amReq = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <ResourceRequest
                                                                                   >();

            amReq.SetResourceName(ResourceRequest.Any);
            amReq.SetCapability(resource);
            amReq.SetNumContainers(1);
            amReq.SetRelaxLocality(true);
            amReq.SetNodeLabelExpression(amContainerLabelExpression);
            context.SetAMContainerResourceRequest(amReq);
            return(context);
        }
 public abstract void SetAMContainerSpec(ContainerLaunchContext amContainer);
        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);
        }
        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);
        }