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 <em>http address</em> of the node.
061 * @return <em>http address</em> of the node
062 */
063 @Public
064 @Stable
065 String getHttpAddress();
066
067 @Private
068 @Unstable
069 void setHttpAddress(String httpAddress);
070
071 /**
072 * Get the <em>rack name</em> for the node.
073 * @return <em>rack name</em> for the node
074 */
075 @Public
076 @Stable
077 String getRackName();
078
079 @Private
080 @Unstable
081 void setRackName(String rackName);
082
083 /**
084 * Get <em>used</em> <code>Resource</code> on the node.
085 * @return <em>used</em> <code>Resource</code> on the node
086 */
087 @Public
088 @Stable
089 Resource getUsed();
090
091 @Private
092 @Unstable
093 void setUsed(Resource used);
094
095 /**
096 * Get the <em>total</em> <code>Resource</code> on the node.
097 * @return <em>total</em> <code>Resource</code> on the node
098 */
099 @Public
100 @Stable
101 Resource getCapability();
102
103 @Private
104 @Unstable
105 void setCapability(Resource capability);
106
107 /**
108 * Get the <em>number of running containers</em> on the node.
109 * @return <em>number of running containers</em> on the node
110 */
111 @Public
112 @Stable
113 int getNumContainers();
114
115 @Private
116 @Unstable
117 void setNumContainers(int numContainers);
118
119 /**
120 * Get the <code>NodeHealthStatus</code> of the node.
121 * @return <code>NodeHealthStatus</code> of the node
122 */
123 @Public
124 @Stable
125 NodeHealthStatus getNodeHealthStatus();
126
127 @Private
128 @Unstable
129 void setNodeHealthStatus(NodeHealthStatus nodeHealthStatus);
130 }