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
019package org.apache.hadoop.hbase.master;
020
021import java.util.Map;
022import java.util.Map.Entry;
023import org.apache.yetus.audience.InterfaceAudience;
024
025/**
026 * This is the interface that will expose information to hadoop1/hadoop2 implementations of the
027 * MetricsMasterSource.
028 */
029@InterfaceAudience.Private
030public interface MetricsMasterWrapper {
031
032  /**
033   * Returns if the master is currently running and is not attempting to shutdown.
034   */
035  boolean isRunning();
036
037  /**
038   * Get ServerName
039   */
040  String getServerName();
041
042  /**
043   * Get Average Load
044   *
045   * @return Average Load
046   */
047  double getAverageLoad();
048
049  /**
050   * Get the Cluster ID
051   *
052   * @return Cluster ID
053   */
054  String getClusterId();
055
056  /**
057   * Get the ZooKeeper Quorum Info
058   *
059   * @return ZooKeeper Quorum Info
060   */
061  String getZookeeperQuorum();
062
063  /**
064   * Get the co-processors
065   *
066   * @return Co-processors
067   */
068  String[] getCoprocessors();
069
070  /**
071   * Get hbase master start time
072   *
073   * @return Start time of master in milliseconds
074   */
075  long getStartTime();
076
077  /**
078   * Get the hbase master active time
079   *
080   * @return Time in milliseconds when master became active
081   */
082  long getActiveTime();
083
084  /**
085   * Whether this master is the active master
086   *
087   * @return True if this is the active master
088   */
089  boolean getIsActiveMaster();
090
091  /**
092   * Get the live region servers
093   *
094   * @return Live region servers
095   */
096  String getRegionServers();
097
098  /**
099   * Get the number of live region servers
100   *
101   * @return number of Live region servers
102   */
103
104  int getNumRegionServers();
105
106  /**
107   * Get the dead region servers
108   *
109   * @return Dead region Servers
110   */
111  String getDeadRegionServers();
112
113  /**
114   * Get the number of dead region servers
115   *
116   * @return number of Dead region Servers
117   */
118  int getNumDeadRegionServers();
119
120  /**
121   * Get the number of master WAL files.
122   */
123  long getNumWALFiles();
124
125  /**
126   * Get the number of region split plans executed.
127   */
128  long getSplitPlanCount();
129
130  /**
131   * Get the number of region merge plans executed.
132   */
133  long getMergePlanCount();
134
135  /**
136   * Gets the space usage and limit for each table.
137   */
138  Map<String,Entry<Long,Long>> getTableSpaceUtilization();
139
140  /**
141   * Gets the space usage and limit for each namespace.
142   */
143  Map<String,Entry<Long,Long>> getNamespaceSpaceUtilization();
144
145  /**
146   * Get the time in Millis when the master finished initializing/becoming the active master
147   */
148  long getMasterInitializationTime();
149}