protected RegionMBeanBridge(Region<K, V> region) { this.region = region; this.regAttrs = region.getAttributes(); this.isStatisticsEnabled = regAttrs.getStatisticsEnabled(); this.regionAttributesData = RegionMBeanCompositeDataFactory.getRegionAttributesData(regAttrs); this.membershipAttributesData = RegionMBeanCompositeDataFactory.getMembershipAttributesData(regAttrs); this.evictionAttributesData = RegionMBeanCompositeDataFactory.getEvictionAttributesData(regAttrs); this.regionMonitor = new MBeanStatsMonitor(ManagementStrings.REGION_MONITOR.toLocalizedString()); configureRegionMetrics(); this.persistentEnabled = region.getAttributes().getDataPolicy().withPersistence(); this.regionStats = ((LocalRegion) region).getRegionPerfStats(); if (regionStats != null) { regionMonitor.addStatisticsToMonitor(regionStats.getStats()); // fixes 46692 } LocalRegion l = (LocalRegion) region; if (l.getEvictionController() != null) { LRUStatistics stats = l.getEvictionController().getLRUHelper().getStats(); if (stats != null) { regionMonitor.addStatisticsToMonitor(stats.getStats()); EvictionAttributes ea = region.getAttributes().getEvictionAttributes(); if (ea != null && ea.getAlgorithm().isLRUMemory()) { this.lruMemoryStats = stats; } } } if (regAttrs.getGatewaySenderIds() != null && regAttrs.getGatewaySenderIds().size() > 0) { this.isGatewayEnabled = true; } this.member = GemFireCacheImpl.getInstance().getDistributedSystem().getMemberId(); }
public long getEntrySize() { if (lruMemoryStats != null) { return lruMemoryStats.getCounter(); } return ManagementConstants.NOT_AVAILABLE_LONG; }