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>NodeReport</code> is a summary of runtime information of a 
029     * node in the cluster.</p>
030     * 
031     * <p>It includes details such as:
032     *   <ul>
033     *     <li>{@link NodeId} of the node.</li>
034     *     <li>HTTP Tracking URL of the node.</li>
035     *     <li>Rack name for the node.</li>
036     *     <li>Used {@link Resource} on the node.</li>
037     *     <li>Total available {@link Resource} of the node.</li>
038     *     <li>Number of running containers on the node.</li>
039     *     <li>{@link NodeHealthStatus} of the node.</li>
040     *   </ul>
041     * </p>
042     *
043     * @see NodeHealthStatus
044     * @see ClientRMProtocol#getClusterNodes(org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesRequest)
045     */
046    @Public
047    @Stable
048    public interface NodeReport {
049      /**
050       * Get the <code>NodeId</code> of the node.
051       * @return <code>NodeId</code> of the node
052       */
053      NodeId getNodeId();
054      
055      @Private
056      @Unstable
057      void setNodeId(NodeId nodeId);
058      
059      /**
060       * Get the <code>NodeState</code> of the node.
061       * @return <code>NodeState</code> of the node
062       */
063      NodeState getNodeState();
064      
065      @Private
066      @Unstable
067      void setNodeState(NodeState nodeState);
068      
069      /**
070       * Get the <em>http address</em> of the node.
071       * @return <em>http address</em> of the node
072       */
073      @Public
074      @Stable
075      String getHttpAddress();
076      
077      @Private
078      @Unstable
079      void setHttpAddress(String httpAddress);
080      
081      /**
082       * Get the <em>rack name</em> for the node.
083       * @return <em>rack name</em> for the node
084       */
085      @Public
086      @Stable
087      String getRackName();
088      
089      @Private
090      @Unstable
091      void setRackName(String rackName);
092      
093      /**
094       * Get <em>used</em> <code>Resource</code> on the node.
095       * @return <em>used</em> <code>Resource</code> on the node
096       */
097      @Public
098      @Stable
099      Resource getUsed();        
100      
101      @Private
102      @Unstable
103      void setUsed(Resource used);
104      
105      /**
106       * Get the <em>total</em> <code>Resource</code> on the node.
107       * @return <em>total</em> <code>Resource</code> on the node
108       */
109      @Public
110      @Stable
111      Resource getCapability();
112      
113      @Private
114      @Unstable
115      void setCapability(Resource capability);
116      
117      /**
118       * Get the <em>number of running containers</em> on the node.
119       * @return <em>number of running containers</em> on the node
120       */
121      @Public
122      @Stable
123      int getNumContainers();
124      
125      @Private
126      @Unstable
127      void setNumContainers(int numContainers);
128      
129      /**
130       * Get the <code>NodeHealthStatus</code> of the node. 
131       * @return <code>NodeHealthStatus</code> of the node
132       */
133      @Public
134      @Stable
135      NodeHealthStatus getNodeHealthStatus();
136      
137      @Private
138      @Unstable
139      void setNodeHealthStatus(NodeHealthStatus nodeHealthStatus);
140    }