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.hdfs.server.namenode;
019
020 import org.apache.hadoop.classification.InterfaceAudience;
021 import org.apache.hadoop.classification.InterfaceStability;
022
023 /**
024 * This is the JMX management interface for namenode information
025 */
026 @InterfaceAudience.Public
027 @InterfaceStability.Stable
028 public interface NameNodeMXBean {
029
030 /**
031 * Gets the version of Hadoop.
032 *
033 * @return the version
034 */
035 public String getVersion();
036
037 /**
038 * Gets the used space by data nodes.
039 *
040 * @return the used space by data nodes
041 */
042 public long getUsed();
043
044 /**
045 * Gets total non-used raw bytes.
046 *
047 * @return total non-used raw bytes
048 */
049 public long getFree();
050
051 /**
052 * Gets total raw bytes including non-dfs used space.
053 *
054 * @return the total raw bytes including non-dfs used space
055 */
056 public long getTotal();
057
058
059 /**
060 * Gets the safemode status
061 *
062 * @return the safemode status
063 *
064 */
065 public String getSafemode();
066
067 /**
068 * Checks if upgrade is finalized.
069 *
070 * @return true, if upgrade is finalized
071 */
072 public boolean isUpgradeFinalized();
073
074 /**
075 * Gets total used space by data nodes for non DFS purposes such as storing
076 * temporary files on the local file system
077 *
078 * @return the non dfs space of the cluster
079 */
080 public long getNonDfsUsedSpace();
081
082 /**
083 * Gets the total used space by data nodes as percentage of total capacity
084 *
085 * @return the percentage of used space on the cluster.
086 */
087 public float getPercentUsed();
088
089 /**
090 * Gets the total remaining space by data nodes as percentage of total
091 * capacity
092 *
093 * @return the percentage of the remaining space on the cluster
094 */
095 public float getPercentRemaining();
096
097 /**
098 * Get the total space used by the block pools of this namenode
099 */
100 public long getBlockPoolUsedSpace();
101
102 /**
103 * Get the total space used by the block pool as percentage of total capacity
104 */
105 public float getPercentBlockPoolUsed();
106
107 /**
108 * Gets the total numbers of blocks on the cluster.
109 *
110 * @return the total number of blocks of the cluster
111 */
112 public long getTotalBlocks();
113
114 /**
115 * Gets the total number of files on the cluster
116 *
117 * @return the total number of files on the cluster
118 */
119 public long getTotalFiles();
120
121 /**
122 * Gets the total number of missing blocks on the cluster
123 *
124 * @return the total number of files and blocks on the cluster
125 */
126 public long getNumberOfMissingBlocks();
127
128 /**
129 * Gets the number of threads.
130 *
131 * @return the number of threads
132 */
133 public int getThreads();
134
135 /**
136 * Gets the live node information of the cluster.
137 *
138 * @return the live node information
139 */
140 public String getLiveNodes();
141
142 /**
143 * Gets the dead node information of the cluster.
144 *
145 * @return the dead node information
146 */
147 public String getDeadNodes();
148
149 /**
150 * Gets the decommissioning node information of the cluster.
151 *
152 * @return the decommissioning node information
153 */
154 public String getDecomNodes();
155
156 /**
157 * Gets the cluster id.
158 *
159 * @return the cluster id
160 */
161 public String getClusterId();
162
163 /**
164 * Gets the block pool id.
165 *
166 * @return the block pool id
167 */
168 public String getBlockPoolId();
169
170 /**
171 * Get status information about the directories storing image and edits logs
172 * of the NN.
173 *
174 * @return the name dir status information, as a JSON string.
175 */
176 public String getNameDirStatuses();
177 }