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.Unstable; 024import org.apache.hadoop.yarn.util.Records; 025 026/** 027 * {@code ApplicationAttemptReport} is a report of an application attempt. 028 * <p> 029 * It includes details such as: 030 * <ul> 031 * <li>{@link ApplicationAttemptId} of the application.</li> 032 * <li>Host on which the <code>ApplicationMaster</code> of this attempt is 033 * running.</li> 034 * <li>RPC port of the <code>ApplicationMaster</code> of this attempt.</li> 035 * <li>Tracking URL.</li> 036 * <li>Diagnostic information in case of errors.</li> 037 * <li>{@link YarnApplicationAttemptState} of the application attempt.</li> 038 * <li>{@link ContainerId} of the master Container.</li> 039 * </ul> 040 */ 041@Public 042@Unstable 043public abstract class ApplicationAttemptReport { 044 045 @Private 046 @Unstable 047 public static ApplicationAttemptReport newInstance( 048 ApplicationAttemptId applicationAttemptId, String host, int rpcPort, 049 String url, String oUrl, String diagnostics, 050 YarnApplicationAttemptState state, ContainerId amContainerId) { 051 ApplicationAttemptReport report = 052 Records.newRecord(ApplicationAttemptReport.class); 053 report.setApplicationAttemptId(applicationAttemptId); 054 report.setHost(host); 055 report.setRpcPort(rpcPort); 056 report.setTrackingUrl(url); 057 report.setOriginalTrackingUrl(oUrl); 058 report.setDiagnostics(diagnostics); 059 report.setYarnApplicationAttemptState(state); 060 report.setAMContainerId(amContainerId); 061 return report; 062 } 063 064 /** 065 * Get the <em>YarnApplicationAttemptState</em> of the application attempt. 066 * 067 * @return <em>YarnApplicationAttemptState</em> of the application attempt 068 */ 069 @Public 070 @Unstable 071 public abstract YarnApplicationAttemptState getYarnApplicationAttemptState(); 072 073 @Private 074 @Unstable 075 public abstract void setYarnApplicationAttemptState( 076 YarnApplicationAttemptState yarnApplicationAttemptState); 077 078 /** 079 * Get the <em>RPC port</em> of this attempt <code>ApplicationMaster</code>. 080 * 081 * @return <em>RPC port</em> of this attempt <code>ApplicationMaster</code> 082 */ 083 @Public 084 @Unstable 085 public abstract int getRpcPort(); 086 087 @Private 088 @Unstable 089 public abstract void setRpcPort(int rpcPort); 090 091 /** 092 * Get the <em>host</em> on which this attempt of 093 * <code>ApplicationMaster</code> is running. 094 * 095 * @return <em>host</em> on which this attempt of 096 * <code>ApplicationMaster</code> is running 097 */ 098 @Public 099 @Unstable 100 public abstract String getHost(); 101 102 @Private 103 @Unstable 104 public abstract void setHost(String host); 105 106 /** 107 * Get the <em>diagnositic information</em> of the application attempt in case 108 * of errors. 109 * 110 * @return <em>diagnositic information</em> of the application attempt in case 111 * of errors 112 */ 113 @Public 114 @Unstable 115 public abstract String getDiagnostics(); 116 117 @Private 118 @Unstable 119 public abstract void setDiagnostics(String diagnostics); 120 121 /** 122 * Get the <em>tracking url</em> for the application attempt. 123 * 124 * @return <em>tracking url</em> for the application attempt 125 */ 126 @Public 127 @Unstable 128 public abstract String getTrackingUrl(); 129 130 @Private 131 @Unstable 132 public abstract void setTrackingUrl(String url); 133 134 /** 135 * Get the <em>original tracking url</em> for the application attempt. 136 * 137 * @return <em>original tracking url</em> for the application attempt 138 */ 139 @Public 140 @Unstable 141 public abstract String getOriginalTrackingUrl(); 142 143 @Private 144 @Unstable 145 public abstract void setOriginalTrackingUrl(String oUrl); 146 147 /** 148 * Get the <code>ApplicationAttemptId</code> of this attempt of the 149 * application 150 * 151 * @return <code>ApplicationAttemptId</code> of the attempt 152 */ 153 @Public 154 @Unstable 155 public abstract ApplicationAttemptId getApplicationAttemptId(); 156 157 @Private 158 @Unstable 159 public abstract void setApplicationAttemptId( 160 ApplicationAttemptId applicationAttemptId); 161 162 /** 163 * Get the <code>ContainerId</code> of AMContainer for this attempt 164 * 165 * @return <code>ContainerId</code> of the attempt 166 */ 167 @Public 168 @Unstable 169 public abstract ContainerId getAMContainerId(); 170 171 @Private 172 @Unstable 173 public abstract void setAMContainerId(ContainerId amContainerId); 174}