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.protocolrecords;
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.AMRMProtocol;
026    import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
027    
028    /**
029     * <p>The request sent by the <code>ApplicationMaster</code> to 
030     * <code>ResourceManager</code> on registration.</p>
031     * 
032     * <p>The registration includes details such as:
033     *   <ul>
034     *     <li>
035     *         {@link ApplicationAttemptId} being managed by the 
036     *         <code>ApplicationMaster</code>
037     *     </li>
038     *     <li>Hostname on which the AM is running.</li>
039     *     <li>RPC Port</li>
040     *     <li>Tracking URL</li>
041     *   </ul>
042     * </p>
043     * 
044     * @see AMRMProtocol#registerApplicationMaster(RegisterApplicationMasterRequest)
045     */
046    @Public
047    @Stable
048    public interface RegisterApplicationMasterRequest {
049    
050      /**
051       * Get the <code>ApplicationAttemptId</code> being managed by the 
052       * <code>ApplicationMaster</code>.
053       * @return <code>ApplicationAttemptId</code> being managed by the 
054       *         <code>ApplicationMaster</code>
055       */
056      @Public
057      @Stable
058      ApplicationAttemptId getApplicationAttemptId();
059      
060      /**
061       * Set the <code>ApplicationAttemptId</code> being managed by the 
062       * <code>ApplicationMaster</code>.
063       * @param applicationAttemptId <code>ApplicationAttemptId</code> being managed  
064       *                             by the <code>ApplicationMaster</code>
065       */
066      @Public
067      @Stable
068      void setApplicationAttemptId(ApplicationAttemptId applicationAttemptId);
069    
070      /**
071       * Get the <em>host</em> on which the <code>ApplicationMaster</code> is 
072       * running.
073       * @return <em>host</em> on which the <code>ApplicationMaster</code> is running
074       */
075      @Public
076      @Stable
077      String getHost();
078      
079      /**
080       * Set the <em>host</em> on which the <code>ApplicationMaster</code> is 
081       * running.
082       * @param host <em>host</em> on which the <code>ApplicationMaster</code> 
083       *             is running
084       */
085      @Private
086      @Unstable
087      void setHost(String host);
088    
089      /**
090       * Get the <em>RPC port</em> on which the <code>ApplicationMaster</code> 
091       * is responding. 
092       * @return the <em>RPC port<em> on which the <code>ApplicationMaster</code> is 
093       *         responding
094       */
095      @Public
096      @Stable
097      int getRpcPort();
098      
099      /**
100       * Set the <em>RPC port<em> on which the <code>ApplicationMaster</code> is 
101       * responding.
102       * @param port <em>RPC port<em> on which the <code>ApplicationMaster</code> is 
103       *             responding
104       */
105      @Public
106      @Stable
107      void setRpcPort(int port);
108    
109      /**
110       * Get the <em>tracking URL</em> for the <code>ApplicationMaster</code>.
111       * @return <em>tracking URL</em> for the <code>ApplicationMaster</code>
112       */
113      @Public
114      @Stable
115      String getTrackingUrl();
116      
117      /**
118       * Set the <em>tracking URL</em> for the <code>ApplicationMaster</code>.
119       * @param trackingUrl <em>tracking URL</em> for the 
120       *                    <code>ApplicationMaster</code>
121       */
122      @Public
123      @Stable
124      void setTrackingUrl(String trackingUrl);
125    }