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 java.io.DataInput;
022import java.io.DataOutput;
023import java.io.IOException;
024
025import org.apache.hadoop.classification.InterfaceAudience.Private;
026import org.apache.hadoop.classification.InterfaceAudience.Public;
027import org.apache.hadoop.classification.InterfaceStability.Stable;
028import org.apache.hadoop.classification.InterfaceStability.Unstable;
029
030/**
031 * Contains various scheduling metrics to be reported by UI and CLI.
032 */
033@Public
034@Stable
035public interface ApplicationResourceUsageReport {
036
037  /**
038   * Get the number of used containers
039   * @return the number of used containers
040   */
041  @Public
042  @Stable
043  int getNumUsedContainers();
044
045  /**
046   * Set the number of used containers
047   * @param num_containers the number of used containers
048   */
049  @Private
050  @Unstable
051  void setNumUsedContainers(int num_containers);
052
053  /**
054   * Get the number of reserved containers
055   * @return the number of reserved containers
056   */
057  @Public
058  @Stable
059  int getNumReservedContainers();
060
061  /**
062   * Set the number of reserved containers
063   * @param num_reserved_containers the number of reserved containers
064   */
065  @Private
066  @Unstable
067  void setNumReservedContainers(int num_reserved_containers);
068
069  /**
070   * Get the used <code>Resource</code>
071   * @return the used <code>Resource</code>
072   */
073  @Public
074  @Stable
075  Resource getUsedResources();
076
077  @Private
078  @Unstable
079  void setUsedResources(Resource resources);
080
081  /**
082   * Get the reserved <code>Resource</code>
083   * @return the reserved <code>Resource</code>
084   */
085  @Public
086  @Stable
087  Resource getReservedResources();
088
089  @Private
090  @Unstable
091  void setReservedResources(Resource reserved_resources);
092
093  /**
094   * Get the needed <code>Resource</code>
095   * @return the needed <code>Resource</code>
096   */
097  @Public
098  @Stable
099  Resource getNeededResources();
100
101  @Private
102  @Unstable
103  void setNeededResources(Resource needed_resources);
104}