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.regionserver;
020
021import org.apache.yetus.audience.InterfaceAudience;
022
023/**
024 * Interface of class that will wrap an HRegion and export numbers so they can be
025 * used in MetricsRegionSource
026 */
027@InterfaceAudience.Private
028public interface MetricsRegionWrapper {
029
030  /**
031   * Get the name of the table the region belongs to.
032   *
033   * @return The string version of the table name.
034   */
035  String getTableName();
036
037  /**
038   * Get the name of the namespace this table is in.
039   * @return String version of the namespace.  Can't be empty.
040   */
041  String getNamespace();
042
043  /**
044   * Get the name of the region.
045   *
046   * @return The encoded name of the region.
047   */
048  String getRegionName();
049
050  /**
051   * Get the number of stores hosted on this region server.
052   */
053  long getNumStores();
054
055  /**
056   * Get the number of store files hosted on this region server.
057   */
058  long getNumStoreFiles();
059
060  /**
061   * Get the size of the memstore on this region server.
062   */
063  long getMemStoreSize();
064
065  /**
066   * Get the total size of the store files this region server is serving from.
067   */
068  long getStoreFileSize();
069
070  /**
071   * Get the total number of read requests that have been issued against this region
072   */
073  long getReadRequestCount();
074
075  /**
076   * Get the total number of filtered read requests that have been issued against this region
077   */
078  long getFilteredReadRequestCount();
079
080  /**
081   * @return Max age of store files under this region
082   */
083  long getMaxStoreFileAge();
084
085  /**
086   * @return Min age of store files under this region
087   */
088  long getMinStoreFileAge();
089
090  /**
091   *  @return Average age of store files under this region
092   */
093  long getAvgStoreFileAge();
094
095  /**
096   *  @return Number of reference files under this region
097   */
098  long getNumReferenceFiles();
099
100  /**
101   * Get the total number of mutations that have been issued against this region.
102   */
103  long getWriteRequestCount();
104
105  long getTotalRequestCount();
106
107  long getNumFilesCompacted();
108
109  long getNumBytesCompacted();
110
111  long getNumCompactionsCompleted();
112
113  /**
114   *  @return Age of the last major compaction
115   */
116  long getLastMajorCompactionAge();
117
118  /**
119   * Returns the total number of compactions that have been reported as failed on this region.
120   * Note that a given compaction can be reported as both completed and failed if an exception
121   * is thrown in the processing after {@code HRegion.compact()}.
122   */
123  long getNumCompactionsFailed();
124
125  /**
126   * @return the total number of compactions that are currently queued(or being executed) at point in
127   *  time
128   */
129  long getNumCompactionsQueued();
130
131  /**
132   * @return the total number of flushes currently queued(being executed) for this region at point in
133   *  time
134   */
135  long getNumFlushesQueued();
136
137  /**
138   * @return the max number of compactions queued for this region
139   * Note that this metric is updated periodically and hence might miss some data points
140   */
141  long getMaxCompactionQueueSize();
142
143  /**
144   * @return the max number of flushes queued for this region
145   * Note that this metric is updated periodically and hence might miss some data points
146   */
147  long getMaxFlushQueueSize();
148
149  int getRegionHashCode();
150
151  /**
152   * Get the replica id of this region.
153   */
154  int getReplicaId();
155}