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 */ 018package org.apache.hadoop.yarn.api.records; 019 020import org.apache.hadoop.classification.InterfaceAudience.Private; 021import org.apache.hadoop.classification.InterfaceAudience.Public; 022import org.apache.hadoop.classification.InterfaceStability.Stable; 023import org.apache.hadoop.classification.InterfaceStability.Unstable; 024import 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 * </ul> 039 * </p> 040 * 041 * @see NodeReport 042 * @see ClientRMProtocol#getClusterNodes(org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesRequest) 043 */ 044@Public 045@Stable 046public interface NodeHealthStatus { 047 048 /** 049 * Is the node healthy? 050 * @return <code>true</code> if the node is healthy, else <code>false</code> 051 */ 052 @Public 053 @Stable 054 boolean getIsNodeHealthy(); 055 056 @Private 057 @Unstable 058 void setIsNodeHealthy(boolean isNodeHealthy); 059 060 /** 061 * Get the <em>diagnostic health report</em> of the node. 062 * @return <em>diagnostic health report</em> of the node 063 */ 064 @Public 065 @Stable 066 String getHealthReport(); 067 068 @Private 069 @Unstable 070 void setHealthReport(String healthReport); 071 072 /** 073 * Get the <em>last timestamp</em> at which the health report was received. 074 * @return <em>last timestamp</em> at which the health report was received 075 */ 076 @Public 077 @Stable 078 long getLastHealthReportTime(); 079 080 @Private 081 @Unstable 082 void setLastHealthReportTime(long lastHealthReport); 083}