001/* 002 * 003 * Licensed to the Apache Software Foundation (ASF) under one 004 * or more contributor license agreements. See the NOTICE file 005 * distributed with this work for additional information 006 * regarding copyright ownership. The ASF licenses this file 007 * to you under the Apache License, Version 2.0 (the 008 * "License"); you may not use this file except in compliance 009 * with the License. You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, software 014 * distributed under the License is distributed on an "AS IS" BASIS, 015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 016 * See the License for the specific language governing permissions and 017 * limitations under the License. 018 */ 019 020package org.apache.hadoop.hbase.rest; 021 022import org.apache.yetus.audience.InterfaceAudience; 023import org.apache.hadoop.hbase.CompatibilitySingletonFactory; 024 025import org.apache.hadoop.hbase.rest.MetricsRESTSource; 026 027@InterfaceAudience.Private 028public class MetricsREST { 029 030 public MetricsRESTSource getSource() { 031 return source; 032 } 033 034 private MetricsRESTSource source; 035 036 public MetricsREST() { 037 source = CompatibilitySingletonFactory.getInstance(MetricsRESTSource.class); 038 } 039 040 /** 041 * @param inc How much to add to requests. 042 */ 043 public void incrementRequests(final int inc) { 044 source.incrementRequests(inc); 045 } 046 047 /** 048 * @param inc How much to add to sucessfulGetCount. 049 */ 050 public void incrementSucessfulGetRequests(final int inc) { 051 source.incrementSucessfulGetRequests(inc); 052 } 053 054 /** 055 * @param inc How much to add to sucessfulPutCount. 056 */ 057 public void incrementSucessfulPutRequests(final int inc) { 058 source.incrementSucessfulPutRequests(inc); 059 } 060 061 /** 062 * @param inc How much to add to failedPutCount. 063 */ 064 public void incrementFailedPutRequests(final int inc) { 065 source.incrementFailedPutRequests(inc); 066 } 067 068 /** 069 * @param inc How much to add to failedGetCount. 070 */ 071 public void incrementFailedGetRequests(final int inc) { 072 source.incrementFailedGetRequests(inc); 073 } 074 075 /** 076 * @param inc How much to add to sucessfulDeleteCount. 077 */ 078 public void incrementSucessfulDeleteRequests(final int inc) { 079 source.incrementSucessfulDeleteRequests(inc); 080 } 081 082 /** 083 * @param inc How much to add to failedDeleteCount. 084 */ 085 public void incrementFailedDeleteRequests(final int inc) { 086 source.incrementFailedDeleteRequests(inc); 087 } 088 089 /** 090 * @param inc How much to add to sucessfulScanCount. 091 */ 092 public synchronized void incrementSucessfulScanRequests(final int inc) { 093 source.incrementSucessfulScanRequests(inc); 094 } 095 096 /** 097 * @param inc How much to add to failedScanCount. 098 */ 099 public void incrementFailedScanRequests(final int inc) { 100 source.incrementFailedScanRequests(inc); 101 } 102 103 /** 104 * @param inc How much to add to sucessfulAppendCount. 105 */ 106 public synchronized void incrementSucessfulAppendRequests(final int inc) { 107 source.incrementSucessfulAppendRequests(inc); 108 } 109 110 /** 111 * @param inc How much to add to failedAppendCount. 112 */ 113 public void incrementFailedAppendRequests(final int inc) { 114 source.incrementFailedAppendRequests(inc); 115 } 116 117 /** 118 * @param inc How much to add to sucessfulIncrementCount. 119 */ 120 public synchronized void incrementSucessfulIncrementRequests(final int inc) { 121 source.incrementSucessfulIncrementRequests(inc); 122 } 123 124 /** 125 * @param inc How much to add to failedIncrementCount. 126 */ 127 public void incrementFailedIncrementRequests(final int inc) { 128 source.incrementFailedIncrementRequests(inc); 129 } 130 131}