View Javadoc

1   /*
2    *
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   *   http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */
19  
20  package org.apache.hadoop.hbase.rest;
21  
22  import org.apache.hadoop.hbase.classification.InterfaceAudience;
23  import org.apache.hadoop.hbase.CompatibilitySingletonFactory;
24  
25  import org.apache.hadoop.hbase.rest.MetricsRESTSource;
26  
27  @InterfaceAudience.Private
28  public class MetricsREST {
29  
30    public MetricsRESTSource getSource() {
31      return source;
32    }
33  
34    private MetricsRESTSource source;
35  
36    public MetricsREST() {
37       source = CompatibilitySingletonFactory.getInstance(MetricsRESTSource.class);
38    }
39    
40    /**
41     * @param inc How much to add to requests.
42     */
43    public void incrementRequests(final int inc) {
44      source.incrementRequests(inc);
45    }
46    
47    /**
48     * @param inc How much to add to sucessfulGetCount.
49     */
50    public void incrementSucessfulGetRequests(final int inc) {
51      source.incrementSucessfulGetRequests(inc);
52    }
53    
54    /**
55     * @param inc How much to add to sucessfulPutCount.
56     */
57    public void incrementSucessfulPutRequests(final int inc) {
58      source.incrementSucessfulPutRequests(inc);
59    }
60  
61    /**
62     * @param inc How much to add to failedPutCount.
63     */
64    public void incrementFailedPutRequests(final int inc) {
65      source.incrementFailedPutRequests(inc);
66    }
67    
68    /**
69     * @param inc How much to add to failedGetCount.
70     */
71    public void incrementFailedGetRequests(final int inc) {
72      source.incrementFailedGetRequests(inc);
73    }
74  
75    /**
76     * @param inc How much to add to sucessfulDeleteCount.
77     */
78    public void incrementSucessfulDeleteRequests(final int inc) {
79      source.incrementSucessfulDeleteRequests(inc);
80    }
81  
82    /**
83     * @param inc How much to add to failedDeleteCount.
84     */
85    public void incrementFailedDeleteRequests(final int inc) {
86      source.incrementFailedDeleteRequests(inc);
87    }
88  
89    /**
90     * @param inc How much to add to sucessfulScanCount.
91     */
92    public synchronized void incrementSucessfulScanRequests(final int inc) {
93      source.incrementSucessfulScanRequests(inc);
94    }
95  
96    /**
97     * @param inc How much to add to failedScanCount.
98     */
99    public void incrementFailedScanRequests(final int inc) {
100     source.incrementFailedScanRequests(inc);
101   }
102 
103 }