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