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.regionserver; 019 020import java.util.HashMap; 021import java.util.Map; 022 023public class MetricsTableWrapperStub implements MetricsTableWrapperAggregate { 024 025 private String tableName; 026 027 public MetricsTableWrapperStub(String tableName) { 028 this.tableName = tableName; 029 } 030 031 @Override 032 public long getReadRequestCount(String table) { 033 return 10; 034 } 035 036 @Override 037 public long getWriteRequestCount(String table) { 038 return 20; 039 } 040 041 @Override 042 public long getTotalRequestsCount(String table) { 043 return 30; 044 } 045 046 @Override 047 public long getFilteredReadRequestCount(String table) { 048 return 40; 049 } 050 051 @Override 052 public long getMemStoreSize(String table) { 053 return 1000; 054 } 055 056 @Override 057 public long getStoreFileSize(String table) { 058 return 2000; 059 } 060 061 @Override 062 public long getTableSize(String table) { 063 return 3000; 064 } 065 066 public String getTableName() { 067 return tableName; 068 } 069 070 @Override 071 public long getNumRegions(String table) { 072 return 11; 073 } 074 075 @Override 076 public long getNumStores(String table) { 077 return 22; 078 } 079 080 @Override 081 public long getNumStoreFiles(String table) { 082 return 33; 083 } 084 085 @Override 086 public long getMaxStoreFiles(String table) { 087 return 8; 088 } 089 090 @Override 091 public long getMaxStoreFileAge(String table) { 092 return 44; 093 } 094 095 @Override 096 public long getMinStoreFileAge(String table) { 097 return 55; 098 } 099 100 @Override 101 public long getAvgStoreFileAge(String table) { 102 return 66; 103 } 104 105 @Override 106 public long getNumReferenceFiles(String table) { 107 return 77; 108 } 109 110 @Override 111 public long getAvgRegionSize(String table) { 112 return 88; 113 } 114 115 @Override 116 public long getCpRequestsCount(String table) { 117 return 99; 118 } 119 120 @Override 121 public long getStaticIndexSize(String table) { 122 return 101; 123 } 124 125 @Override 126 public long getStaticBloomSize(String table) { 127 return 111; 128 } 129 130 @Override 131 public long getBloomFilterRequestsCount(String table) { 132 return 222; 133 } 134 135 @Override 136 public long getBloomFilterNegativeResultsCount(String table) { 137 return 333; 138 } 139 140 @Override 141 public long getBloomFilterEligibleRequestsCount(String table) { 142 return 444; 143 } 144 145 @Override 146 public Map<String, Long> getMemstoreOnlyRowReadsCount(String table) { 147 Map<String, Long> map = new HashMap<String, Long>(); 148 map.put("table#info", 3L); 149 return map; 150 } 151 152 @Override 153 public Map<String, Long> getMixedRowReadsCount(String table) { 154 Map<String, Long> map = new HashMap<String, Long>(); 155 map.put("table#info", 3L); 156 return map; 157 } 158}