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 */ 018package org.apache.hadoop.hbase.rest; 019 020import org.apache.hadoop.hbase.CompatibilitySingletonFactory; 021import org.apache.yetus.audience.InterfaceAudience; 022 023@InterfaceAudience.Private 024public class MetricsREST { 025 026 public MetricsRESTSource getSource() { 027 return source; 028 } 029 030 private MetricsRESTSource source; 031 032 public MetricsREST() { 033 source = CompatibilitySingletonFactory.getInstance(MetricsRESTSource.class); 034 } 035 036 /** 037 * @param inc How much to add to requests. 038 */ 039 public void incrementRequests(final int inc) { 040 source.incrementRequests(inc); 041 } 042 043 /** 044 * @param inc How much to add to sucessfulGetCount. 045 */ 046 public void incrementSucessfulGetRequests(final int inc) { 047 source.incrementSucessfulGetRequests(inc); 048 } 049 050 /** 051 * @param inc How much to add to sucessfulPutCount. 052 */ 053 public void incrementSucessfulPutRequests(final int inc) { 054 source.incrementSucessfulPutRequests(inc); 055 } 056 057 /** 058 * @param inc How much to add to failedPutCount. 059 */ 060 public void incrementFailedPutRequests(final int inc) { 061 source.incrementFailedPutRequests(inc); 062 } 063 064 /** 065 * @param inc How much to add to failedGetCount. 066 */ 067 public void incrementFailedGetRequests(final int inc) { 068 source.incrementFailedGetRequests(inc); 069 } 070 071 /** 072 * @param inc How much to add to sucessfulDeleteCount. 073 */ 074 public void incrementSucessfulDeleteRequests(final int inc) { 075 source.incrementSucessfulDeleteRequests(inc); 076 } 077 078 /** 079 * @param inc How much to add to failedDeleteCount. 080 */ 081 public void incrementFailedDeleteRequests(final int inc) { 082 source.incrementFailedDeleteRequests(inc); 083 } 084 085 /** 086 * @param inc How much to add to sucessfulScanCount. 087 */ 088 public synchronized void incrementSucessfulScanRequests(final int inc) { 089 source.incrementSucessfulScanRequests(inc); 090 } 091 092 /** 093 * @param inc How much to add to failedScanCount. 094 */ 095 public void incrementFailedScanRequests(final int inc) { 096 source.incrementFailedScanRequests(inc); 097 } 098 099 /** 100 * @param inc How much to add to sucessfulAppendCount. 101 */ 102 public synchronized void incrementSucessfulAppendRequests(final int inc) { 103 source.incrementSucessfulAppendRequests(inc); 104 } 105 106 /** 107 * @param inc How much to add to failedAppendCount. 108 */ 109 public void incrementFailedAppendRequests(final int inc) { 110 source.incrementFailedAppendRequests(inc); 111 } 112 113 /** 114 * @param inc How much to add to sucessfulIncrementCount. 115 */ 116 public synchronized void incrementSucessfulIncrementRequests(final int inc) { 117 source.incrementSucessfulIncrementRequests(inc); 118 } 119 120 /** 121 * @param inc How much to add to failedIncrementCount. 122 */ 123 public void incrementFailedIncrementRequests(final int inc) { 124 source.incrementFailedIncrementRequests(inc); 125 } 126 127}