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.Private; 022 import org.apache.hadoop.classification.InterfaceAudience.Public; 023 import org.apache.hadoop.classification.InterfaceStability.Stable; 024 import org.apache.hadoop.classification.InterfaceStability.Unstable; 025 import 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 050 public 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 <code>ApplicationAttemptId</code> of the current 066 * attempt of the application 067 * @return <code>ApplicationAttemptId</code> of the attempt 068 */ 069 @Private 070 @Unstable 071 ApplicationAttemptId getCurrentApplicationAttemptId(); 072 073 @Private 074 @Unstable 075 void setCurrentApplicationAttemptId(ApplicationAttemptId applicationAttemptId); 076 077 /** 078 * Get the <em>user</em> who submitted the application. 079 * @return <em>user</em> who submitted the application 080 */ 081 @Public 082 @Stable 083 String getUser(); 084 085 @Private 086 @Unstable 087 void setUser(String user); 088 089 /** 090 * Get the <em>queue</em> to which the application was submitted. 091 * @return <em>queue</em> to which the application was submitted 092 */ 093 @Public 094 @Stable 095 String getQueue(); 096 097 @Private 098 @Unstable 099 void setQueue(String queue); 100 101 /** 102 * Get the user-defined <em>name</em> of the application. 103 * @return <em>name</em> of the application 104 */ 105 @Public 106 @Stable 107 String getName(); 108 109 @Private 110 @Unstable 111 void setName(String name); 112 113 /** 114 * Get the <em>host</em> on which the <code>ApplicationMaster</code> 115 * is running. 116 * @return <em>host</em> on which the <code>ApplicationMaster</code> 117 * is running 118 */ 119 @Public 120 @Stable 121 String getHost(); 122 123 @Private 124 @Unstable 125 void setHost(String host); 126 127 /** 128 * Get the <em>RPC port</em> of the <code>ApplicationMaster</code>. 129 * @return <em>RPC port</em> of the <code>ApplicationMaster</code> 130 */ 131 @Public 132 @Stable 133 int getRpcPort(); 134 135 @Private 136 @Unstable 137 void setRpcPort(int rpcPort); 138 139 /** 140 * Get the <em>client token</em> for communicating with the 141 * <code>ApplicationMaster</code>. 142 * @return <em>client token</em> for communicating with the 143 * <code>ApplicationMaster</code> 144 */ 145 @Public 146 @Stable 147 ClientToken getClientToken(); 148 149 @Private 150 @Unstable 151 void setClientToken(ClientToken clientToken); 152 153 /** 154 * Get the <code>YarnApplicationState</code> of the application. 155 * @return <code>YarnApplicationState</code> of the application 156 */ 157 @Public 158 @Stable 159 YarnApplicationState getYarnApplicationState(); 160 161 @Private 162 @Unstable 163 void setYarnApplicationState(YarnApplicationState state); 164 165 /** 166 * Get the <em>diagnositic information</em> of the application in case of 167 * errors. 168 * @return <em>diagnositic information</em> of the application in case 169 * of errors 170 */ 171 @Public 172 @Stable 173 String getDiagnostics(); 174 175 @Private 176 @Unstable 177 void setDiagnostics(String diagnostics); 178 179 /** 180 * Get the <em>tracking url</em> for the application. 181 * @return <em>tracking url</em> for the application 182 */ 183 @Public 184 @Stable 185 String getTrackingUrl(); 186 187 @Private 188 @Unstable 189 void setTrackingUrl(String url); 190 191 /** 192 * Get the original not-proxied <em>tracking url</em> for the application. 193 * This is intended to only be used by the proxy itself. 194 * @return the original not-proxied <em>tracking url</em> for the application 195 */ 196 @Private 197 @Unstable 198 String getOriginalTrackingUrl(); 199 200 @Private 201 @Unstable 202 void setOriginalTrackingUrl(String url); 203 204 /** 205 * Get the <em>start time</em> of the application. 206 * @return <em>start time</em> of the application 207 */ 208 @Public 209 @Stable 210 long getStartTime(); 211 212 @Private 213 @Unstable 214 void setStartTime(long startTime); 215 216 /** 217 * Get the <em>finish time</em> of the application. 218 * @return <em>finish time</em> of the application 219 */ 220 @Public 221 @Stable 222 long getFinishTime(); 223 224 @Private 225 @Unstable 226 void setFinishTime(long finishTime); 227 228 229 /** 230 * Get the <em>final finish status</em> of the application. 231 * @return <em>final finish status</em> of the application 232 */ 233 @Public 234 @Stable 235 FinalApplicationStatus getFinalApplicationStatus(); 236 237 @Private 238 @Unstable 239 void setFinalApplicationStatus(FinalApplicationStatus finishState); 240 241 /** 242 * Retrieve the structure containing the job resources for this application 243 * @return the job resources structure for this application 244 */ 245 @Public 246 @Stable 247 ApplicationResourceUsageReport getApplicationResourceUsageReport(); 248 249 /** 250 * Store the structure containing the job resources for this application 251 * @param appResources structure for this application 252 */ 253 @Private 254 @Unstable 255 void setApplicationResourceUsageReport(ApplicationResourceUsageReport appResources); 256 }