001 /** 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018 019 package org.apache.hadoop.yarn.api.records; 020 021 import org.apache.hadoop.classification.InterfaceAudience.Public; 022 import org.apache.hadoop.classification.InterfaceStability.Stable; 023 import org.apache.hadoop.yarn.api.ClientRMProtocol; 024 025 /** 026 * <p><code>ApplicationSubmissionContext</code> represents the all of the 027 * information needed by the <code>ResourceManager</code> to launch 028 * the <code>ApplicationMaster</code> for an application.</p> 029 * 030 * <p>It includes details such as: 031 * <ul> 032 * <li>{@link ApplicationId} of the application.</li> 033 * <li>Application user.</li> 034 * <li>Application name.</li> 035 * <li>{@link Priority} of the application.</li> 036 * <li> 037 * {@link ContainerLaunchContext} of the container in which the 038 * <code>ApplicationMaster</code> is executed. 039 * </li> 040 * </ul> 041 * </p> 042 * 043 * @see ContainerLaunchContext 044 * @see ClientRMProtocol#submitApplication(org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationRequest) 045 */ 046 @Public 047 @Stable 048 public interface ApplicationSubmissionContext { 049 /** 050 * Get the <code>ApplicationId</code> of the submitted application. 051 * @return <code>ApplicationId</code> of the submitted application 052 */ 053 @Public 054 @Stable 055 public ApplicationId getApplicationId(); 056 057 /** 058 * Set the <code>ApplicationId</code> of the submitted application. 059 * @param appplicationId <code>ApplicationId</code> of the submitted 060 * application 061 */ 062 @Public 063 @Stable 064 public void setApplicationId(ApplicationId appplicationId); 065 066 /** 067 * Get the application <em>name</em>. 068 * @return application name 069 */ 070 @Public 071 @Stable 072 public String getApplicationName(); 073 074 /** 075 * Set the application <em>name</em>. 076 * @param applicationName application name 077 */ 078 @Public 079 @Stable 080 public void setApplicationName(String applicationName); 081 082 /** 083 * Get the <em>queue</em> to which the application is being submitted. 084 * @return <em>queue</em> to which the application is being submitted 085 */ 086 @Public 087 @Stable 088 public String getQueue(); 089 090 /** 091 * Set the <em>queue</em> to which the application is being submitted 092 * @param queue <em>queue</em> to which the application is being submitted 093 */ 094 @Public 095 @Stable 096 public void setQueue(String queue); 097 098 /** 099 * Get the <code>Priority</code> of the application. 100 * @return <code>Priority</code> of the application 101 */ 102 @Public 103 @Stable 104 public Priority getPriority(); 105 106 /** 107 * Set the <code>Priority</code> of the application. 108 * @param priority <code>Priority</code> of the application 109 */ 110 @Public 111 @Stable 112 public void setPriority(Priority priority); 113 114 /** 115 * Get the <em>user</em> submitting the application. 116 * @return <em>user</em> submitting the application 117 */ 118 @Public 119 @Stable 120 public String getUser(); 121 122 /** 123 * Set the <em>user</em> submitting the application. 124 * @param user <em>user</em> submitting the application 125 */ 126 @Public 127 @Stable 128 public void setUser(String user); 129 130 /** 131 * Get the <code>ContainerLaunchContext</code> to describe the 132 * <code>Container</code> with which the <code>ApplicationMaster</code> is 133 * launched. 134 * @return <code>ContainerLaunchContext</code> for the 135 * <code>ApplicationMaster</code> container 136 */ 137 @Public 138 @Stable 139 public ContainerLaunchContext getAMContainerSpec(); 140 141 /** 142 * Set the <code>ContainerLaunchContext</code> to describe the 143 * <code>Container</code> with which the <code>ApplicationMaster</code> is 144 * launched. 145 * @param amContainer <code>ContainerLaunchContext</code> for the 146 * <code>ApplicationMaster</code> container 147 */ 148 @Public 149 @Stable 150 public void setAMContainerSpec(ContainerLaunchContext amContainer); 151 }