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.regionserver;
20
21 /**
22 * Interface of class that will wrap an HRegion and export numbers so they can be
23 * used in MetricsRegionSource
24 */
25 public interface MetricsRegionWrapper {
26
27 /**
28 * Get the name of the table the region belongs to.
29 *
30 * @return The string version of the table name.
31 */
32 String getTableName();
33
34 /**
35 * Get the name of the namespace this table is in.
36 * @return String version of the namespace. Can't be empty.
37 */
38 String getNamespace();
39
40 /**
41 * Get the name of the region.
42 *
43 * @return The encoded name of the region.
44 */
45 String getRegionName();
46
47 /**
48 * Get the number of stores hosted on this region server.
49 */
50 long getNumStores();
51
52 /**
53 * Get the number of store files hosted on this region server.
54 */
55 long getNumStoreFiles();
56
57 /**
58 * Get the size of the memstore on this region server.
59 */
60 long getMemstoreSize();
61
62 /**
63 * Get the total size of the store files this region server is serving from.
64 */
65 long getStoreFileSize();
66
67 /**
68 * Get the total number of read requests that have been issued against this region
69 */
70 long getReadRequestCount();
71
72 /**
73 * @return Max age of store files under this region
74 */
75 long getMaxStoreFileAge();
76
77 /**
78 * @return Min age of store files under this region
79 */
80 long getMinStoreFileAge();
81
82 /**
83 * @return Average age of store files under this region
84 */
85 long getAvgStoreFileAge();
86
87 /**
88 * @return Number of reference files under this region
89 */
90 long getNumReferenceFiles();
91
92 /**
93 * Get the total number of mutations that have been issued against this region.
94 */
95 long getWriteRequestCount();
96
97 /**
98 * Get the total number of requests that have been issued against this region.
99 */
100 long getTotalRequestCount();
101
102 long getNumFilesCompacted();
103
104 long getNumBytesCompacted();
105
106 long getNumCompactionsCompleted();
107
108 int getRegionHashCode();
109
110 /**
111 * Get the replica id of this region.
112 */
113 int getReplicaId();
114 }