View Javadoc

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     * Get the total number of filtered read requests that have been issued against this region
74     */
75    long getFilteredReadRequestCount();
76  
77    /**
78     * @return Max age of store files under this region
79     */
80    long getMaxStoreFileAge();
81  
82    /**
83     * @return Min age of store files under this region
84     */
85    long getMinStoreFileAge();
86  
87    /**
88     *  @return Average age of store files under this region
89     */
90    long getAvgStoreFileAge();
91  
92    /**
93     *  @return Number of reference files under this region
94     */
95    long getNumReferenceFiles();
96  
97    /**
98     * Get the total number of mutations that have been issued against this region.
99     */
100   long getWriteRequestCount();
101 
102   long getNumFilesCompacted();
103 
104   long getNumBytesCompacted();
105 
106   long getNumCompactionsCompleted();
107 
108   /**
109    * Returns the total number of compactions that have been reported as failed on this region.
110    * Note that a given compaction can be reported as both completed and failed if an exception
111    * is thrown in the processing after {@code HRegion.compact()}.
112    */
113   long getNumCompactionsFailed();
114
115   int getRegionHashCode();
116
117   /**
118    * Get the replica id of this region.
119    */
120   int getReplicaId();
121 }