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.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.mob.MobCacheConfig;
40  import org.apache.hadoop.hbase.mob.MobFileCache;
41  import org.apache.hadoop.hbase.wal.DefaultWALProvider;
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   * Impl for exposing HRegionServer Information through Hadoop's metrics 2 system.
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 int percentFileLocal = 0;
79    private volatile int 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 cellsCountCompactedToMob = 0;
87    private volatile long cellsCountCompactedFromMob = 0;
88    private volatile long cellsSizeCompactedToMob = 0;
89    private volatile long cellsSizeCompactedFromMob = 0;
90    private volatile long mobFlushCount = 0;
91    private volatile long mobFlushedCellsCount = 0;
92    private volatile long mobFlushedCellsSize = 0;
93    private volatile long mobScanCellsCount = 0;
94    private volatile long mobScanCellsSize = 0;
95    private volatile long mobFileCacheAccessCount = 0;
96    private volatile long mobFileCacheMissCount = 0;
97    private volatile double mobFileCacheHitRatio = 0;
98    private volatile long mobFileCacheEvictedCount = 0;
99    private volatile long mobFileCacheCount = 0;
100   private volatile long blockedRequestsCount = 0L;
101 
102   private CacheStats cacheStats;
103   private ScheduledExecutorService executor;
104   private Runnable runnable;
105   private long period;
106 
107   /**
108    * Can be null if not on hdfs.
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    * It's possible that due to threading the block cache could not be initialized
138    * yet (testing multiple region servers in one jvm).  So we need to try and initialize
139    * the blockCache and cacheStats reference multiple times until we succeed.
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    * Initializes the mob file cache.
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     //The thread could be zero.  if so assume there is no queue.
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     //The thread could be zero.  if so assume there is no queue.
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     //The thread could be zero.  if so assume there is no queue.
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     //If there is no flusher there should be no queue.
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 getBlockCacheMissCount() {
291     if (this.cacheStats == null) {
292       return 0;
293     }
294     return this.cacheStats.getMissCount();
295   }
296 
297   @Override
298   public long getBlockCacheEvictedCount() {
299     if (this.cacheStats == null) {
300       return 0;
301     }
302     return this.cacheStats.getEvictedCount();
303   }
304 
305   @Override
306   public double getBlockCacheHitPercent() {
307     if (this.cacheStats == null) {
308       return 0;
309     }
310     return (int) (this.cacheStats.getHitRatio() * 100);
311   }
312 
313   @Override
314   public int getBlockCacheHitCachingPercent() {
315     if (this.cacheStats == null) {
316       return 0;
317     }
318     return (int) (this.cacheStats.getHitCachingRatio() * 100);
319   }
320 
321   @Override public void forceRecompute() {
322     this.runnable.run();
323   }
324 
325   @Override
326   public long getNumStores() {
327     return numStores;
328   }
329   
330   @Override
331   public long getNumWALFiles() {
332     return numWALFiles;
333   }
334 
335   @Override
336   public long getWALFileSize() {
337     return walFileSize;
338   }
339   
340   @Override
341   public long getNumStoreFiles() {
342     return numStoreFiles;
343   }
344 
345   @Override
346   public long getMemstoreSize() {
347     return memstoreSize;
348   }
349 
350   @Override
351   public long getStoreFileSize() {
352     return storeFileSize;
353   }
354 
355   @Override public double getRequestsPerSecond() {
356     return requestsPerSecond;
357   }
358 
359   @Override
360   public long getReadRequestsCount() {
361     return readRequestsCount;
362   }
363 
364   @Override
365   public long getWriteRequestsCount() {
366     return writeRequestsCount;
367   }
368 
369   @Override
370   public long getCheckAndMutateChecksFailed() {
371     return checkAndMutateChecksFailed;
372   }
373 
374   @Override
375   public long getCheckAndMutateChecksPassed() {
376     return checkAndMutateChecksPassed;
377   }
378 
379   @Override
380   public long getStoreFileIndexSize() {
381     return storefileIndexSize;
382   }
383 
384   @Override
385   public long getTotalStaticIndexSize() {
386     return totalStaticIndexSize;
387   }
388 
389   @Override
390   public long getTotalStaticBloomSize() {
391     return totalStaticBloomSize;
392   }
393 
394   @Override
395   public long getNumMutationsWithoutWAL() {
396     return numMutationsWithoutWAL;
397   }
398 
399   @Override
400   public long getDataInMemoryWithoutWAL() {
401     return dataInMemoryWithoutWAL;
402   }
403 
404   @Override
405   public int getPercentFileLocal() {
406     return percentFileLocal;
407   }
408 
409   @Override
410   public int getPercentFileLocalSecondaryRegions() {
411     return percentFileLocalSecondaryRegions;
412   }
413 
414   @Override
415   public long getUpdatesBlockedTime() {
416     if (this.regionServer.cacheFlusher == null) {
417       return 0;
418     }
419     return this.regionServer.cacheFlusher.getUpdatesBlockedMsHighWater().get();
420   }
421 
422   @Override
423   public long getFlushedCellsCount() {
424     return flushedCellsCount;
425   }
426 
427   @Override
428   public long getCompactedCellsCount() {
429     return compactedCellsCount;
430   }
431 
432   @Override
433   public long getMajorCompactedCellsCount() {
434     return majorCompactedCellsCount;
435   }
436 
437   @Override
438   public long getFlushedCellsSize() {
439     return flushedCellsSize;
440   }
441 
442   @Override
443   public long getCompactedCellsSize() {
444     return compactedCellsSize;
445   }
446 
447   @Override
448   public long getMajorCompactedCellsSize() {
449     return majorCompactedCellsSize;
450   }
451 
452   @Override
453   public long getCellsCountCompactedFromMob() {
454     return cellsCountCompactedFromMob;
455   }
456 
457   @Override
458   public long getCellsCountCompactedToMob() {
459     return cellsCountCompactedToMob;
460   }
461 
462   @Override
463   public long getCellsSizeCompactedFromMob() {
464     return cellsSizeCompactedFromMob;
465   }
466 
467   @Override
468   public long getCellsSizeCompactedToMob() {
469     return cellsSizeCompactedToMob;
470   }
471 
472   @Override
473   public long getMobFlushCount() {
474     return mobFlushCount;
475   }
476 
477   @Override
478   public long getMobFlushedCellsCount() {
479     return mobFlushedCellsCount;
480   }
481 
482   @Override
483   public long getMobFlushedCellsSize() {
484     return mobFlushedCellsSize;
485   }
486 
487   @Override
488   public long getMobScanCellsCount() {
489     return mobScanCellsCount;
490   }
491 
492   @Override
493   public long getMobScanCellsSize() {
494     return mobScanCellsSize;
495   }
496 
497   @Override
498   public long getMobFileCacheAccessCount() {
499     return mobFileCacheAccessCount;
500   }
501 
502   @Override
503   public long getMobFileCacheMissCount() {
504     return mobFileCacheMissCount;
505   }
506 
507   @Override
508   public long getMobFileCacheCount() {
509     return mobFileCacheCount;
510   }
511 
512   @Override
513   public long getMobFileCacheEvictedCount() {
514     return mobFileCacheEvictedCount;
515   }
516 
517   @Override
518   public int getMobFileCacheHitPercent() {
519     return (int) (mobFileCacheHitRatio * 100);
520   }
521 
522   /**
523    * This is the runnable that will be executed on the executor every PERIOD number of seconds
524    * It will take metrics/numbers from all of the regions and use them to compute point in
525    * time metrics.
526    */
527   public class RegionServerMetricsWrapperRunnable implements Runnable {
528 
529     private long lastRan = 0;
530     private long lastRequestCount = 0;
531 
532     @Override
533     synchronized public void run() {
534       initBlockCache();
535       initMobFileCache();
536       cacheStats = blockCache.getStats();
537 
538       HDFSBlocksDistribution hdfsBlocksDistribution =
539           new HDFSBlocksDistribution();
540       HDFSBlocksDistribution hdfsBlocksDistributionSecondaryRegions =
541           new HDFSBlocksDistribution();
542 
543       long tempNumStores = 0, tempNumStoreFiles = 0, tempMemstoreSize = 0, tempStoreFileSize = 0;
544       long tempReadRequestsCount = 0, tempWriteRequestsCount = 0;
545       long tempCheckAndMutateChecksFailed = 0;
546       long tempCheckAndMutateChecksPassed = 0;
547       long tempStorefileIndexSize = 0;
548       long tempTotalStaticIndexSize = 0;
549       long tempTotalStaticBloomSize = 0;
550       long tempNumMutationsWithoutWAL = 0;
551       long tempDataInMemoryWithoutWAL = 0;
552       int tempPercentFileLocal = 0;
553       int tempPercentFileLocalSecondaryRegions = 0;
554       long tempFlushedCellsCount = 0;
555       long tempCompactedCellsCount = 0;
556       long tempMajorCompactedCellsCount = 0;
557       long tempFlushedCellsSize = 0;
558       long tempCompactedCellsSize = 0;
559       long tempMajorCompactedCellsSize = 0;
560       long tempCellsCountCompactedToMob = 0;
561       long tempCellsCountCompactedFromMob = 0;
562       long tempCellsSizeCompactedToMob = 0;
563       long tempCellsSizeCompactedFromMob = 0;
564       long tempMobFlushCount = 0;
565       long tempMobFlushedCellsCount = 0;
566       long tempMobFlushedCellsSize = 0;
567       long tempMobScanCellsCount = 0;
568       long tempMobScanCellsSize = 0;
569       long tempBlockedRequestsCount = 0L;
570 
571       for (Region r : regionServer.getOnlineRegionsLocalContext()) {
572         tempNumMutationsWithoutWAL += r.getNumMutationsWithoutWAL();
573         tempDataInMemoryWithoutWAL += r.getDataInMemoryWithoutWAL();
574         tempReadRequestsCount += r.getReadRequestsCount();
575         tempWriteRequestsCount += r.getWriteRequestsCount();
576         tempCheckAndMutateChecksFailed += r.getCheckAndMutateChecksFailed();
577         tempCheckAndMutateChecksPassed += r.getCheckAndMutateChecksPassed();
578         tempBlockedRequestsCount += r.getBlockedRequestsCount();
579         List<Store> storeList = r.getStores();
580         tempNumStores += storeList.size();
581         for (Store store : storeList) {
582           tempNumStoreFiles += store.getStorefilesCount();
583           tempMemstoreSize += store.getMemStoreSize();
584           tempStoreFileSize += store.getStorefilesSize();
585           tempStorefileIndexSize += store.getStorefilesIndexSize();
586           tempTotalStaticBloomSize += store.getTotalStaticBloomSize();
587           tempTotalStaticIndexSize += store.getTotalStaticIndexSize();
588           tempFlushedCellsCount += store.getFlushedCellsCount();
589           tempCompactedCellsCount += store.getCompactedCellsCount();
590           tempMajorCompactedCellsCount += store.getMajorCompactedCellsCount();
591           tempFlushedCellsSize += store.getFlushedCellsSize();
592           tempCompactedCellsSize += store.getCompactedCellsSize();
593           tempMajorCompactedCellsSize += store.getMajorCompactedCellsSize();
594           if (store instanceof HMobStore) {
595             HMobStore mobStore = (HMobStore) store;
596             tempCellsCountCompactedToMob += mobStore.getCellsCountCompactedToMob();
597             tempCellsCountCompactedFromMob += mobStore.getCellsCountCompactedFromMob();
598             tempCellsSizeCompactedToMob += mobStore.getCellsSizeCompactedToMob();
599             tempCellsSizeCompactedFromMob += mobStore.getCellsSizeCompactedFromMob();
600             tempMobFlushCount += mobStore.getMobFlushCount();
601             tempMobFlushedCellsCount += mobStore.getMobFlushedCellsCount();
602             tempMobFlushedCellsSize += mobStore.getMobFlushedCellsSize();
603             tempMobScanCellsCount += mobStore.getMobScanCellsCount();
604             tempMobScanCellsSize += mobStore.getMobScanCellsSize();
605           }
606         }
607 
608         HDFSBlocksDistribution distro = r.getHDFSBlocksDistribution();
609         hdfsBlocksDistribution.add(distro);
610         if (r.getRegionInfo().getReplicaId() != HRegionInfo.DEFAULT_REPLICA_ID) {
611           hdfsBlocksDistributionSecondaryRegions.add(distro);
612         }
613       }
614       float localityIndex = hdfsBlocksDistribution.getBlockLocalityIndex(
615           regionServer.getServerName().getHostname());
616       tempPercentFileLocal = (int) (localityIndex * 100);
617 
618       float localityIndexSecondaryRegions = hdfsBlocksDistributionSecondaryRegions
619           .getBlockLocalityIndex(regionServer.getServerName().getHostname());
620       tempPercentFileLocalSecondaryRegions = (int) (localityIndexSecondaryRegions * 100);
621 
622       //Compute the number of requests per second
623       long currentTime = EnvironmentEdgeManager.currentTime();
624 
625       // assume that it took PERIOD seconds to start the executor.
626       // this is a guess but it's a pretty good one.
627       if (lastRan == 0) {
628         lastRan = currentTime - period;
629       }
630       //If we've time traveled keep the last requests per second.
631       if ((currentTime - lastRan) > 0) {
632         long currentRequestCount = getTotalRequestCount();
633         requestsPerSecond = (currentRequestCount - lastRequestCount) /
634             ((currentTime - lastRan) / 1000.0);
635         lastRequestCount = currentRequestCount;
636       }
637       lastRan = currentTime;
638 
639       numWALFiles = DefaultWALProvider.getNumLogFiles(regionServer.walFactory) +
640           BoundedRegionGroupingProvider.getNumLogFiles(regionServer.walFactory);
641       walFileSize = DefaultWALProvider.getLogFileSize(regionServer.walFactory) +
642           BoundedRegionGroupingProvider.getLogFileSize(regionServer.walFactory);
643       //Copy over computed values so that no thread sees half computed values.
644       numStores = tempNumStores;
645       numStoreFiles = tempNumStoreFiles;
646       memstoreSize = tempMemstoreSize;
647       storeFileSize = tempStoreFileSize;
648       readRequestsCount = tempReadRequestsCount;
649       writeRequestsCount = tempWriteRequestsCount;
650       checkAndMutateChecksFailed = tempCheckAndMutateChecksFailed;
651       checkAndMutateChecksPassed = tempCheckAndMutateChecksPassed;
652       storefileIndexSize = tempStorefileIndexSize;
653       totalStaticIndexSize = tempTotalStaticIndexSize;
654       totalStaticBloomSize = tempTotalStaticBloomSize;
655       numMutationsWithoutWAL = tempNumMutationsWithoutWAL;
656       dataInMemoryWithoutWAL = tempDataInMemoryWithoutWAL;
657       percentFileLocal = tempPercentFileLocal;
658       percentFileLocalSecondaryRegions = tempPercentFileLocalSecondaryRegions;
659       flushedCellsCount = tempFlushedCellsCount;
660       compactedCellsCount = tempCompactedCellsCount;
661       majorCompactedCellsCount = tempMajorCompactedCellsCount;
662       flushedCellsSize = tempFlushedCellsSize;
663       compactedCellsSize = tempCompactedCellsSize;
664       majorCompactedCellsSize = tempMajorCompactedCellsSize;
665       cellsCountCompactedToMob = tempCellsCountCompactedToMob;
666       cellsCountCompactedFromMob = tempCellsCountCompactedFromMob;
667       cellsSizeCompactedToMob = tempCellsSizeCompactedToMob;
668       cellsSizeCompactedFromMob = tempCellsSizeCompactedFromMob;
669       mobFlushCount = tempMobFlushCount;
670       mobFlushedCellsCount = tempMobFlushedCellsCount;
671       mobFlushedCellsSize = tempMobFlushedCellsSize;
672       mobScanCellsCount = tempMobScanCellsCount;
673       mobScanCellsSize = tempMobScanCellsSize;
674       mobFileCacheAccessCount = mobFileCache.getAccessCount();
675       mobFileCacheMissCount = mobFileCache.getMissCount();
676       mobFileCacheHitRatio = mobFileCache.getHitRatio();
677       mobFileCacheEvictedCount = mobFileCache.getEvictedFileCount();
678       mobFileCacheCount = mobFileCache.getCacheSize();
679       blockedRequestsCount = tempBlockedRequestsCount;
680     }
681   }
682 
683   @Override
684   public long getHedgedReadOps() {
685     return this.dfsHedgedReadMetrics == null? 0: this.dfsHedgedReadMetrics.getHedgedReadOps();
686   }
687 
688   @Override
689   public long getHedgedReadWins() {
690     return this.dfsHedgedReadMetrics == null? 0: this.dfsHedgedReadMetrics.getHedgedReadWins();
691   }
692 
693   @Override
694   public long getBlockedRequestsCount() {
695     return blockedRequestsCount;
696   }
697 }