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