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