HBASE-14891 Add log for uncaught exception in RegionServerMetricsWrapperRunnable(Yu Li)

This commit is contained in:
chenheng 2015-11-30 22:30:09 +08:00
parent 71d41e0c9c
commit 999ae69155
1 changed files with 146 additions and 141 deletions

View File

@ -569,6 +569,7 @@ class MetricsRegionServerWrapperImpl
@Override
synchronized public void run() {
try {
initBlockCache();
initMobFileCache();
cacheStats = blockCache.getStats();
@ -655,8 +656,8 @@ class MetricsRegionServerWrapperImpl
float localityIndexSecondaryRegions = hdfsBlocksDistributionSecondaryRegions
.getBlockLocalityIndex(regionServer.getServerName().getHostname());
tempPercentFileLocalSecondaryRegions =
Double.isNaN(localityIndexSecondaryRegions) ? 0 : (localityIndexSecondaryRegions * 100);
tempPercentFileLocalSecondaryRegions = Double.
isNaN(localityIndexSecondaryRegions) ? 0 : (localityIndexSecondaryRegions * 100);
// Compute the number of requests per second
long currentTime = EnvironmentEdgeManager.currentTime();
@ -714,10 +715,14 @@ class MetricsRegionServerWrapperImpl
mobScanCellsSize = tempMobScanCellsSize;
mobFileCacheAccessCount = mobFileCache.getAccessCount();
mobFileCacheMissCount = mobFileCache.getMissCount();
mobFileCacheHitRatio = Double.isNaN(mobFileCache.getHitRatio())?0:mobFileCache.getHitRatio();
mobFileCacheHitRatio = Double.
isNaN(mobFileCache.getHitRatio())?0:mobFileCache.getHitRatio();
mobFileCacheEvictedCount = mobFileCache.getEvictedFileCount();
mobFileCacheCount = mobFileCache.getCacheSize();
blockedRequestsCount = tempBlockedRequestsCount;
} catch (Throwable e) {
LOG.warn("Caught exception! Will suppress and retry.", e);
}
}
}