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 package org.apache.hadoop.yarn.api.records; 019 020 import org.apache.hadoop.classification.InterfaceAudience.Private; 021 import org.apache.hadoop.classification.InterfaceAudience.Public; 022 import org.apache.hadoop.classification.InterfaceStability.Stable; 023 import org.apache.hadoop.classification.InterfaceStability.Unstable; 024 import org.apache.hadoop.yarn.api.ClientRMProtocol; 025 026 /** 027 * <p><code>NodeHealthStatus</code> is a summary of the health status of the 028 * node.</p> 029 * 030 * <p>It includes information such as: 031 * <ul> 032 * <li> 033 * An indicator of whether the node is healthy, as determined by the 034 * health-check script. 035 * </li> 036 * <li>The previous time at which the health status was reported.</li> 037 * <li>A diagnostic report on the health status.</li> 038 * <li></li> 039 * <li></li> 040 * </ul> 041 * </p> 042 * 043 * @see NodeReport 044 * @see ClientRMProtocol#getClusterNodes(org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesRequest) 045 */ 046 @Public 047 @Stable 048 public interface NodeHealthStatus { 049 050 /** 051 * Is the node healthy? 052 * @return <code>true</code> if the node is healthy, else <code>false</code> 053 */ 054 @Public 055 @Stable 056 boolean getIsNodeHealthy(); 057 058 @Private 059 @Unstable 060 void setIsNodeHealthy(boolean isNodeHealthy); 061 062 /** 063 * Get the <em>diagnostic health report</em> of the node. 064 * @return <em>diagnostic health report</em> of the node 065 */ 066 @Public 067 @Stable 068 String getHealthReport(); 069 070 @Private 071 @Unstable 072 void setHealthReport(String healthReport); 073 074 /** 075 * Get the <em>last timestamp</em> at which the health report was received. 076 * @return <em>last timestamp</em> at which the health report was received 077 */ 078 @Public 079 @Stable 080 long getLastHealthReportTime(); 081 082 @Private 083 @Unstable 084 void setLastHealthReportTime(long lastHealthReport); 085 }