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