View Javadoc

1   /**
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  package org.apache.hadoop.hbase.regionserver;
19  
20  import java.util.Collection;
21  import java.util.List;
22  import java.util.concurrent.ScheduledExecutorService;
23  import java.util.concurrent.TimeUnit;
24  
25  import org.apache.commons.lang.StringUtils;
26  import org.apache.commons.logging.Log;
27  import org.apache.commons.logging.LogFactory;
28  import org.apache.hadoop.hbase.classification.InterfaceAudience;
29  import org.apache.hadoop.hbase.CompatibilitySingletonFactory;
30  import org.apache.hadoop.hbase.HConstants;
31  import org.apache.hadoop.hbase.HDFSBlocksDistribution;
32  import org.apache.hadoop.hbase.HRegionInfo;
33  import org.apache.hadoop.hbase.ServerName;
34  import org.apache.hadoop.hbase.io.hfile.BlockCache;
35  import org.apache.hadoop.hbase.io.hfile.CacheConfig;
36  import org.apache.hadoop.hbase.io.hfile.CacheStats;
37  import org.apache.hadoop.hbase.wal.WALProvider;
38  import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
39  import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
40  import org.apache.hadoop.metrics2.MetricsExecutor;
41  
42  /**
43   * Impl for exposing HRegionServer Information through Hadoop's metrics 2 system.
44   */
45  @InterfaceAudience.Private
46  class MetricsRegionServerWrapperImpl
47      implements MetricsRegionServerWrapper {
48  
49    private static final Log LOG = LogFactory.getLog(MetricsRegionServerWrapperImpl.class);
50  
51    private final HRegionServer regionServer;
52  
53    private BlockCache blockCache;
54  
55    private volatile long numStores = 0;
56    private volatile long numWALFiles = 0;
57    private volatile long walFileSize = 0;
58    private volatile long numStoreFiles = 0;
59    private volatile long memstoreSize = 0;
60    private volatile long storeFileSize = 0;
61    private volatile long maxStoreFileAge = 0;
62    private volatile long minStoreFileAge = 0;
63    private volatile long avgStoreFileAge = 0;
64    private volatile long numReferenceFiles = 0;
65    private volatile double requestsPerSecond = 0.0;
66    private volatile long readRequestsCount = 0;
67    private volatile long writeRequestsCount = 0;
68    private volatile long checkAndMutateChecksFailed = 0;
69    private volatile long checkAndMutateChecksPassed = 0;
70    private volatile long storefileIndexSize = 0;
71    private volatile long totalStaticIndexSize = 0;
72    private volatile long totalStaticBloomSize = 0;
73    private volatile long numMutationsWithoutWAL = 0;
74    private volatile long dataInMemoryWithoutWAL = 0;
75    private volatile double percentFileLocal = 0;
76    private volatile double percentFileLocalSecondaryRegions = 0;
77    private volatile long flushedCellsCount = 0;
78    private volatile long compactedCellsCount = 0;
79    private volatile long majorCompactedCellsCount = 0;
80    private volatile long flushedCellsSize = 0;
81    private volatile long compactedCellsSize = 0;
82    private volatile long majorCompactedCellsSize = 0;
83    private volatile long blockedRequestsCount = 0L;
84    private volatile long averageRegionSize = 0L;
85  
86    private CacheStats cacheStats;
87    private CacheStats l1Stats = null;
88    private CacheStats l2Stats = null;
89    private ScheduledExecutorService executor;
90    private Runnable runnable;
91    private long period;
92  
93    public MetricsRegionServerWrapperImpl(final HRegionServer regionServer) {
94      this.regionServer = regionServer;
95      initBlockCache();
96  
97      this.period =
98          regionServer.conf.getLong(HConstants.REGIONSERVER_METRICS_PERIOD,
99            HConstants.DEFAULT_REGIONSERVER_METRICS_PERIOD);
100 
101     this.executor = CompatibilitySingletonFactory.getInstance(MetricsExecutor.class).getExecutor();
102     this.runnable = new RegionServerMetricsWrapperRunnable();
103     this.executor.scheduleWithFixedDelay(this.runnable, this.period, this.period,
104       TimeUnit.MILLISECONDS);
105 
106     if (LOG.isInfoEnabled()) {
107       LOG.info("Computing regionserver metrics every " + this.period + " milliseconds");
108     }
109   }
110 
111   /**
112    * It's possible that due to threading the block cache could not be initialized
113    * yet (testing multiple region servers in one jvm).  So we need to try and initialize
114    * the blockCache and cacheStats reference multiple times until we succeed.
115    */
116   private synchronized  void initBlockCache() {
117     CacheConfig cacheConfig = this.regionServer.cacheConfig;
118     if (cacheConfig != null) {
119       l1Stats = cacheConfig.getL1Stats();
120       l2Stats = cacheConfig.getL2Stats();
121       if (this.blockCache == null) {
122         this.blockCache = cacheConfig.getBlockCache();
123       }
124     }
125 
126     if (this.blockCache != null && this.cacheStats == null) {
127       this.cacheStats = blockCache.getStats();
128     }
129   }
130 
131   @Override
132   public String getClusterId() {
133     return regionServer.getClusterId();
134   }
135 
136   @Override
137   public long getStartCode() {
138     return regionServer.getStartcode();
139   }
140 
141   @Override
142   public String getZookeeperQuorum() {
143     ZooKeeperWatcher zk = regionServer.getZooKeeper();
144     if (zk == null) {
145       return "";
146     }
147     return zk.getQuorum();
148   }
149 
150   @Override
151   public String getCoprocessors() {
152     String[] coprocessors = regionServer.getRegionServerCoprocessors();
153     if (coprocessors == null || coprocessors.length == 0) {
154       return "";
155     }
156     return StringUtils.join(coprocessors, ", ");
157   }
158 
159   @Override
160   public String getServerName() {
161     ServerName serverName = regionServer.getServerName();
162     if (serverName == null) {
163       return "";
164     }
165     return serverName.getServerName();
166   }
167 
168   @Override
169   public long getNumOnlineRegions() {
170     Collection<Region> onlineRegionsLocalContext = regionServer.getOnlineRegionsLocalContext();
171     if (onlineRegionsLocalContext == null) {
172       return 0;
173     }
174     return onlineRegionsLocalContext.size();
175   }
176 
177   @Override
178   public long getTotalRequestCount() {
179     return regionServer.rpcServices.requestCount.get();
180   }
181 
182   @Override
183   public long getTotalRowActionRequestCount() {
184     return readRequestsCount + writeRequestsCount;
185   }
186 
187   @Override
188   public int getSplitQueueSize() {
189     if (this.regionServer.compactSplitThread == null) {
190       return 0;
191     }
192     return this.regionServer.compactSplitThread.getSplitQueueSize();
193   }
194 
195   @Override
196   public int getCompactionQueueSize() {
197     //The thread could be zero.  if so assume there is no queue.
198     if (this.regionServer.compactSplitThread == null) {
199       return 0;
200     }
201     return this.regionServer.compactSplitThread.getCompactionQueueSize();
202   }
203 
204   @Override
205   public int getSmallCompactionQueueSize() {
206     //The thread could be zero.  if so assume there is no queue.
207     if (this.regionServer.compactSplitThread == null) {
208       return 0;
209     }
210     return this.regionServer.compactSplitThread.getSmallCompactionQueueSize();
211   }
212 
213   @Override
214   public int getLargeCompactionQueueSize() {
215     //The thread could be zero.  if so assume there is no queue.
216     if (this.regionServer.compactSplitThread == null) {
217       return 0;
218     }
219     return this.regionServer.compactSplitThread.getLargeCompactionQueueSize();
220   }
221 
222   @Override
223   public int getFlushQueueSize() {
224     //If there is no flusher there should be no queue.
225     if (this.regionServer.cacheFlusher == null) {
226       return 0;
227     }
228     return this.regionServer.cacheFlusher.getFlushQueueSize();
229   }
230 
231   @Override
232   public long getBlockCacheCount() {
233     if (this.blockCache == null) {
234       return 0;
235     }
236     return this.blockCache.getBlockCount();
237   }
238 
239   @Override
240   public long getBlockCacheSize() {
241     if (this.blockCache == null) {
242       return 0;
243     }
244     return this.blockCache.getCurrentSize();
245   }
246 
247   @Override
248   public long getBlockCacheFreeSize() {
249     if (this.blockCache == null) {
250       return 0;
251     }
252     return this.blockCache.getFreeSize();
253   }
254 
255   @Override
256   public long getBlockCacheHitCount() {
257     if (this.cacheStats == null) {
258       return 0;
259     }
260     return this.cacheStats.getHitCount();
261   }
262 
263   @Override
264   public long getBlockCachePrimaryHitCount() {
265     if (this.cacheStats == null) {
266       return 0;
267     }
268     return this.cacheStats.getPrimaryHitCount();
269   }
270 
271   @Override
272   public long getBlockCacheMissCount() {
273     if (this.cacheStats == null) {
274       return 0;
275     }
276     return this.cacheStats.getMissCount();
277   }
278 
279   @Override
280   public long getBlockCachePrimaryMissCount() {
281     if (this.cacheStats == null) {
282       return 0;
283     }
284     return this.cacheStats.getPrimaryMissCount();
285   }
286 
287   @Override
288   public long getBlockCacheEvictedCount() {
289     if (this.cacheStats == null) {
290       return 0;
291     }
292     return this.cacheStats.getEvictedCount();
293   }
294 
295   @Override
296   public long getBlockCachePrimaryEvictedCount() {
297     if (this.cacheStats == null) {
298       return 0;
299     }
300     return this.cacheStats.getPrimaryEvictedCount();
301   }
302 
303   @Override
304   public double getBlockCacheHitPercent() {
305     if (this.cacheStats == null) {
306       return 0;
307     }
308     double ratio = this.cacheStats.getHitRatio();
309     if (Double.isNaN(ratio)) {
310       ratio = 0;
311     }
312     return (ratio * 100);
313   }
314 
315   @Override
316   public double getBlockCacheHitCachingPercent() {
317     if (this.cacheStats == null) {
318       return 0;
319     }
320 
321     double ratio = this.cacheStats.getHitCachingRatio();
322 
323     if (Double.isNaN(ratio)) {
324       ratio = 0;
325     }
326     return (ratio * 100);
327   }
328 
329   @Override
330   public long getBlockCacheFailedInsertions() {
331     if (this.cacheStats == null) {
332       return 0;
333     }
334     return this.cacheStats.getFailedInserts();
335   }
336 
337   @Override
338   public long getL1CacheHitCount() {
339     return 200;
340   }
341 
342   @Override
343   public long getL1CacheMissCount() {
344     if (this.l1Stats == null) {
345       return 0;
346     }
347     return this.l1Stats.getMissCount();
348   }
349 
350   @Override
351   public double getL1CacheHitRatio() {
352     if (this.l1Stats == null) {
353       return 0;
354     }
355     return this.l1Stats.getHitRatio();
356   }
357 
358   @Override
359   public double getL1CacheMissRatio() {
360     if (this.l1Stats == null) {
361       return 0;
362     }
363     return this.l1Stats.getMissRatio();
364   }
365 
366   @Override
367   public long getL2CacheHitCount() {
368     if (this.l2Stats == null) {
369       return 0;
370     }
371     return this.l2Stats.getHitCount();
372   }
373 
374   @Override
375   public long getL2CacheMissCount() {
376     if (this.l2Stats == null) {
377       return 0;
378     }
379     return this.l2Stats.getMissCount();
380   }
381 
382   @Override
383   public double getL2CacheHitRatio() {
384     if (this.l2Stats == null) {
385       return 0;
386     }
387     return this.l2Stats.getHitRatio();
388   }
389 
390   @Override
391   public double getL2CacheMissRatio() {
392     if (this.l2Stats == null) {
393       return 0;
394     }
395     return this.l2Stats.getMissRatio();
396   }
397 
398   @Override public void forceRecompute() {
399     this.runnable.run();
400   }
401 
402   @Override
403   public long getNumStores() {
404     return numStores;
405   }
406   
407   @Override
408   public long getNumWALFiles() {
409     return numWALFiles;
410   }
411 
412   @Override
413   public long getWALFileSize() {
414     return walFileSize;
415   }
416   
417   @Override
418   public long getNumStoreFiles() {
419     return numStoreFiles;
420   }
421 
422   @Override
423   public long getMaxStoreFileAge() {
424     return maxStoreFileAge;
425   }
426 
427   @Override
428   public long getMinStoreFileAge() {
429     return minStoreFileAge;
430   }
431 
432   @Override
433   public long getAvgStoreFileAge() {
434     return avgStoreFileAge;
435   }
436 
437   @Override
438   public long getNumReferenceFiles() {
439     return numReferenceFiles;
440   }
441 
442   @Override
443   public long getMemstoreSize() {
444     return memstoreSize;
445   }
446 
447   @Override
448   public long getStoreFileSize() {
449     return storeFileSize;
450   }
451 
452   @Override public double getRequestsPerSecond() {
453     return requestsPerSecond;
454   }
455 
456   @Override
457   public long getReadRequestsCount() {
458     return readRequestsCount;
459   }
460 
461   @Override
462   public long getWriteRequestsCount() {
463     return writeRequestsCount;
464   }
465 
466   @Override
467   public long getRpcGetRequestsCount() {
468     return regionServer.rpcServices.rpcGetRequestCount.get();
469   }
470 
471   @Override
472   public long getRpcScanRequestsCount() {
473     return regionServer.rpcServices.rpcScanRequestCount.get();
474   }
475 
476   @Override
477   public long getRpcMultiRequestsCount() {
478     return regionServer.rpcServices.rpcMultiRequestCount.get();
479   }
480 
481   @Override
482   public long getRpcMutateRequestsCount() {
483     return regionServer.rpcServices.rpcMutateRequestCount.get();
484   }
485 
486   @Override
487   public long getCheckAndMutateChecksFailed() {
488     return checkAndMutateChecksFailed;
489   }
490 
491   @Override
492   public long getCheckAndMutateChecksPassed() {
493     return checkAndMutateChecksPassed;
494   }
495 
496   @Override
497   public long getStoreFileIndexSize() {
498     return storefileIndexSize;
499   }
500 
501   @Override
502   public long getTotalStaticIndexSize() {
503     return totalStaticIndexSize;
504   }
505 
506   @Override
507   public long getTotalStaticBloomSize() {
508     return totalStaticBloomSize;
509   }
510 
511   @Override
512   public long getNumMutationsWithoutWAL() {
513     return numMutationsWithoutWAL;
514   }
515 
516   @Override
517   public long getDataInMemoryWithoutWAL() {
518     return dataInMemoryWithoutWAL;
519   }
520 
521   @Override
522   public double getPercentFileLocal() {
523     return percentFileLocal;
524   }
525 
526   @Override
527   public double getPercentFileLocalSecondaryRegions() {
528     return percentFileLocalSecondaryRegions;
529   }
530 
531   @Override
532   public long getUpdatesBlockedTime() {
533     if (this.regionServer.cacheFlusher == null) {
534       return 0;
535     }
536     return this.regionServer.cacheFlusher.getUpdatesBlockedMsHighWater().get();
537   }
538 
539   @Override
540   public long getFlushedCellsCount() {
541     return flushedCellsCount;
542   }
543 
544   @Override
545   public long getCompactedCellsCount() {
546     return compactedCellsCount;
547   }
548 
549   @Override
550   public long getMajorCompactedCellsCount() {
551     return majorCompactedCellsCount;
552   }
553 
554   @Override
555   public long getFlushedCellsSize() {
556     return flushedCellsSize;
557   }
558 
559   @Override
560   public long getCompactedCellsSize() {
561     return compactedCellsSize;
562   }
563 
564   @Override
565   public long getMajorCompactedCellsSize() {
566     return majorCompactedCellsSize;
567   }
568 
569   /**
570    * This is the runnable that will be executed on the executor every PERIOD number of seconds
571    * It will take metrics/numbers from all of the regions and use them to compute point in
572    * time metrics.
573    */
574   public class RegionServerMetricsWrapperRunnable implements Runnable {
575 
576     private long lastRan = 0;
577     private long lastRequestCount = 0;
578 
579     @Override
580     synchronized public void run() {
581       try {
582         initBlockCache();
583 
584         HDFSBlocksDistribution hdfsBlocksDistribution = new HDFSBlocksDistribution();
585         HDFSBlocksDistribution hdfsBlocksDistributionSecondaryRegions =
586             new HDFSBlocksDistribution();
587 
588         long tempNumStores = 0;
589         long tempNumStoreFiles = 0;
590         long tempMemstoreSize = 0;
591         long tempStoreFileSize = 0;
592         long tempMaxStoreFileAge = 0;
593         long tempNumReferenceFiles = 0;
594         long avgAgeNumerator = 0;
595         long numHFiles = 0;
596         long tempMinStoreFileAge = Long.MAX_VALUE;
597         long tempReadRequestsCount = 0;
598         long tempWriteRequestsCount = 0;
599         long tempCheckAndMutateChecksFailed = 0;
600         long tempCheckAndMutateChecksPassed = 0;
601         long tempStorefileIndexSize = 0;
602         long tempTotalStaticIndexSize = 0;
603         long tempTotalStaticBloomSize = 0;
604         long tempNumMutationsWithoutWAL = 0;
605         long tempDataInMemoryWithoutWAL = 0;
606         double tempPercentFileLocal = 0;
607         double tempPercentFileLocalSecondaryRegions = 0;
608         long tempFlushedCellsCount = 0;
609         long tempCompactedCellsCount = 0;
610         long tempMajorCompactedCellsCount = 0;
611         long tempFlushedCellsSize = 0;
612         long tempCompactedCellsSize = 0;
613         long tempMajorCompactedCellsSize = 0;
614         long tempBlockedRequestsCount = 0L;
615 
616         int regionCount = 0;
617         for (Region r : regionServer.getOnlineRegionsLocalContext()) {
618           tempNumMutationsWithoutWAL += r.getNumMutationsWithoutWAL();
619           tempDataInMemoryWithoutWAL += r.getDataInMemoryWithoutWAL();
620           tempReadRequestsCount += r.getReadRequestsCount();
621           tempWriteRequestsCount += r.getWriteRequestsCount();
622           tempCheckAndMutateChecksFailed += r.getCheckAndMutateChecksFailed();
623           tempCheckAndMutateChecksPassed += r.getCheckAndMutateChecksPassed();
624           tempBlockedRequestsCount += r.getBlockedRequestsCount();
625           List<Store> storeList = r.getStores();
626           tempNumStores += storeList.size();
627           for (Store store : storeList) {
628             tempNumStoreFiles += store.getStorefilesCount();
629             tempMemstoreSize += store.getMemStoreSize();
630             tempStoreFileSize += store.getStorefilesSize();
631 
632             long storeMaxStoreFileAge = store.getMaxStoreFileAge();
633             tempMaxStoreFileAge = (storeMaxStoreFileAge > tempMaxStoreFileAge) ?
634               storeMaxStoreFileAge : tempMaxStoreFileAge;
635 
636             long storeMinStoreFileAge = store.getMinStoreFileAge();
637             tempMinStoreFileAge = (storeMinStoreFileAge < tempMinStoreFileAge) ?
638               storeMinStoreFileAge : tempMinStoreFileAge;
639 
640             long storeHFiles = store.getNumHFiles();
641             avgAgeNumerator += store.getAvgStoreFileAge() * storeHFiles;
642             numHFiles += storeHFiles;
643             tempNumReferenceFiles += store.getNumReferenceFiles();
644 
645             tempStorefileIndexSize += store.getStorefilesIndexSize();
646             tempTotalStaticBloomSize += store.getTotalStaticBloomSize();
647             tempTotalStaticIndexSize += store.getTotalStaticIndexSize();
648             tempFlushedCellsCount += store.getFlushedCellsCount();
649             tempCompactedCellsCount += store.getCompactedCellsCount();
650             tempMajorCompactedCellsCount += store.getMajorCompactedCellsCount();
651             tempFlushedCellsSize += store.getFlushedCellsSize();
652             tempCompactedCellsSize += store.getCompactedCellsSize();
653             tempMajorCompactedCellsSize += store.getMajorCompactedCellsSize();
654           }
655 
656           HDFSBlocksDistribution distro = r.getHDFSBlocksDistribution();
657           hdfsBlocksDistribution.add(distro);
658           if (r.getRegionInfo().getReplicaId() != HRegionInfo.DEFAULT_REPLICA_ID) {
659             hdfsBlocksDistributionSecondaryRegions.add(distro);
660           }
661           regionCount++;
662         }
663 
664         float localityIndex =
665             hdfsBlocksDistribution
666                 .getBlockLocalityIndex(regionServer.getServerName().getHostname());
667         tempPercentFileLocal = Double.isNaN(tempBlockedRequestsCount) ? 0 : (localityIndex * 100);
668 
669         float localityIndexSecondaryRegions =
670             hdfsBlocksDistributionSecondaryRegions.getBlockLocalityIndex(regionServer
671                 .getServerName().getHostname());
672         tempPercentFileLocalSecondaryRegions = Double
673             .isNaN(localityIndexSecondaryRegions) ? 0 : (localityIndexSecondaryRegions * 100);
674 
675         // Compute the number of requests per second
676         long currentTime = EnvironmentEdgeManager.currentTime();
677 
678         // assume that it took PERIOD seconds to start the executor.
679         // this is a guess but it's a pretty good one.
680         if (lastRan == 0) {
681           lastRan = currentTime - period;
682         }
683 
684         // If we've time traveled keep the last requests per second.
685         if ((currentTime - lastRan) > 0) {
686           long currentRequestCount = getTotalRequestCount();
687           requestsPerSecond =
688               (currentRequestCount - lastRequestCount) / ((currentTime - lastRan) / 1000.0);
689           lastRequestCount = currentRequestCount;
690         }
691         lastRan = currentTime;
692 
693         WALProvider provider = regionServer.walFactory.getWALProvider();
694         WALProvider metaProvider = regionServer.walFactory.getMetaWALProvider();
695         numWALFiles =
696             (provider == null ? 0 : provider.getNumLogFiles())
697                 + (metaProvider == null ? 0 : metaProvider.getNumLogFiles());
698         walFileSize =
699             (provider == null ? 0 : provider.getLogFileSize())
700                 + (provider == null ? 0 : provider.getLogFileSize());
701         // Copy over computed values so that no thread sees half computed values.
702         numStores = tempNumStores;
703         numStoreFiles = tempNumStoreFiles;
704         memstoreSize = tempMemstoreSize;
705         storeFileSize = tempStoreFileSize;
706         maxStoreFileAge = tempMaxStoreFileAge;
707         if (regionCount > 0) {
708           averageRegionSize = (memstoreSize + storeFileSize) / regionCount;
709         }
710         if (tempMinStoreFileAge != Long.MAX_VALUE) {
711           minStoreFileAge = tempMinStoreFileAge;
712         }
713 
714         if (numHFiles != 0) {
715           avgStoreFileAge = avgAgeNumerator / numHFiles;
716         }
717 
718         numReferenceFiles= tempNumReferenceFiles;
719         readRequestsCount = tempReadRequestsCount;
720         writeRequestsCount = tempWriteRequestsCount;
721         checkAndMutateChecksFailed = tempCheckAndMutateChecksFailed;
722         checkAndMutateChecksPassed = tempCheckAndMutateChecksPassed;
723         storefileIndexSize = tempStorefileIndexSize;
724         totalStaticIndexSize = tempTotalStaticIndexSize;
725         totalStaticBloomSize = tempTotalStaticBloomSize;
726         numMutationsWithoutWAL = tempNumMutationsWithoutWAL;
727         dataInMemoryWithoutWAL = tempDataInMemoryWithoutWAL;
728         percentFileLocal = tempPercentFileLocal;
729         percentFileLocalSecondaryRegions = tempPercentFileLocalSecondaryRegions;
730         flushedCellsCount = tempFlushedCellsCount;
731         compactedCellsCount = tempCompactedCellsCount;
732         majorCompactedCellsCount = tempMajorCompactedCellsCount;
733         flushedCellsSize = tempFlushedCellsSize;
734         compactedCellsSize = tempCompactedCellsSize;
735         majorCompactedCellsSize = tempMajorCompactedCellsSize;
736         blockedRequestsCount = tempBlockedRequestsCount;
737       } catch (Throwable e) {
738         LOG.warn("Caught exception! Will suppress and retry.", e);
739       }
740     }
741   }
742 
743   @Override
744   public long getBlockedRequestsCount() {
745     return blockedRequestsCount;
746   }
747 
748   @Override
749   public long getAverageRegionSize() {
750     return averageRegionSize;
751   }
752 
753   public long getDataMissCount() {
754     if (this.cacheStats == null) {
755       return 0;
756     }
757     return cacheStats.getDataMissCount();
758   }
759 
760   @Override
761   public long getLeafIndexMissCount() {
762     if (this.cacheStats == null) {
763       return 0;
764     }
765     return cacheStats.getLeafIndexMissCount();
766   }
767 
768   @Override
769   public long getBloomChunkMissCount() {
770     if (this.cacheStats == null) {
771       return 0;
772     }
773     return cacheStats.getBloomChunkMissCount();
774   }
775 
776   @Override
777   public long getMetaMissCount() {
778     if (this.cacheStats == null) {
779       return 0;
780     }
781     return cacheStats.getMetaMissCount();
782   }
783 
784   @Override
785   public long getRootIndexMissCount() {
786     if (this.cacheStats == null) {
787       return 0;
788     }
789     return cacheStats.getRootIndexMissCount();
790   }
791 
792   @Override
793   public long getIntermediateIndexMissCount() {
794     if (this.cacheStats == null) {
795       return 0;
796     }
797     return cacheStats.getIntermediateIndexMissCount();
798   }
799 
800   @Override
801   public long getFileInfoMissCount() {
802     if (this.cacheStats == null) {
803       return 0;
804     }
805     return cacheStats.getFileInfoMissCount();
806   }
807 
808   @Override
809   public long getGeneralBloomMetaMissCount() {
810     if (this.cacheStats == null) {
811       return 0;
812     }
813     return cacheStats.getGeneralBloomMetaMissCount();
814   }
815 
816   @Override
817   public long getDeleteFamilyBloomMissCount() {
818     if (this.cacheStats == null) {
819       return 0;
820     }
821     return cacheStats.getDeleteFamilyBloomMissCount();
822   }
823 
824   @Override
825   public long getTrailerMissCount() {
826     if (this.cacheStats == null) {
827       return 0;
828     }
829     return cacheStats.getTrailerMissCount();
830   }
831 
832   @Override
833   public long getDataHitCount() {
834     if (this.cacheStats == null) {
835       return 0;
836     }
837     return cacheStats.getDataHitCount();
838   }
839 
840   @Override
841   public long getLeafIndexHitCount() {
842     if (this.cacheStats == null) {
843       return 0;
844     }
845     return cacheStats.getLeafIndexHitCount();
846   }
847 
848   @Override
849   public long getBloomChunkHitCount() {
850     if (this.cacheStats == null) {
851       return 0;
852     }
853     return cacheStats.getBloomChunkHitCount();
854   }
855 
856   @Override
857   public long getMetaHitCount() {
858     if (this.cacheStats == null) {
859       return 0;
860     }
861     return cacheStats.getMetaHitCount();
862   }
863 
864   @Override
865   public long getRootIndexHitCount() {
866     if (this.cacheStats == null) {
867       return 0;
868     }
869     return cacheStats.getRootIndexHitCount();
870   }
871 
872   @Override
873   public long getIntermediateIndexHitCount() {
874     if (this.cacheStats == null) {
875       return 0;
876     }
877     return cacheStats.getIntermediateIndexHitCount();
878   }
879 
880   @Override
881   public long getFileInfoHitCount() {
882     if (this.cacheStats == null) {
883       return 0;
884     }
885     return cacheStats.getFileInfoHitCount();
886   }
887 
888   @Override
889   public long getGeneralBloomMetaHitCount() {
890     if (this.cacheStats == null) {
891       return 0;
892     }
893     return cacheStats.getGeneralBloomMetaHitCount();
894   }
895 
896   @Override
897   public long getDeleteFamilyBloomHitCount() {
898     if (this.cacheStats == null) {
899       return 0;
900     }
901     return cacheStats.getDeleteFamilyBloomHitCount();
902   }
903 
904   @Override
905   public long getTrailerHitCount() {
906     if (this.cacheStats == null) {
907       return 0;
908     }
909     return cacheStats.getTrailerHitCount();
910   }
911 }