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 java.util.Map;
022    
023    import org.apache.hadoop.classification.InterfaceAudience.Private;
024    import org.apache.hadoop.classification.InterfaceAudience.Public;
025    import org.apache.hadoop.classification.InterfaceStability.Stable;
026    import org.apache.hadoop.classification.InterfaceStability.Unstable;
027    import org.apache.hadoop.yarn.api.AMRMProtocol;
028    import org.apache.hadoop.yarn.api.records.ApplicationAccessType;
029    import org.apache.hadoop.yarn.api.records.Resource;
030    
031    /**
032     * <p>The response sent by the <code>ResourceManager</code> to a new 
033     * <code>ApplicationMaster</code> on registration.</p>
034     * 
035     * <p>The response contains critical details such as:
036     * <ul>
037     *   <li>Minimum capability for allocated resources in the cluster.</li>
038     *   <li>Maximum capability for allocated resources in the cluster.</li>
039     * </ul>
040     * </p>
041     * 
042     * @see AMRMProtocol#registerApplicationMaster(RegisterApplicationMasterRequest)
043     */
044    @Public
045    @Stable
046    public interface RegisterApplicationMasterResponse {
047      
048      /**
049       * Get the minimum capability for any {@link Resource} allocated by the 
050       * <code>ResourceManager</code> in the cluster.
051       * @return minimum capability of allocated resources in the cluster
052       */
053      @Public
054      @Stable
055      public Resource getMinimumResourceCapability();
056      
057      @Private
058      @Unstable
059      public void setMinimumResourceCapability(Resource capability);
060      
061      /**
062       * Get the maximum capability for any {@link Resource} allocated by the 
063       * <code>ResourceManager</code> in the cluster.
064       * @return maximum capability of allocated resources in the cluster
065       */
066      @Public
067      @Stable
068      public Resource getMaximumResourceCapability();
069      
070      @Private
071      @Unstable
072      public void setMaximumResourceCapability(Resource capability);
073    
074      /**
075       * Get the <code>ApplicationACL</code>s for the application. 
076       * @return all the <code>ApplicationACL</code>s
077       */
078      @Public
079      @Stable
080      public Map<ApplicationAccessType, String> getApplicationACLs();
081    
082      /**
083       * Set the <code>ApplicationACL</code>s for the application. 
084       * @param acls
085       */
086      @Private
087      @Unstable
088      public void setApplicationACLs(Map<ApplicationAccessType, String> acls);
089    }