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.hdfs.server.namenode; 019 020import java.util.Map; 021 022import org.apache.hadoop.classification.InterfaceAudience; 023import org.apache.hadoop.classification.InterfaceStability; 024import org.apache.hadoop.hdfs.protocol.RollingUpgradeInfo; 025 026/** 027 * This is the JMX management interface for namenode information 028 */ 029@InterfaceAudience.Public 030@InterfaceStability.Stable 031public interface NameNodeMXBean { 032 033 /** 034 * Gets the version of Hadoop. 035 * 036 * @return the version 037 */ 038 public String getVersion(); 039 040 /** 041 * Get the version of software running on the Namenode 042 * @return a string representing the version 043 */ 044 public String getSoftwareVersion(); 045 046 /** 047 * Gets the used space by data nodes. 048 * 049 * @return the used space by data nodes 050 */ 051 public long getUsed(); 052 053 /** 054 * Gets total non-used raw bytes. 055 * 056 * @return total non-used raw bytes 057 */ 058 public long getFree(); 059 060 /** 061 * Gets total raw bytes including non-dfs used space. 062 * 063 * @return the total raw bytes including non-dfs used space 064 */ 065 public long getTotal(); 066 067 068 /** 069 * Gets the safemode status 070 * 071 * @return the safemode status 072 * 073 */ 074 public String getSafemode(); 075 076 /** 077 * Checks if upgrade is finalized. 078 * 079 * @return true, if upgrade is finalized 080 */ 081 public boolean isUpgradeFinalized(); 082 083 /** 084 * Gets the RollingUpgrade information. 085 * 086 * @return Rolling upgrade information if an upgrade is in progress. Else 087 * (e.g. if there is no upgrade or the upgrade is finalized), returns null. 088 */ 089 public RollingUpgradeInfo.Bean getRollingUpgradeStatus(); 090 091 /** 092 * Gets total used space by data nodes for non DFS purposes such as storing 093 * temporary files on the local file system 094 * 095 * @return the non dfs space of the cluster 096 */ 097 public long getNonDfsUsedSpace(); 098 099 /** 100 * Gets the total used space by data nodes as percentage of total capacity 101 * 102 * @return the percentage of used space on the cluster. 103 */ 104 public float getPercentUsed(); 105 106 /** 107 * Gets the total remaining space by data nodes as percentage of total 108 * capacity 109 * 110 * @return the percentage of the remaining space on the cluster 111 */ 112 public float getPercentRemaining(); 113 114 /** 115 * Returns the amount of cache used by the datanode (in bytes). 116 */ 117 public long getCacheUsed(); 118 119 /** 120 * Returns the total cache capacity of the datanode (in bytes). 121 */ 122 public long getCacheCapacity(); 123 124 /** 125 * Get the total space used by the block pools of this namenode 126 */ 127 public long getBlockPoolUsedSpace(); 128 129 /** 130 * Get the total space used by the block pool as percentage of total capacity 131 */ 132 public float getPercentBlockPoolUsed(); 133 134 /** 135 * Gets the total numbers of blocks on the cluster. 136 * 137 * @return the total number of blocks of the cluster 138 */ 139 public long getTotalBlocks(); 140 141 /** 142 * Gets the total number of files on the cluster 143 * 144 * @return the total number of files on the cluster 145 */ 146 public long getTotalFiles(); 147 148 /** 149 * Gets the total number of missing blocks on the cluster 150 * 151 * @return the total number of missing blocks on the cluster 152 */ 153 public long getNumberOfMissingBlocks(); 154 155 /** 156 * Gets the total number of missing blocks on the cluster with 157 * replication factor 1 158 * 159 * @return the total number of missing blocks on the cluster with 160 * replication factor 1 161 */ 162 public long getNumberOfMissingBlocksWithReplicationFactorOne(); 163 164 /** 165 * Gets the number of threads. 166 * 167 * @return the number of threads 168 */ 169 public int getThreads(); 170 171 /** 172 * Gets the live node information of the cluster. 173 * 174 * @return the live node information 175 */ 176 public String getLiveNodes(); 177 178 /** 179 * Gets the dead node information of the cluster. 180 * 181 * @return the dead node information 182 */ 183 public String getDeadNodes(); 184 185 /** 186 * Gets the decommissioning node information of the cluster. 187 * 188 * @return the decommissioning node information 189 */ 190 public String getDecomNodes(); 191 192 /** 193 * Gets the cluster id. 194 * 195 * @return the cluster id 196 */ 197 public String getClusterId(); 198 199 /** 200 * Gets the block pool id. 201 * 202 * @return the block pool id 203 */ 204 public String getBlockPoolId(); 205 206 /** 207 * Get status information about the directories storing image and edits logs 208 * of the NN. 209 * 210 * @return the name dir status information, as a JSON string. 211 */ 212 public String getNameDirStatuses(); 213 214 /** 215 * Get Max, Median, Min and Standard Deviation of DataNodes usage. 216 * 217 * @return the DataNode usage information, as a JSON string. 218 */ 219 public String getNodeUsage(); 220 221 /** 222 * Get status information about the journals of the NN. 223 * 224 * @return the name journal status information, as a JSON string. 225 */ 226 public String getNameJournalStatus(); 227 228 /** 229 * Get information about the transaction ID, including the last applied 230 * transaction ID and the most recent checkpoint's transaction ID 231 */ 232 public String getJournalTransactionInfo(); 233 234 /** 235 * Gets the NN start time 236 * 237 * @return the NN start time 238 */ 239 public String getNNStarted(); 240 241 /** 242 * Get the compilation information which contains date, user and branch 243 * 244 * @return the compilation information, as a JSON string. 245 */ 246 public String getCompileInfo(); 247 248 /** 249 * Get the list of corrupt files 250 * 251 * @return the list of corrupt files, as a JSON string. 252 */ 253 public String getCorruptFiles(); 254 255 /** 256 * Get the number of distinct versions of live datanodes 257 * 258 * @return the number of distinct versions of live datanodes 259 */ 260 public int getDistinctVersionCount(); 261 262 /** 263 * Get the number of live datanodes for each distinct versions 264 * 265 * @return the number of live datanodes for each distinct versions 266 */ 267 public Map<String, Integer> getDistinctVersions(); 268 269}