1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
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 ScheduledExecutorService executor;
88 private Runnable runnable;
89 private long period;
90
91 public MetricsRegionServerWrapperImpl(final HRegionServer regionServer) {
92 this.regionServer = regionServer;
93 initBlockCache();
94
95 this.period =
96 regionServer.conf.getLong(HConstants.REGIONSERVER_METRICS_PERIOD,
97 HConstants.DEFAULT_REGIONSERVER_METRICS_PERIOD);
98
99 this.executor = CompatibilitySingletonFactory.getInstance(MetricsExecutor.class).getExecutor();
100 this.runnable = new RegionServerMetricsWrapperRunnable();
101 this.executor.scheduleWithFixedDelay(this.runnable, this.period, this.period,
102 TimeUnit.MILLISECONDS);
103
104 if (LOG.isInfoEnabled()) {
105 LOG.info("Computing regionserver metrics every " + this.period + " milliseconds");
106 }
107 }
108
109
110
111
112
113
114 private synchronized void initBlockCache() {
115 CacheConfig cacheConfig = this.regionServer.cacheConfig;
116 if (cacheConfig != null && this.blockCache == null) {
117 this.blockCache = cacheConfig.getBlockCache();
118 }
119
120 if (this.blockCache != null && this.cacheStats == null) {
121 this.cacheStats = blockCache.getStats();
122 }
123 }
124
125 @Override
126 public String getClusterId() {
127 return regionServer.getClusterId();
128 }
129
130 @Override
131 public long getStartCode() {
132 return regionServer.getStartcode();
133 }
134
135 @Override
136 public String getZookeeperQuorum() {
137 ZooKeeperWatcher zk = regionServer.getZooKeeper();
138 if (zk == null) {
139 return "";
140 }
141 return zk.getQuorum();
142 }
143
144 @Override
145 public String getCoprocessors() {
146 String[] coprocessors = regionServer.getRegionServerCoprocessors();
147 if (coprocessors == null || coprocessors.length == 0) {
148 return "";
149 }
150 return StringUtils.join(coprocessors, ", ");
151 }
152
153 @Override
154 public String getServerName() {
155 ServerName serverName = regionServer.getServerName();
156 if (serverName == null) {
157 return "";
158 }
159 return serverName.getServerName();
160 }
161
162 @Override
163 public long getNumOnlineRegions() {
164 Collection<Region> onlineRegionsLocalContext = regionServer.getOnlineRegionsLocalContext();
165 if (onlineRegionsLocalContext == null) {
166 return 0;
167 }
168 return onlineRegionsLocalContext.size();
169 }
170
171 @Override
172 public long getTotalRequestCount() {
173 return regionServer.rpcServices.requestCount.get();
174 }
175
176 @Override
177 public int getSplitQueueSize() {
178 if (this.regionServer.compactSplitThread == null) {
179 return 0;
180 }
181 return this.regionServer.compactSplitThread.getSplitQueueSize();
182 }
183
184 @Override
185 public int getCompactionQueueSize() {
186
187 if (this.regionServer.compactSplitThread == null) {
188 return 0;
189 }
190 return this.regionServer.compactSplitThread.getCompactionQueueSize();
191 }
192
193 @Override
194 public int getSmallCompactionQueueSize() {
195
196 if (this.regionServer.compactSplitThread == null) {
197 return 0;
198 }
199 return this.regionServer.compactSplitThread.getSmallCompactionQueueSize();
200 }
201
202 @Override
203 public int getLargeCompactionQueueSize() {
204
205 if (this.regionServer.compactSplitThread == null) {
206 return 0;
207 }
208 return this.regionServer.compactSplitThread.getLargeCompactionQueueSize();
209 }
210
211 @Override
212 public int getFlushQueueSize() {
213
214 if (this.regionServer.cacheFlusher == null) {
215 return 0;
216 }
217 return this.regionServer.cacheFlusher.getFlushQueueSize();
218 }
219
220 @Override
221 public long getBlockCacheCount() {
222 if (this.blockCache == null) {
223 return 0;
224 }
225 return this.blockCache.getBlockCount();
226 }
227
228 @Override
229 public long getBlockCacheSize() {
230 if (this.blockCache == null) {
231 return 0;
232 }
233 return this.blockCache.getCurrentSize();
234 }
235
236 @Override
237 public long getBlockCacheFreeSize() {
238 if (this.blockCache == null) {
239 return 0;
240 }
241 return this.blockCache.getFreeSize();
242 }
243
244 @Override
245 public long getBlockCacheHitCount() {
246 if (this.cacheStats == null) {
247 return 0;
248 }
249 return this.cacheStats.getHitCount();
250 }
251
252 @Override
253 public long getBlockCachePrimaryHitCount() {
254 if (this.cacheStats == null) {
255 return 0;
256 }
257 return this.cacheStats.getPrimaryHitCount();
258 }
259
260 @Override
261 public long getBlockCacheMissCount() {
262 if (this.cacheStats == null) {
263 return 0;
264 }
265 return this.cacheStats.getMissCount();
266 }
267
268 @Override
269 public long getBlockCachePrimaryMissCount() {
270 if (this.cacheStats == null) {
271 return 0;
272 }
273 return this.cacheStats.getPrimaryMissCount();
274 }
275
276 @Override
277 public long getBlockCacheEvictedCount() {
278 if (this.cacheStats == null) {
279 return 0;
280 }
281 return this.cacheStats.getEvictedCount();
282 }
283
284 @Override
285 public long getBlockCachePrimaryEvictedCount() {
286 if (this.cacheStats == null) {
287 return 0;
288 }
289 return this.cacheStats.getPrimaryEvictedCount();
290 }
291
292 @Override
293 public double getBlockCacheHitPercent() {
294 if (this.cacheStats == null) {
295 return 0;
296 }
297 double ratio = this.cacheStats.getHitRatio();
298 if (Double.isNaN(ratio)) {
299 ratio = 0;
300 }
301 return (ratio * 100);
302 }
303
304 @Override
305 public double getBlockCacheHitCachingPercent() {
306 if (this.cacheStats == null) {
307 return 0;
308 }
309
310 double ratio = this.cacheStats.getHitCachingRatio();
311
312 if (Double.isNaN(ratio)) {
313 ratio = 0;
314 }
315 return (ratio * 100);
316 }
317
318 @Override
319 public long getBlockCacheFailedInsertions() {
320 if (this.cacheStats == null) {
321 return 0;
322 }
323 return this.cacheStats.getFailedInserts();
324 }
325
326 @Override public void forceRecompute() {
327 this.runnable.run();
328 }
329
330 @Override
331 public long getNumStores() {
332 return numStores;
333 }
334
335 @Override
336 public long getNumWALFiles() {
337 return numWALFiles;
338 }
339
340 @Override
341 public long getWALFileSize() {
342 return walFileSize;
343 }
344
345 @Override
346 public long getNumStoreFiles() {
347 return numStoreFiles;
348 }
349
350 @Override
351 public long getMaxStoreFileAge() {
352 return maxStoreFileAge;
353 }
354
355 @Override
356 public long getMinStoreFileAge() {
357 return minStoreFileAge;
358 }
359
360 @Override
361 public long getAvgStoreFileAge() {
362 return avgStoreFileAge;
363 }
364
365 @Override
366 public long getNumReferenceFiles() {
367 return numReferenceFiles;
368 }
369
370 @Override
371 public long getMemstoreSize() {
372 return memstoreSize;
373 }
374
375 @Override
376 public long getStoreFileSize() {
377 return storeFileSize;
378 }
379
380 @Override public double getRequestsPerSecond() {
381 return requestsPerSecond;
382 }
383
384 @Override
385 public long getReadRequestsCount() {
386 return readRequestsCount;
387 }
388
389 @Override
390 public long getWriteRequestsCount() {
391 return writeRequestsCount;
392 }
393
394 @Override
395 public long getRpcGetRequestsCount() {
396 return regionServer.rpcServices.rpcGetRequestCount.get();
397 }
398
399 @Override
400 public long getRpcScanRequestsCount() {
401 return regionServer.rpcServices.rpcScanRequestCount.get();
402 }
403
404 @Override
405 public long getRpcMultiRequestsCount() {
406 return regionServer.rpcServices.rpcMultiRequestCount.get();
407 }
408
409 @Override
410 public long getRpcMutateRequestsCount() {
411 return regionServer.rpcServices.rpcMutateRequestCount.get();
412 }
413
414 @Override
415 public long getCheckAndMutateChecksFailed() {
416 return checkAndMutateChecksFailed;
417 }
418
419 @Override
420 public long getCheckAndMutateChecksPassed() {
421 return checkAndMutateChecksPassed;
422 }
423
424 @Override
425 public long getStoreFileIndexSize() {
426 return storefileIndexSize;
427 }
428
429 @Override
430 public long getTotalStaticIndexSize() {
431 return totalStaticIndexSize;
432 }
433
434 @Override
435 public long getTotalStaticBloomSize() {
436 return totalStaticBloomSize;
437 }
438
439 @Override
440 public long getNumMutationsWithoutWAL() {
441 return numMutationsWithoutWAL;
442 }
443
444 @Override
445 public long getDataInMemoryWithoutWAL() {
446 return dataInMemoryWithoutWAL;
447 }
448
449 @Override
450 public double getPercentFileLocal() {
451 return percentFileLocal;
452 }
453
454 @Override
455 public double getPercentFileLocalSecondaryRegions() {
456 return percentFileLocalSecondaryRegions;
457 }
458
459 @Override
460 public long getUpdatesBlockedTime() {
461 if (this.regionServer.cacheFlusher == null) {
462 return 0;
463 }
464 return this.regionServer.cacheFlusher.getUpdatesBlockedMsHighWater().get();
465 }
466
467 @Override
468 public long getFlushedCellsCount() {
469 return flushedCellsCount;
470 }
471
472 @Override
473 public long getCompactedCellsCount() {
474 return compactedCellsCount;
475 }
476
477 @Override
478 public long getMajorCompactedCellsCount() {
479 return majorCompactedCellsCount;
480 }
481
482 @Override
483 public long getFlushedCellsSize() {
484 return flushedCellsSize;
485 }
486
487 @Override
488 public long getCompactedCellsSize() {
489 return compactedCellsSize;
490 }
491
492 @Override
493 public long getMajorCompactedCellsSize() {
494 return majorCompactedCellsSize;
495 }
496
497
498
499
500
501
502 public class RegionServerMetricsWrapperRunnable implements Runnable {
503
504 private long lastRan = 0;
505 private long lastRequestCount = 0;
506
507 @Override
508 synchronized public void run() {
509 try {
510 initBlockCache();
511
512 HDFSBlocksDistribution hdfsBlocksDistribution = new HDFSBlocksDistribution();
513 HDFSBlocksDistribution hdfsBlocksDistributionSecondaryRegions =
514 new HDFSBlocksDistribution();
515
516 long tempNumStores = 0;
517 long tempNumStoreFiles = 0;
518 long tempMemstoreSize = 0;
519 long tempStoreFileSize = 0;
520 long tempMaxStoreFileAge = 0;
521 long tempNumReferenceFiles = 0;
522 long avgAgeNumerator = 0;
523 long numHFiles = 0;
524 long tempMinStoreFileAge = Long.MAX_VALUE;
525 long tempReadRequestsCount = 0;
526 long tempWriteRequestsCount = 0;
527 long tempCheckAndMutateChecksFailed = 0;
528 long tempCheckAndMutateChecksPassed = 0;
529 long tempStorefileIndexSize = 0;
530 long tempTotalStaticIndexSize = 0;
531 long tempTotalStaticBloomSize = 0;
532 long tempNumMutationsWithoutWAL = 0;
533 long tempDataInMemoryWithoutWAL = 0;
534 double tempPercentFileLocal = 0;
535 double tempPercentFileLocalSecondaryRegions = 0;
536 long tempFlushedCellsCount = 0;
537 long tempCompactedCellsCount = 0;
538 long tempMajorCompactedCellsCount = 0;
539 long tempFlushedCellsSize = 0;
540 long tempCompactedCellsSize = 0;
541 long tempMajorCompactedCellsSize = 0;
542 long tempBlockedRequestsCount = 0L;
543
544 int regionCount = 0;
545 for (Region r : regionServer.getOnlineRegionsLocalContext()) {
546 tempNumMutationsWithoutWAL += r.getNumMutationsWithoutWAL();
547 tempDataInMemoryWithoutWAL += r.getDataInMemoryWithoutWAL();
548 tempReadRequestsCount += r.getReadRequestsCount();
549 tempWriteRequestsCount += r.getWriteRequestsCount();
550 tempCheckAndMutateChecksFailed += r.getCheckAndMutateChecksFailed();
551 tempCheckAndMutateChecksPassed += r.getCheckAndMutateChecksPassed();
552 tempBlockedRequestsCount += r.getBlockedRequestsCount();
553 List<Store> storeList = r.getStores();
554 tempNumStores += storeList.size();
555 for (Store store : storeList) {
556 tempNumStoreFiles += store.getStorefilesCount();
557 tempMemstoreSize += store.getMemStoreSize();
558 tempStoreFileSize += store.getStorefilesSize();
559
560 long storeMaxStoreFileAge = store.getMaxStoreFileAge();
561 tempMaxStoreFileAge = (storeMaxStoreFileAge > tempMaxStoreFileAge) ?
562 storeMaxStoreFileAge : tempMaxStoreFileAge;
563
564 long storeMinStoreFileAge = store.getMinStoreFileAge();
565 tempMinStoreFileAge = (storeMinStoreFileAge < tempMinStoreFileAge) ?
566 storeMinStoreFileAge : tempMinStoreFileAge;
567
568 long storeHFiles = store.getNumHFiles();
569 avgAgeNumerator += store.getAvgStoreFileAge() * storeHFiles;
570 numHFiles += storeHFiles;
571 tempNumReferenceFiles += store.getNumReferenceFiles();
572
573 tempStorefileIndexSize += store.getStorefilesIndexSize();
574 tempTotalStaticBloomSize += store.getTotalStaticBloomSize();
575 tempTotalStaticIndexSize += store.getTotalStaticIndexSize();
576 tempFlushedCellsCount += store.getFlushedCellsCount();
577 tempCompactedCellsCount += store.getCompactedCellsCount();
578 tempMajorCompactedCellsCount += store.getMajorCompactedCellsCount();
579 tempFlushedCellsSize += store.getFlushedCellsSize();
580 tempCompactedCellsSize += store.getCompactedCellsSize();
581 tempMajorCompactedCellsSize += store.getMajorCompactedCellsSize();
582 }
583
584 HDFSBlocksDistribution distro = r.getHDFSBlocksDistribution();
585 hdfsBlocksDistribution.add(distro);
586 if (r.getRegionInfo().getReplicaId() != HRegionInfo.DEFAULT_REPLICA_ID) {
587 hdfsBlocksDistributionSecondaryRegions.add(distro);
588 }
589 regionCount++;
590 }
591
592 float localityIndex =
593 hdfsBlocksDistribution
594 .getBlockLocalityIndex(regionServer.getServerName().getHostname());
595 tempPercentFileLocal = Double.isNaN(tempBlockedRequestsCount) ? 0 : (localityIndex * 100);
596
597 float localityIndexSecondaryRegions =
598 hdfsBlocksDistributionSecondaryRegions.getBlockLocalityIndex(regionServer
599 .getServerName().getHostname());
600 tempPercentFileLocalSecondaryRegions = Double
601 .isNaN(localityIndexSecondaryRegions) ? 0 : (localityIndexSecondaryRegions * 100);
602
603
604 long currentTime = EnvironmentEdgeManager.currentTime();
605
606
607
608 if (lastRan == 0) {
609 lastRan = currentTime - period;
610 }
611
612
613 if ((currentTime - lastRan) > 0) {
614 long currentRequestCount = getTotalRequestCount();
615 requestsPerSecond =
616 (currentRequestCount - lastRequestCount) / ((currentTime - lastRan) / 1000.0);
617 lastRequestCount = currentRequestCount;
618 }
619 lastRan = currentTime;
620
621 WALProvider provider = regionServer.walFactory.getWALProvider();
622 WALProvider metaProvider = regionServer.walFactory.getMetaWALProvider();
623 numWALFiles =
624 (provider == null ? 0 : provider.getNumLogFiles())
625 + (metaProvider == null ? 0 : metaProvider.getNumLogFiles());
626 walFileSize =
627 (provider == null ? 0 : provider.getLogFileSize())
628 + (provider == null ? 0 : provider.getLogFileSize());
629
630 numStores = tempNumStores;
631 numStoreFiles = tempNumStoreFiles;
632 memstoreSize = tempMemstoreSize;
633 storeFileSize = tempStoreFileSize;
634 maxStoreFileAge = tempMaxStoreFileAge;
635 if (regionCount > 0) {
636 averageRegionSize = (memstoreSize + storeFileSize) / regionCount;
637 }
638 if (tempMinStoreFileAge != Long.MAX_VALUE) {
639 minStoreFileAge = tempMinStoreFileAge;
640 }
641
642 if (numHFiles != 0) {
643 avgStoreFileAge = avgAgeNumerator / numHFiles;
644 }
645
646 numReferenceFiles= tempNumReferenceFiles;
647 readRequestsCount = tempReadRequestsCount;
648 writeRequestsCount = tempWriteRequestsCount;
649 checkAndMutateChecksFailed = tempCheckAndMutateChecksFailed;
650 checkAndMutateChecksPassed = tempCheckAndMutateChecksPassed;
651 storefileIndexSize = tempStorefileIndexSize;
652 totalStaticIndexSize = tempTotalStaticIndexSize;
653 totalStaticBloomSize = tempTotalStaticBloomSize;
654 numMutationsWithoutWAL = tempNumMutationsWithoutWAL;
655 dataInMemoryWithoutWAL = tempDataInMemoryWithoutWAL;
656 percentFileLocal = tempPercentFileLocal;
657 percentFileLocalSecondaryRegions = tempPercentFileLocalSecondaryRegions;
658 flushedCellsCount = tempFlushedCellsCount;
659 compactedCellsCount = tempCompactedCellsCount;
660 majorCompactedCellsCount = tempMajorCompactedCellsCount;
661 flushedCellsSize = tempFlushedCellsSize;
662 compactedCellsSize = tempCompactedCellsSize;
663 majorCompactedCellsSize = tempMajorCompactedCellsSize;
664 blockedRequestsCount = tempBlockedRequestsCount;
665 } catch (Throwable e) {
666 LOG.warn("Caught exception! Will suppress and retry.", e);
667 }
668 }
669 }
670
671 @Override
672 public long getBlockedRequestsCount() {
673 return blockedRequestsCount;
674 }
675
676 @Override
677 public long getAverageRegionSize() {
678 return averageRegionSize;
679 }
680
681 public long getDataMissCount() {
682 if (this.cacheStats == null) {
683 return 0;
684 }
685 return cacheStats.getDataMissCount();
686 }
687
688 @Override
689 public long getLeafIndexMissCount() {
690 if (this.cacheStats == null) {
691 return 0;
692 }
693 return cacheStats.getLeafIndexMissCount();
694 }
695
696 @Override
697 public long getBloomChunkMissCount() {
698 if (this.cacheStats == null) {
699 return 0;
700 }
701 return cacheStats.getBloomChunkMissCount();
702 }
703
704 @Override
705 public long getMetaMissCount() {
706 if (this.cacheStats == null) {
707 return 0;
708 }
709 return cacheStats.getMetaMissCount();
710 }
711
712 @Override
713 public long getRootIndexMissCount() {
714 if (this.cacheStats == null) {
715 return 0;
716 }
717 return cacheStats.getRootIndexMissCount();
718 }
719
720 @Override
721 public long getIntermediateIndexMissCount() {
722 if (this.cacheStats == null) {
723 return 0;
724 }
725 return cacheStats.getIntermediateIndexMissCount();
726 }
727
728 @Override
729 public long getFileInfoMissCount() {
730 if (this.cacheStats == null) {
731 return 0;
732 }
733 return cacheStats.getFileInfoMissCount();
734 }
735
736 @Override
737 public long getGeneralBloomMetaMissCount() {
738 if (this.cacheStats == null) {
739 return 0;
740 }
741 return cacheStats.getGeneralBloomMetaMissCount();
742 }
743
744 @Override
745 public long getDeleteFamilyBloomMissCount() {
746 if (this.cacheStats == null) {
747 return 0;
748 }
749 return cacheStats.getDeleteFamilyBloomMissCount();
750 }
751
752 @Override
753 public long getTrailerMissCount() {
754 if (this.cacheStats == null) {
755 return 0;
756 }
757 return cacheStats.getTrailerMissCount();
758 }
759
760 @Override
761 public long getDataHitCount() {
762 if (this.cacheStats == null) {
763 return 0;
764 }
765 return cacheStats.getDataHitCount();
766 }
767
768 @Override
769 public long getLeafIndexHitCount() {
770 if (this.cacheStats == null) {
771 return 0;
772 }
773 return cacheStats.getLeafIndexHitCount();
774 }
775
776 @Override
777 public long getBloomChunkHitCount() {
778 if (this.cacheStats == null) {
779 return 0;
780 }
781 return cacheStats.getBloomChunkHitCount();
782 }
783
784 @Override
785 public long getMetaHitCount() {
786 if (this.cacheStats == null) {
787 return 0;
788 }
789 return cacheStats.getMetaHitCount();
790 }
791
792 @Override
793 public long getRootIndexHitCount() {
794 if (this.cacheStats == null) {
795 return 0;
796 }
797 return cacheStats.getRootIndexHitCount();
798 }
799
800 @Override
801 public long getIntermediateIndexHitCount() {
802 if (this.cacheStats == null) {
803 return 0;
804 }
805 return cacheStats.getIntermediateIndexHitCount();
806 }
807
808 @Override
809 public long getFileInfoHitCount() {
810 if (this.cacheStats == null) {
811 return 0;
812 }
813 return cacheStats.getFileInfoHitCount();
814 }
815
816 @Override
817 public long getGeneralBloomMetaHitCount() {
818 if (this.cacheStats == null) {
819 return 0;
820 }
821 return cacheStats.getGeneralBloomMetaHitCount();
822 }
823
824 @Override
825 public long getDeleteFamilyBloomHitCount() {
826 if (this.cacheStats == null) {
827 return 0;
828 }
829 return cacheStats.getDeleteFamilyBloomHitCount();
830 }
831
832 @Override
833 public long getTrailerHitCount() {
834 if (this.cacheStats == null) {
835 return 0;
836 }
837 return cacheStats.getTrailerHitCount();
838 }
839 }