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
019package org.apache.hadoop.yarn.api.records;
020
021import org.apache.hadoop.classification.InterfaceAudience.Private;
022import org.apache.hadoop.classification.InterfaceAudience.Public;
023import org.apache.hadoop.classification.InterfaceStability.Stable;
024import org.apache.hadoop.classification.InterfaceStability.Unstable;
025import org.apache.hadoop.yarn.api.ClientRMProtocol;
026
027/**
028 * <p><code>ApplicationReport</code> is a report of an application.</p>
029 *
030 * <p>It includes details such as:
031 *   <ul>
032 *     <li>{@link ApplicationId} of the application.</li>
033 *     <li>Applications user.</li>
034 *     <li>Application queue.</li>
035 *     <li>Application name.</li>
036 *     <li>Host on which the <code>ApplicationMaster</code> is running.</li>
037 *     <li>RPC port of the <code>ApplicationMaster</code>.</li>
038 *     <li>Tracking URL.</li>
039 *     <li>{@link YarnApplicationState} of the application.</li>
040 *     <li>Diagnostic information in case of errors.</li>
041 *     <li>Start time of the application.</li>
042 *     <li>Client token of the application (if security is enabled).</li>
043 *   </ul>
044 * </p>
045 *
046 * @see ClientRMProtocol#getApplicationReport(org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest)
047 */
048@Public
049@Stable
050public interface ApplicationReport {
051
052  /**
053   * Get the <code>ApplicationId</code> of the application.
054   * @return <code>ApplicationId</code> of the application
055   */
056  @Public
057  @Stable
058  ApplicationId getApplicationId();
059
060  @Private
061  @Unstable
062  void setApplicationId(ApplicationId applicationId);
063
064  /**
065   * Get the <em>user</em> who submitted the application.
066   * @return <em>user</em> who submitted the application
067   */
068  @Public
069  @Stable
070  String getUser();
071
072  @Private
073  @Unstable
074  void setUser(String user);
075
076  /**
077   * Get the <em>queue</em> to which the application was submitted.
078   * @return <em>queue</em> to which the application was submitted
079   */
080  @Public
081  @Stable
082  String getQueue();
083
084  @Private
085  @Unstable
086  void setQueue(String queue);
087
088  /**
089   * Get the user-defined <em>name</em> of the application.
090   * @return <em>name</em> of the application
091   */
092  @Public
093  @Stable
094  String getName();
095
096  @Private
097  @Unstable
098  void setName(String name);
099
100  /**
101   * Get the <em>host</em> on which the <code>ApplicationMaster</code>
102   * is running.
103   * @return <em>host</em> on which the <code>ApplicationMaster</code>
104   *         is running
105   */
106  @Public
107  @Stable
108  String getHost();
109
110  @Private
111  @Unstable
112  void setHost(String host);
113
114  /**
115   * Get the <em>RPC port</em> of the <code>ApplicationMaster</code>.
116   * @return <em>RPC port</em> of the <code>ApplicationMaster</code>
117   */
118  @Public
119  @Stable
120  int getRpcPort();
121
122  @Private
123  @Unstable
124  void setRpcPort(int rpcPort);
125
126  /**
127   * Get the <em>client token</em> for communicating with the
128   * <code>ApplicationMaster</code>.
129   * @return <em>client token</em> for communicating with the
130   * <code>ApplicationMaster</code>
131   */
132  @Public
133  @Stable
134  String getClientToken();
135
136  @Private
137  @Unstable
138  void setClientToken(String clientToken);
139
140  /**
141   * Get the <code>YarnApplicationState</code> of the application.
142   * @return <code>YarnApplicationState</code> of the application
143   */
144  @Public
145  @Stable
146  YarnApplicationState getYarnApplicationState();
147
148  @Private
149  @Unstable
150  void setYarnApplicationState(YarnApplicationState state);
151
152  /**
153   * Get  the <em>diagnositic information</em> of the application in case of
154   * errors.
155   * @return <em>diagnositic information</em> of the application in case
156   *         of errors
157   */
158  @Public
159  @Stable
160  String getDiagnostics();
161
162  @Private
163  @Unstable
164  void setDiagnostics(String diagnostics);
165
166  /**
167   * Get the <em>tracking url</em> for the application.
168   * @return <em>tracking url</em> for the application
169   */
170  @Public
171  @Stable
172  String getTrackingUrl();
173
174  @Private
175  @Unstable
176  void setTrackingUrl(String url);
177  
178  /**
179   * Get the original not-proxied <em>tracking url</em> for the application.
180   * This is intended to only be used by the proxy itself.
181   * @return the original not-proxied <em>tracking url</em> for the application
182   */
183  @Private
184  @Unstable
185  String getOriginalTrackingUrl();
186
187  @Private
188  @Unstable
189  void setOriginalTrackingUrl(String url);
190
191  /**
192   * Get the <em>start time</em> of the application.
193   * @return <em>start time</em> of the application
194   */
195  @Public
196  @Stable
197  long getStartTime();
198
199  @Private
200  @Unstable
201  void setStartTime(long startTime);
202
203  /**
204   * Get the <em>finish time</em> of the application.
205   * @return <em>finish time</em> of the application
206   */
207  @Public
208  @Stable
209  long getFinishTime();
210
211  @Private
212  @Unstable
213  void setFinishTime(long finishTime);
214
215
216  /**
217   * Get the <em>final finish status</em> of the application.
218   * @return <em>final finish status</em> of the application
219   */
220  @Public
221  @Stable
222  FinalApplicationStatus getFinalApplicationStatus();
223
224  @Private
225  @Unstable
226  void setFinalApplicationStatus(FinalApplicationStatus finishState);
227
228  /**
229   * Retrieve the structure containing the job resources for this application
230   * @return the job resources structure for this application
231   */
232  @Public
233  @Stable
234  ApplicationResourceUsageReport getApplicationResourceUsageReport();
235
236  /**
237   * Store the structure containing the job resources for this application
238   * @param appResources structure for this application
239   */
240  @Private
241  @Unstable
242  void setApplicationResourceUsageReport(ApplicationResourceUsageReport appResources);
243}