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 getMemStoreHeapSize(String table) {
058    return 1001;
059  }
060
061  @Override
062  public long getMemStoreOffHeapSize(String table) {
063    return 1002;
064  }
065
066  @Override
067  public long getStoreFileSize(String table) {
068    return 2000;
069  }
070
071  @Override
072  public long getTableSize(String table) {
073    return 3000;
074  }
075
076  public String getTableName() {
077    return tableName;
078  }
079
080  @Override
081  public long getNumRegions(String table) {
082    return 11;
083  }
084
085  @Override
086  public long getNumStores(String table) {
087    return 22;
088  }
089
090  @Override
091  public long getNumStoreFiles(String table) {
092    return 33;
093  }
094
095  @Override
096  public long getMaxStoreFiles(String table) {
097    return 8;
098  }
099
100  @Override
101  public long getMaxStoreFileAge(String table) {
102    return 44;
103  }
104
105  @Override
106  public long getMinStoreFileAge(String table) {
107    return 55;
108  }
109
110  @Override
111  public long getAvgStoreFileAge(String table) {
112    return 66;
113  }
114
115  @Override
116  public long getNumReferenceFiles(String table) {
117    return 77;
118  }
119
120  @Override
121  public long getAvgRegionSize(String table) {
122    return 88;
123  }
124
125  @Override
126  public long getCpRequestsCount(String table) {
127    return 99;
128  }
129
130  @Override
131  public long getStaticIndexSize(String table) {
132    return 101;
133  }
134
135  @Override
136  public long getStaticBloomSize(String table) {
137    return 111;
138  }
139
140  @Override
141  public long getBloomFilterRequestsCount(String table) {
142    return 222;
143  }
144
145  @Override
146  public long getBloomFilterNegativeResultsCount(String table) {
147    return 333;
148  }
149
150  @Override
151  public long getBloomFilterEligibleRequestsCount(String table) {
152    return 444;
153  }
154
155  @Override
156  public Map<String, Long> getMemstoreOnlyRowReadsCount(String table) {
157    Map<String, Long> map = new HashMap<String, Long>();
158    map.put("table#info", 3L);
159    return map;
160  }
161
162  @Override
163  public Map<String, Long> getMixedRowReadsCount(String table) {
164    Map<String, Long> map = new HashMap<String, Long>();
165    map.put("table#info", 3L);
166    return map;
167  }
168}