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 MetricsRegionWrapperStub implements MetricsRegionWrapper { 024 int replicaid = 0; 025 026 /** 027 * Replica ID set to 0 028 */ 029 public MetricsRegionWrapperStub() { 030 this.replicaid = 0; 031 } 032 033 /** 034 * Pass in replica ID 035 */ 036 public MetricsRegionWrapperStub(int replicaid) { 037 this.replicaid = replicaid; 038 } 039 040 @Override 041 public String getTableName() { 042 return "MetricsRegionWrapperStub"; 043 } 044 045 @Override 046 public String getNamespace() { 047 return "TestNS"; 048 } 049 050 @Override 051 public String getRegionName() { 052 return "DEADBEEF001"; 053 } 054 055 @Override 056 public long getNumStores() { 057 return 101; 058 } 059 060 @Override 061 public long getNumStoreFiles() { 062 return 102; 063 } 064 065 @Override 066 public long getStoreRefCount() { 067 return 0; 068 } 069 070 @Override 071 public long getMaxCompactedStoreFileRefCount() { 072 return 0; 073 } 074 075 @Override 076 public long getMemStoreSize() { 077 return 103; 078 } 079 080 @Override 081 public long getStoreFileSize() { 082 return 104; 083 } 084 085 @Override 086 public long getReadRequestCount() { 087 return 105; 088 } 089 090 @Override 091 public long getFilteredReadRequestCount() { 092 return 107; 093 } 094 095 @Override 096 public long getMaxStoreFileAge() { 097 return 2; 098 } 099 100 @Override 101 public long getMinStoreFileAge() { 102 return 2; 103 } 104 105 @Override 106 public long getAvgStoreFileAge() { 107 return 2; 108 } 109 110 @Override 111 public long getNumReferenceFiles() { 112 return 2; 113 } 114 115 @Override 116 public long getWriteRequestCount() { 117 return 106; 118 } 119 120 @Override 121 public long getNumFilesCompacted() { 122 return 0; 123 } 124 125 @Override 126 public long getNumBytesCompacted() { 127 return 0; 128 } 129 130 @Override 131 public long getNumCompactionsCompleted() { 132 return 0; 133 } 134 135 @Override 136 public long getLastMajorCompactionAge() { 137 return 0; 138 } 139 140 @Override 141 public long getNumCompactionsFailed() { 142 return 0; 143 } 144 145 @Override 146 public int getRegionHashCode() { 147 return 42; 148 } 149 150 /** 151 * Get the replica id of this region. 152 */ 153 @Override 154 public int getReplicaId() { 155 return replicaid; 156 } 157 158 @Override 159 public long getNumCompactionsQueued() { 160 return 4; 161 } 162 163 @Override 164 public long getNumFlushesQueued() { 165 return 6; 166 } 167 168 @Override 169 public long getMaxCompactionQueueSize() { 170 return 4; 171 } 172 173 @Override 174 public long getMaxFlushQueueSize() { 175 return 6; 176 } 177 178 @Override 179 public long getTotalRequestCount() { 180 return 0; 181 } 182 183 @Override 184 public Map<String, Long> getMemstoreOnlyRowReadsCount() { 185 Map<String, Long> map = new HashMap<>(); 186 map.put("info", 0L); 187 return map; 188 } 189 190 @Override 191 public Map<String, Long> getMixedRowReadsCount() { 192 Map<String, Long> map = new HashMap<>(); 193 map.put("info", 0L); 194 return map; 195 } 196}