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.hbase.master;
019
020import java.util.Map;
021import java.util.Map.Entry;
022import org.apache.yetus.audience.InterfaceAudience;
023
024/**
025 * This is the interface that will expose information to hadoop1/hadoop2 implementations of the
026 * MetricsMasterSource.
027 */
028@InterfaceAudience.Private
029public interface MetricsMasterWrapper {
030
031  /**
032   * Returns if the master is currently running and is not attempting to shutdown.
033   */
034  boolean isRunning();
035
036  /**
037   * Get ServerName
038   */
039  String getServerName();
040
041  /**
042   * Get Average Load
043   * @return Average Load
044   */
045  double getAverageLoad();
046
047  /**
048   * Get the Cluster ID
049   * @return Cluster ID
050   */
051  String getClusterId();
052
053  /**
054   * Get the ZooKeeper Quorum Info
055   * @return ZooKeeper Quorum Info
056   */
057  String getZookeeperQuorum();
058
059  /**
060   * Get the co-processors
061   * @return Co-processors
062   */
063  String[] getCoprocessors();
064
065  /**
066   * Get hbase master start time
067   * @return Start time of master in milliseconds
068   */
069  long getStartTime();
070
071  /**
072   * Get the hbase master active time
073   * @return Time in milliseconds when master became active
074   */
075  long getActiveTime();
076
077  /**
078   * Whether this master is the active master
079   * @return True if this is the active master
080   */
081  boolean getIsActiveMaster();
082
083  /**
084   * Get the live region servers
085   * @return Live region servers
086   */
087  String getRegionServers();
088
089  /**
090   * Get the number of live region servers
091   * @return number of Live region servers
092   */
093
094  int getNumRegionServers();
095
096  /**
097   * Get the dead region servers
098   * @return Dead region Servers
099   */
100  String getDeadRegionServers();
101
102  /**
103   * Get the number of dead region servers
104   * @return number of Dead region Servers
105   */
106  int getNumDeadRegionServers();
107
108  /**
109   * Get the draining region servers
110   * @return Draining region server
111   */
112  String getDrainingRegionServers();
113
114  /**
115   * Get the number of draining region servers
116   * @return number of draining region servers
117   */
118  int getNumDrainingRegionServers();
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}