1 /**
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19 package org.apache.hadoop.hbase.master;
20
21 import java.util.Map;
22 import java.util.Map.Entry;
23
24 /**
25 * This is the interface that will expose information to hadoop1/hadoop2 implementations of the
26 * MetricsMasterSource.
27 */
28 public interface MetricsMasterWrapper {
29
30 /**
31 * Get ServerName
32 */
33 String getServerName();
34
35 /**
36 * Get Average Load
37 *
38 * @return Average Load
39 */
40 double getAverageLoad();
41
42 /**
43 * Get the Cluster ID
44 *
45 * @return Cluster ID
46 */
47 String getClusterId();
48
49 /**
50 * Get the Zookeeper Quorum Info
51 *
52 * @return Zookeeper Quorum Info
53 */
54 String getZookeeperQuorum();
55
56 /**
57 * Get the co-processors
58 *
59 * @return Co-processors
60 */
61 String[] getCoprocessors();
62
63 /**
64 * Get hbase master start time
65 *
66 * @return Start time of master in milliseconds
67 */
68 long getStartTime();
69
70 /**
71 * Get the hbase master active time
72 *
73 * @return Time in milliseconds when master became active
74 */
75 long getActiveTime();
76
77 /**
78 * Whether this master is the active master
79 *
80 * @return True if this is the active master
81 */
82 boolean getIsActiveMaster();
83
84 /**
85 * Get the live region servers
86 *
87 * @return Live region servers
88 */
89 String getRegionServers();
90
91 /**
92 * Get the number of live region servers
93 *
94 * @return number of Live region servers
95 */
96
97 int getNumRegionServers();
98
99 /**
100 * Get the dead region servers
101 *
102 * @return Dead region Servers
103 */
104 String getDeadRegionServers();
105
106 /**
107 * Get the number of dead region servers
108 *
109 * @return number of Dead region Servers
110 */
111 int getNumDeadRegionServers();
112
113 /**
114 * Get the number of master WAL files.
115 */
116 long getNumWALFiles();
117
118
119 /**
120 * Gets the space usage and limit for each table.
121 */
122 Map<String,Entry<Long,Long>> getTableSpaceUtilization();
123
124 /**
125 * Gets the space usage and limit for each namespace.
126 */
127 Map<String,Entry<Long,Long>> getNamespaceSpaceUtilization();
128 }