2 * Copyright The Apache Software Foundation
4 * Licensed to the Apache Software Foundation (ASF) under one or more
5 * contributor license agreements. See the NOTICE file distributed with this
6 * work for additional information regarding copyright ownership. The ASF
7 * licenses this file to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 * License for the specific language governing permissions and limitations
19 package org
.apache
.hadoop
.hbase
.regionserver
;
21 import org
.apache
.hadoop
.conf
.Configuration
;
22 import org
.apache
.yetus
.audience
.InterfaceAudience
;
23 import org
.apache
.hadoop
.hbase
.CompatibilitySingletonFactory
;
27 * This is the glue between the HRegion and whatever hadoop shim layer
28 * is loaded (hbase-hadoop1-compat or hbase-hadoop2-compat).
30 @InterfaceAudience.Private
31 public class MetricsRegion
{
32 private final MetricsRegionSource source
;
33 private final MetricsUserAggregate userAggregate
;
34 private MetricsRegionWrapper regionWrapper
;
36 public MetricsRegion(final MetricsRegionWrapper wrapper
, Configuration conf
) {
37 source
= CompatibilitySingletonFactory
.getInstance(MetricsRegionServerSourceFactory
.class)
38 .createRegion(wrapper
);
39 this.regionWrapper
= wrapper
;
40 userAggregate
= MetricsUserAggregateFactory
.getMetricsUserAggregate(conf
);
47 public void updatePut() {
51 public void updateDelete() {
52 source
.updateDelete();
55 public void updateGet(final long t
) {
59 public void updateScanTime(final long t
) {
60 source
.updateScanTime(t
);
63 public void updateFilteredRecords(){
64 userAggregate
.updateFilteredReadRequests();
66 public void updateAppend() {
67 source
.updateAppend();
70 public void updateIncrement() {
71 source
.updateIncrement();
74 MetricsRegionSource
getSource() {
78 public MetricsRegionWrapper
getRegionWrapper() {
82 public void updateReadRequestCount() {
83 userAggregate
.updateReadRequestCount();