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.io.IOException;
21 import java.util.Collection;
22 import java.util.List;
23 import java.util.concurrent.ScheduledExecutorService;
24 import java.util.concurrent.TimeUnit;
25
26 import org.apache.commons.lang.StringUtils;
27 import org.apache.commons.logging.Log;
28 import org.apache.commons.logging.LogFactory;
29 import org.apache.hadoop.hbase.classification.InterfaceAudience;
30 import org.apache.hadoop.hbase.CompatibilitySingletonFactory;
31 import org.apache.hadoop.hbase.HConstants;
32 import org.apache.hadoop.hbase.HDFSBlocksDistribution;
33 import org.apache.hadoop.hbase.HRegionInfo;
34 import org.apache.hadoop.hbase.ServerName;
35 import org.apache.hadoop.hbase.io.hfile.BlockCache;
36 import org.apache.hadoop.hbase.io.hfile.CacheConfig;
37 import org.apache.hadoop.hbase.io.hfile.CacheStats;
38 import org.apache.hadoop.hbase.wal.BoundedRegionGroupingProvider;
39 import org.apache.hadoop.hbase.wal.DefaultWALProvider;
40 import org.apache.hadoop.hbase.mob.MobCacheConfig;
41 import org.apache.hadoop.hbase.mob.MobFileCache;
42 import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
43 import org.apache.hadoop.hbase.util.FSUtils;
44 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
45 import org.apache.hadoop.hdfs.DFSHedgedReadMetrics;
46 import org.apache.hadoop.metrics2.MetricsExecutor;
47
48
49
50
51 @InterfaceAudience.Private
52 class MetricsRegionServerWrapperImpl
53 implements MetricsRegionServerWrapper {
54
55 private static final Log LOG = LogFactory.getLog(MetricsRegionServerWrapperImpl.class);
56
57 private final HRegionServer regionServer;
58
59 private BlockCache blockCache;
60 private MobFileCache mobFileCache;
61
62 private volatile long numStores = 0;
63 private volatile long numWALFiles = 0;
64 private volatile long walFileSize = 0;
65 private volatile long numStoreFiles = 0;
66 private volatile long memstoreSize = 0;
67 private volatile long storeFileSize = 0;
68 private volatile double requestsPerSecond = 0.0;
69 private volatile long readRequestsCount = 0;
70 private volatile long writeRequestsCount = 0;
71 private volatile long checkAndMutateChecksFailed = 0;
72 private volatile long checkAndMutateChecksPassed = 0;
73 private volatile long storefileIndexSize = 0;
74 private volatile long totalStaticIndexSize = 0;
75 private volatile long totalStaticBloomSize = 0;
76 private volatile long numMutationsWithoutWAL = 0;
77 private volatile long dataInMemoryWithoutWAL = 0;
78 private volatile double percentFileLocal = 0;
79 private volatile double percentFileLocalSecondaryRegions = 0;
80 private volatile long flushedCellsCount = 0;
81 private volatile long compactedCellsCount = 0;
82 private volatile long majorCompactedCellsCount = 0;
83 private volatile long flushedCellsSize = 0;
84 private volatile long compactedCellsSize = 0;
85 private volatile long majorCompactedCellsSize = 0;
86 private volatile long blockedRequestsCount = 0L;
87 private volatile long mobCompactedIntoMobCellsCount = 0;
88 private volatile long mobCompactedFromMobCellsCount = 0;
89 private volatile long mobCompactedIntoMobCellsSize = 0;
90 private volatile long mobCompactedFromMobCellsSize = 0;
91 private volatile long mobFlushCount = 0;
92 private volatile long mobFlushedCellsCount = 0;
93 private volatile long mobFlushedCellsSize = 0;
94 private volatile long mobScanCellsCount = 0;
95 private volatile long mobScanCellsSize = 0;
96 private volatile long mobFileCacheAccessCount = 0;
97 private volatile long mobFileCacheMissCount = 0;
98 private volatile double mobFileCacheHitRatio = 0;
99 private volatile long mobFileCacheEvictedCount = 0;
100 private volatile long mobFileCacheCount = 0;
101
102 private CacheStats cacheStats;
103 private ScheduledExecutorService executor;
104 private Runnable runnable;
105 private long period;
106
107
108
109
110 private DFSHedgedReadMetrics dfsHedgedReadMetrics;
111
112 public MetricsRegionServerWrapperImpl(final HRegionServer regionServer) {
113 this.regionServer = regionServer;
114 initBlockCache();
115 initMobFileCache();
116
117 this.period =
118 regionServer.conf.getLong(HConstants.REGIONSERVER_METRICS_PERIOD,
119 HConstants.DEFAULT_REGIONSERVER_METRICS_PERIOD);
120
121 this.executor = CompatibilitySingletonFactory.getInstance(MetricsExecutor.class).getExecutor();
122 this.runnable = new RegionServerMetricsWrapperRunnable();
123 this.executor.scheduleWithFixedDelay(this.runnable, this.period, this.period,
124 TimeUnit.MILLISECONDS);
125
126 try {
127 this.dfsHedgedReadMetrics = FSUtils.getDFSHedgedReadMetrics(regionServer.getConfiguration());
128 } catch (IOException e) {
129 LOG.warn("Failed to get hedged metrics", e);
130 }
131 if (LOG.isInfoEnabled()) {
132 LOG.info("Computing regionserver metrics every " + this.period + " milliseconds");
133 }
134 }
135
136
137
138
139
140
141 private synchronized void initBlockCache() {
142 CacheConfig cacheConfig = this.regionServer.cacheConfig;
143 if (cacheConfig != null && this.blockCache == null) {
144 this.blockCache = cacheConfig.getBlockCache();
145 }
146
147 if (this.blockCache != null && this.cacheStats == null) {
148 this.cacheStats = blockCache.getStats();
149 }
150 }
151
152
153
154
155 private synchronized void initMobFileCache() {
156 MobCacheConfig mobCacheConfig = this.regionServer.mobCacheConfig;
157 if (mobCacheConfig != null && this.mobFileCache == null) {
158 this.mobFileCache = mobCacheConfig.getMobFileCache();
159 }
160 }
161
162 @Override
163 public String getClusterId() {
164 return regionServer.getClusterId();
165 }
166
167 @Override
168 public long getStartCode() {
169 return regionServer.getStartcode();
170 }
171
172 @Override
173 public String getZookeeperQuorum() {
174 ZooKeeperWatcher zk = regionServer.getZooKeeper();
175 if (zk == null) {
176 return "";
177 }
178 return zk.getQuorum();
179 }
180
181 @Override
182 public String getCoprocessors() {
183 String[] coprocessors = regionServer.getRegionServerCoprocessors();
184 if (coprocessors == null || coprocessors.length == 0) {
185 return "";
186 }
187 return StringUtils.join(coprocessors, ", ");
188 }
189
190 @Override
191 public String getServerName() {
192 ServerName serverName = regionServer.getServerName();
193 if (serverName == null) {
194 return "";
195 }
196 return serverName.getServerName();
197 }
198
199 @Override
200 public long getNumOnlineRegions() {
201 Collection<Region> onlineRegionsLocalContext = regionServer.getOnlineRegionsLocalContext();
202 if (onlineRegionsLocalContext == null) {
203 return 0;
204 }
205 return onlineRegionsLocalContext.size();
206 }
207
208 @Override
209 public long getTotalRequestCount() {
210 return regionServer.rpcServices.requestCount.get();
211 }
212
213 @Override
214 public int getSplitQueueSize() {
215 if (this.regionServer.compactSplitThread == null) {
216 return 0;
217 }
218 return this.regionServer.compactSplitThread.getSplitQueueSize();
219 }
220
221 @Override
222 public int getCompactionQueueSize() {
223
224 if (this.regionServer.compactSplitThread == null) {
225 return 0;
226 }
227 return this.regionServer.compactSplitThread.getCompactionQueueSize();
228 }
229
230 @Override
231 public int getSmallCompactionQueueSize() {
232
233 if (this.regionServer.compactSplitThread == null) {
234 return 0;
235 }
236 return this.regionServer.compactSplitThread.getSmallCompactionQueueSize();
237 }
238
239 @Override
240 public int getLargeCompactionQueueSize() {
241
242 if (this.regionServer.compactSplitThread == null) {
243 return 0;
244 }
245 return this.regionServer.compactSplitThread.getLargeCompactionQueueSize();
246 }
247
248 @Override
249 public int getFlushQueueSize() {
250
251 if (this.regionServer.cacheFlusher == null) {
252 return 0;
253 }
254 return this.regionServer.cacheFlusher.getFlushQueueSize();
255 }
256
257 @Override
258 public long getBlockCacheCount() {
259 if (this.blockCache == null) {
260 return 0;
261 }
262 return this.blockCache.getBlockCount();
263 }
264
265 @Override
266 public long getBlockCacheSize() {
267 if (this.blockCache == null) {
268 return 0;
269 }
270 return this.blockCache.getCurrentSize();
271 }
272
273 @Override
274 public long getBlockCacheFreeSize() {
275 if (this.blockCache == null) {
276 return 0;
277 }
278 return this.blockCache.getFreeSize();
279 }
280
281 @Override
282 public long getBlockCacheHitCount() {
283 if (this.cacheStats == null) {
284 return 0;
285 }
286 return this.cacheStats.getHitCount();
287 }
288
289 @Override
290 public long getBlockCachePrimaryHitCount() {
291 if (this.cacheStats == null) {
292 return 0;
293 }
294 return this.cacheStats.getPrimaryHitCount();
295 }
296
297 @Override
298 public long getBlockCacheMissCount() {
299 if (this.cacheStats == null) {
300 return 0;
301 }
302 return this.cacheStats.getMissCount();
303 }
304
305 @Override
306 public long getBlockCachePrimaryMissCount() {
307 if (this.cacheStats == null) {
308 return 0;
309 }
310 return this.cacheStats.getPrimaryMissCount();
311 }
312
313 @Override
314 public long getBlockCacheEvictedCount() {
315 if (this.cacheStats == null) {
316 return 0;
317 }
318 return this.cacheStats.getEvictedCount();
319 }
320
321 @Override
322 public long getBlockCachePrimaryEvictedCount() {
323 if (this.cacheStats == null) {
324 return 0;
325 }
326 return this.cacheStats.getPrimaryEvictedCount();
327 }
328
329 @Override
330 public double getBlockCacheHitPercent() {
331 if (this.cacheStats == null) {
332 return 0;
333 }
334 double ratio = this.cacheStats.getHitRatio();
335 if (Double.isNaN(ratio)) {
336 ratio = 0;
337 }
338 return (ratio * 100);
339 }
340
341 @Override
342 public int getBlockHitPercent() {
343 if (this.cacheStats == null) {
344 return 0;
345 }
346 return (int) (this.cacheStats.getHitRatio() * 100);
347 }
348
349 @Override
350 public double getBlockCacheHitCachingPercent() {
351 if (this.cacheStats == null) {
352 return 0;
353 }
354
355 double ratio = this.cacheStats.getHitCachingRatio();
356
357 if (Double.isNaN(ratio)) {
358 ratio = 0;
359 }
360 return (ratio * 100);
361 }
362
363 @Override
364 public long getBlockCacheFailedInsertions() {
365 return this.cacheStats.getFailedInserts();
366 }
367
368 @Override public void forceRecompute() {
369 this.runnable.run();
370 }
371
372 @Override
373 public long getNumStores() {
374 return numStores;
375 }
376
377 @Override
378 public long getNumWALFiles() {
379 return numWALFiles;
380 }
381
382 @Override
383 public long getWALFileSize() {
384 return walFileSize;
385 }
386
387 @Override
388 public long getNumStoreFiles() {
389 return numStoreFiles;
390 }
391
392 @Override
393 public long getMemstoreSize() {
394 return memstoreSize;
395 }
396
397 @Override
398 public long getStoreFileSize() {
399 return storeFileSize;
400 }
401
402 @Override public double getRequestsPerSecond() {
403 return requestsPerSecond;
404 }
405
406 @Override
407 public long getReadRequestsCount() {
408 return readRequestsCount;
409 }
410
411 @Override
412 public long getWriteRequestsCount() {
413 return writeRequestsCount;
414 }
415
416 @Override
417 public long getCheckAndMutateChecksFailed() {
418 return checkAndMutateChecksFailed;
419 }
420
421 @Override
422 public long getCheckAndMutateChecksPassed() {
423 return checkAndMutateChecksPassed;
424 }
425
426 @Override
427 public long getStoreFileIndexSize() {
428 return storefileIndexSize;
429 }
430
431 @Override
432 public long getTotalStaticIndexSize() {
433 return totalStaticIndexSize;
434 }
435
436 @Override
437 public long getTotalStaticBloomSize() {
438 return totalStaticBloomSize;
439 }
440
441 @Override
442 public long getNumMutationsWithoutWAL() {
443 return numMutationsWithoutWAL;
444 }
445
446 @Override
447 public long getDataInMemoryWithoutWAL() {
448 return dataInMemoryWithoutWAL;
449 }
450
451 @Override
452 public double getPercentFileLocal() {
453 return percentFileLocal;
454 }
455
456 @Override
457 public double getPercentFileLocalSecondaryRegions() {
458 return percentFileLocalSecondaryRegions;
459 }
460
461 @Override
462 public long getUpdatesBlockedTime() {
463 if (this.regionServer.cacheFlusher == null) {
464 return 0;
465 }
466 return this.regionServer.cacheFlusher.getUpdatesBlockedMsHighWater().get();
467 }
468
469 @Override
470 public long getFlushedCellsCount() {
471 return flushedCellsCount;
472 }
473
474 @Override
475 public long getCompactedCellsCount() {
476 return compactedCellsCount;
477 }
478
479 @Override
480 public long getMajorCompactedCellsCount() {
481 return majorCompactedCellsCount;
482 }
483
484 @Override
485 public long getFlushedCellsSize() {
486 return flushedCellsSize;
487 }
488
489 @Override
490 public long getCompactedCellsSize() {
491 return compactedCellsSize;
492 }
493
494 @Override
495 public long getMajorCompactedCellsSize() {
496 return majorCompactedCellsSize;
497 }
498
499 @Override
500 public long getMobCompactedFromMobCellsCount() {
501 return mobCompactedFromMobCellsCount;
502 }
503
504 @Override
505 public long getMobCompactedIntoMobCellsCount() {
506 return mobCompactedIntoMobCellsCount;
507 }
508
509 @Override
510 public long getMobCompactedFromMobCellsSize() {
511 return mobCompactedFromMobCellsSize;
512 }
513
514 @Override
515 public long getMobCompactedIntoMobCellsSize() {
516 return mobCompactedIntoMobCellsSize;
517 }
518
519 @Override
520 public long getMobFlushCount() {
521 return mobFlushCount;
522 }
523
524 @Override
525 public long getMobFlushedCellsCount() {
526 return mobFlushedCellsCount;
527 }
528
529 @Override
530 public long getMobFlushedCellsSize() {
531 return mobFlushedCellsSize;
532 }
533
534 @Override
535 public long getMobScanCellsCount() {
536 return mobScanCellsCount;
537 }
538
539 @Override
540 public long getMobScanCellsSize() {
541 return mobScanCellsSize;
542 }
543
544 @Override
545 public long getMobFileCacheAccessCount() {
546 return mobFileCacheAccessCount;
547 }
548
549 @Override
550 public long getMobFileCacheMissCount() {
551 return mobFileCacheMissCount;
552 }
553
554 @Override
555 public long getMobFileCacheCount() {
556 return mobFileCacheCount;
557 }
558
559 @Override
560 public long getMobFileCacheEvictedCount() {
561 return mobFileCacheEvictedCount;
562 }
563
564 @Override
565 public int getMobFileCacheHitPercent() {
566 return (int) (mobFileCacheHitRatio * 100);
567 }
568
569
570
571
572
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 initMobFileCache();
584 cacheStats = blockCache.getStats();
585
586 HDFSBlocksDistribution hdfsBlocksDistribution = new HDFSBlocksDistribution();
587 HDFSBlocksDistribution hdfsBlocksDistributionSecondaryRegions =
588 new HDFSBlocksDistribution();
589
590 long tempNumStores = 0;
591 long tempNumStoreFiles = 0;
592 long tempMemstoreSize = 0;
593 long tempStoreFileSize = 0;
594 long tempReadRequestsCount = 0;
595 long tempWriteRequestsCount = 0;
596 long tempCheckAndMutateChecksFailed = 0;
597 long tempCheckAndMutateChecksPassed = 0;
598 long tempStorefileIndexSize = 0;
599 long tempTotalStaticIndexSize = 0;
600 long tempTotalStaticBloomSize = 0;
601 long tempNumMutationsWithoutWAL = 0;
602 long tempDataInMemoryWithoutWAL = 0;
603 double tempPercentFileLocal = 0;
604 double tempPercentFileLocalSecondaryRegions = 0;
605 long tempFlushedCellsCount = 0;
606 long tempCompactedCellsCount = 0;
607 long tempMajorCompactedCellsCount = 0;
608 long tempFlushedCellsSize = 0;
609 long tempCompactedCellsSize = 0;
610 long tempMajorCompactedCellsSize = 0;
611 long tempBlockedRequestsCount = 0L;
612 long tempMobCompactedIntoMobCellsCount = 0;
613 long tempMobCompactedFromMobCellsCount = 0;
614 long tempMobCompactedIntoMobCellsSize = 0;
615 long tempMobCompactedFromMobCellsSize = 0;
616 long tempMobFlushCount = 0;
617 long tempMobFlushedCellsCount = 0;
618 long tempMobFlushedCellsSize = 0;
619 long tempMobScanCellsCount = 0;
620 long tempMobScanCellsSize = 0;
621
622 for (Region r : regionServer.getOnlineRegionsLocalContext()) {
623 tempNumMutationsWithoutWAL += r.getNumMutationsWithoutWAL();
624 tempDataInMemoryWithoutWAL += r.getDataInMemoryWithoutWAL();
625 tempReadRequestsCount += r.getReadRequestsCount();
626 tempWriteRequestsCount += r.getWriteRequestsCount();
627 tempCheckAndMutateChecksFailed += r.getCheckAndMutateChecksFailed();
628 tempCheckAndMutateChecksPassed += r.getCheckAndMutateChecksPassed();
629 tempBlockedRequestsCount += r.getBlockedRequestsCount();
630 List<Store> storeList = r.getStores();
631 tempNumStores += storeList.size();
632 for (Store store : storeList) {
633 tempNumStoreFiles += store.getStorefilesCount();
634 tempMemstoreSize += store.getMemStoreSize();
635 tempStoreFileSize += store.getStorefilesSize();
636 tempStorefileIndexSize += store.getStorefilesIndexSize();
637 tempTotalStaticBloomSize += store.getTotalStaticBloomSize();
638 tempTotalStaticIndexSize += store.getTotalStaticIndexSize();
639 tempFlushedCellsCount += store.getFlushedCellsCount();
640 tempCompactedCellsCount += store.getCompactedCellsCount();
641 tempMajorCompactedCellsCount += store.getMajorCompactedCellsCount();
642 tempFlushedCellsSize += store.getFlushedCellsSize();
643 tempCompactedCellsSize += store.getCompactedCellsSize();
644 tempMajorCompactedCellsSize += store.getMajorCompactedCellsSize();
645 if (store instanceof HMobStore) {
646 HMobStore mobStore = (HMobStore) store;
647 tempMobCompactedIntoMobCellsCount += mobStore.getMobCompactedIntoMobCellsCount();
648 tempMobCompactedFromMobCellsCount += mobStore.getMobCompactedFromMobCellsCount();
649 tempMobCompactedIntoMobCellsSize += mobStore.getMobCompactedIntoMobCellsSize();
650 tempMobCompactedFromMobCellsSize += mobStore.getMobCompactedFromMobCellsSize();
651 tempMobFlushCount += mobStore.getMobFlushCount();
652 tempMobFlushedCellsCount += mobStore.getMobFlushedCellsCount();
653 tempMobFlushedCellsSize += mobStore.getMobFlushedCellsSize();
654 tempMobScanCellsCount += mobStore.getMobScanCellsCount();
655 tempMobScanCellsSize += mobStore.getMobScanCellsSize();
656 }
657 }
658
659 HDFSBlocksDistribution distro = r.getHDFSBlocksDistribution();
660 hdfsBlocksDistribution.add(distro);
661 if (r.getRegionInfo().getReplicaId() != HRegionInfo.DEFAULT_REPLICA_ID) {
662 hdfsBlocksDistributionSecondaryRegions.add(distro);
663 }
664 }
665
666 float localityIndex =
667 hdfsBlocksDistribution
668 .getBlockLocalityIndex(regionServer.getServerName().getHostname());
669 tempPercentFileLocal = Double.isNaN(tempBlockedRequestsCount) ? 0 : (localityIndex * 100);
670
671 float localityIndexSecondaryRegions =
672 hdfsBlocksDistributionSecondaryRegions.getBlockLocalityIndex(regionServer
673 .getServerName().getHostname());
674 tempPercentFileLocalSecondaryRegions = Double
675 .isNaN(localityIndexSecondaryRegions) ? 0 : (localityIndexSecondaryRegions * 100);
676
677
678 long currentTime = EnvironmentEdgeManager.currentTime();
679
680
681
682 if (lastRan == 0) {
683 lastRan = currentTime - period;
684 }
685
686
687 if ((currentTime - lastRan) > 0) {
688 long currentRequestCount = getTotalRequestCount();
689 requestsPerSecond =
690 (currentRequestCount - lastRequestCount) / ((currentTime - lastRan) / 1000.0);
691 lastRequestCount = currentRequestCount;
692 }
693 lastRan = currentTime;
694
695 numWALFiles =
696 DefaultWALProvider.getNumLogFiles(regionServer.walFactory)
697 + BoundedRegionGroupingProvider.getNumLogFiles(regionServer.walFactory);
698 walFileSize =
699 DefaultWALProvider.getLogFileSize(regionServer.walFactory)
700 + BoundedRegionGroupingProvider.getLogFileSize(regionServer.walFactory);
701
702 numStores = tempNumStores;
703 numStoreFiles = tempNumStoreFiles;
704 memstoreSize = tempMemstoreSize;
705 storeFileSize = tempStoreFileSize;
706 readRequestsCount = tempReadRequestsCount;
707 writeRequestsCount = tempWriteRequestsCount;
708 checkAndMutateChecksFailed = tempCheckAndMutateChecksFailed;
709 checkAndMutateChecksPassed = tempCheckAndMutateChecksPassed;
710 storefileIndexSize = tempStorefileIndexSize;
711 totalStaticIndexSize = tempTotalStaticIndexSize;
712 totalStaticBloomSize = tempTotalStaticBloomSize;
713 numMutationsWithoutWAL = tempNumMutationsWithoutWAL;
714 dataInMemoryWithoutWAL = tempDataInMemoryWithoutWAL;
715 percentFileLocal = tempPercentFileLocal;
716 percentFileLocalSecondaryRegions = tempPercentFileLocalSecondaryRegions;
717 flushedCellsCount = tempFlushedCellsCount;
718 compactedCellsCount = tempCompactedCellsCount;
719 majorCompactedCellsCount = tempMajorCompactedCellsCount;
720 flushedCellsSize = tempFlushedCellsSize;
721 compactedCellsSize = tempCompactedCellsSize;
722 majorCompactedCellsSize = tempMajorCompactedCellsSize;
723 blockedRequestsCount = tempBlockedRequestsCount;
724 mobCompactedIntoMobCellsCount = tempMobCompactedIntoMobCellsCount;
725 mobCompactedFromMobCellsCount = tempMobCompactedFromMobCellsCount;
726 mobCompactedIntoMobCellsSize = tempMobCompactedIntoMobCellsSize;
727 mobCompactedFromMobCellsSize = tempMobCompactedFromMobCellsSize;
728 mobFlushCount = tempMobFlushCount;
729 mobFlushedCellsCount = tempMobFlushedCellsCount;
730 mobFlushedCellsSize = tempMobFlushedCellsSize;
731 mobScanCellsCount = tempMobScanCellsCount;
732 mobScanCellsSize = tempMobScanCellsSize;
733 mobFileCacheAccessCount = mobFileCache.getAccessCount();
734 mobFileCacheMissCount = mobFileCache.getMissCount();
735 mobFileCacheHitRatio = mobFileCache.getHitRatio();
736 mobFileCacheEvictedCount = mobFileCache.getEvictedFileCount();
737 mobFileCacheCount = mobFileCache.getCacheSize();
738 } catch (Throwable e) {
739 LOG.warn("Caught exception! Will suppress and retry.", e);
740 }
741 }
742 }
743
744 @Override
745 public long getBlockedRequestsCount() {
746 return blockedRequestsCount;
747 }
748
749 @Override
750 public long getHedgedReadOps() {
751 return this.dfsHedgedReadMetrics == null? 0: this.dfsHedgedReadMetrics.getHedgedReadOps();
752 }
753
754 @Override
755 public long getHedgedReadWins() {
756 return this.dfsHedgedReadMetrics == null? 0: this.dfsHedgedReadMetrics.getHedgedReadWins();
757 }
758 }