@Override public boolean getStatisticsEnabled() { return this.ra.getStatisticsEnabled(); }
public RemoteRegionSnapshot(Region r) throws CacheException { this.name = r.getName(); RegionAttributes rAttr = r.getAttributes(); this.attributes = new RemoteRegionAttributes(rAttr); if (rAttr.getStatisticsEnabled()) { this.stats = new RemoteCacheStatistics(r.getStatistics()); } else { this.stats = new RemoteCacheStatistics(); } this.attributes = new RemoteRegionAttributes(r.getAttributes()); Set nameSet = r.keySet(); this.entryCount = nameSet.size(); Set subRegions = r.subregions(false); this.subregionCount = subRegions.size(); Object attr = r.getUserAttribute(); if (attr != null) { this.userAttribute = attr.getClass().getName() + "\"" + attr.toString() + "\""; } else { this.userAttribute = null; } }
/** * Determines whether the receiver is unexpired with regard to the given timeToLive and idleTime * attributes, which may different from this entry's actual attributes. Used for validation of * objects during netSearch(), which must validate remote entries against local timeout * attributes. */ boolean isExpiredWithRegardTo(Object key, int ttl, int idleTime) { if (!getAttributes().getStatisticsEnabled()) { return false; } long expTime; try { expTime = new NetSearchExpirationCalculator(this, key, ttl, idleTime).getExpirationTime(); } catch (EntryNotFoundException ignore) { return true; } return expTime != 0 && expTime <= cacheTimeMillis(); }
allInitialCaps.add(Integer.valueOf(ra.getInitialCapacity())); allConcLevels.add(Integer.valueOf(ra.getConcurrencyLevel())); allStatsEnabled.add(Boolean.valueOf(ra.getStatisticsEnabled())); allUserAttributes.add(snap.getUserAttribute()); allKeyConstraints.add(ra.getKeyConstraint());
"Scope is not the same"); if (this.statisticsEnabled != other.getStatisticsEnabled()) { throw new RuntimeException( String.format("Statistics enabled is not the same: this: %s other: %s", new Object[] {Boolean.valueOf(this.statisticsEnabled), Boolean.valueOf(other.getStatisticsEnabled())}));
poolName = ra.getPoolName(); scope = ra.getScope(); statisticsEnabled = ra.getStatisticsEnabled(); entryTimeToLive = ra.getEntryTimeToLive().getTimeout(); isLockGrantor = ra.isLockGrantor();
int concurrencyLevel = regAttrs.getConcurrencyLevel(); boolean indexMaintenanceSynchronous = regAttrs.getIndexMaintenanceSynchronous(); boolean statisticsEnabled = regAttrs.getStatisticsEnabled();
if (generateDefaults() || attrs.getStatisticsEnabled()) atts.addAttribute("", "", STATISTICS_ENABLED, "", String.valueOf(attrs.getStatisticsEnabled()));
if (!attrs.getStatisticsEnabled() && (attrs.getRegionTimeToLive().getTimeout() != 0 || attrs.getRegionIdleTimeout().getTimeout() != 0 || attrs.getEntryTimeToLive().getTimeout() != 0
protected RegionMBeanBridge(Region<K, V> region) { this.region = region; this.regAttrs = region.getAttributes(); this.isStatisticsEnabled = regAttrs.getStatisticsEnabled(); if (isStatisticsEnabled) { try { region.getStatistics(); } catch (UnsupportedOperationException e) { this.isStatisticsEnabled = false; } } this.regionAttributesData = RegionMBeanCompositeDataFactory.getRegionAttributesData(regAttrs); this.membershipAttributesData = RegionMBeanCompositeDataFactory.getMembershipAttributesData(regAttrs); this.evictionAttributesData = RegionMBeanCompositeDataFactory.getEvictionAttributesData(regAttrs); this.regionMonitor = new MBeanStatsMonitor("RegionMXBeanMonitor"); configureRegionMetrics(); this.persistentEnabled = region.getAttributes().getDataPolicy().withPersistence(); this.regionStats = ((LocalRegion) region).getRegionPerfStats(); if (regionStats != null) { regionMonitor.addStatisticsToMonitor(regionStats.getStats()); // fixes 46692 } monitorLRUStatistics(); if (regAttrs.getGatewaySenderIds() != null && regAttrs.getGatewaySenderIds().size() > 0) { this.isGatewayEnabled = true; } this.member = GemFireCacheImpl.getInstance().getDistributedSystem().getMemberId(); }
|| ra.getInitialCapacity() != getInitialCapacity() || ra.getLoadFactor() != getLoadFactor() || ra.getStatisticsEnabled() != getStatisticsEnabled() || offHeap != getOffHeap() || !hasSameCompressor(ra)) { if (getRecoveredEntryMap() != null) { ra.getInitialCapacity(), ra.getLoadFactor(), ra.getStatisticsEnabled(), isBucket, flags, partitionName, startingBucketId, compressorClassName, offHeap);
this.regionTimeToLive = attrs.getRegionTimeToLive(); this.scope = attrs.getScope(); this.statisticsEnabled = attrs.getStatisticsEnabled(); this.ignoreJTA = attrs.getIgnoreJTA(); this.concurrencyLevel = attrs.getConcurrencyLevel();
this.customEntryIdleTimeout = attrs.getCustomEntryIdleTimeout(); updateEntryExpiryPossible(); this.statisticsEnabled = attrs.getStatisticsEnabled(); this.ignoreJTA = attrs.getIgnoreJTA(); this.isLockGrantor = attrs.isLockGrantor();
this.regionAttributes.statisticsEnabled = regionAttributes.getStatisticsEnabled(); this.regionAttributes.ignoreJTA = regionAttributes.getIgnoreJTA(); this.regionAttributes.keyConstraint = regionAttributes.getKeyConstraint();
this.dataPolicy = attr.getDataPolicy(); this.scope = attr.getScope(); this.statsEnabled = attr.getStatisticsEnabled(); this.ignoreJTA = attr.getIgnoreJTA(); this.concurrencyLevel = attr.getConcurrencyLevel();
assertEquals(16, attrs.getInitialCapacity()); assertEquals(0.75, attrs.getLoadFactor(), 0.0); assertFalse(attrs.getStatisticsEnabled()); assertFalse(attrs.getPersistBackup()); DiskWriteAttributes dwa = attrs.getDiskWriteAttributes();
if (parentIsUserSpecified) { if (parentWithHas.hasStatisticsEnabled()) { setStatisticsEnabled(parent.getStatisticsEnabled()); setStatisticsEnabled(parent.getStatisticsEnabled());
private void assertStatisticsEnabled() { Region localRegion = getRegion(); Assert.state(localRegion.getAttributes().getStatisticsEnabled(), String.format("Statistics for Region [%s] must be enabled to change Entry & Region TTL/TTI Expiration settings", localRegion.getFullPath())); } }
private void assertStatisticsEnabled() { Region localRegion = getRegion(); Assert.state(localRegion.getAttributes().getStatisticsEnabled(), String.format("Statistics for Region [%s] must be enabled to change Entry & Region TTL/TTI Expiration settings", localRegion.getFullPath())); } }
private BiConsumer<Region<?, ?>, Health.Builder> withRegionDetails() { return (region, builder) -> { String regionName = region.getName(); builder.withDetail(cacheRegionKey(regionName, "full-path"), region.getFullPath()); Optional.ofNullable(region.getAttributes()) .ifPresent(regionAttributes -> builder .withDetail(cacheRegionKey(regionName, "cloning-enabled"), toYesNoString(regionAttributes.getCloningEnabled())) .withDetail(cacheRegionKey(regionName, "data-policy"), String.valueOf(regionAttributes.getDataPolicy())) .withDetail(cacheRegionKey(regionName, "initial-capacity"), regionAttributes.getInitialCapacity()) .withDetail(cacheRegionKey(regionName, "load-factor"), regionAttributes.getLoadFactor()) .withDetail(cacheRegionKey(regionName, "key-constraint"), nullSafeClassName(regionAttributes.getKeyConstraint())) .withDetail(cacheRegionKey(regionName, "off-heap"), toYesNoString(regionAttributes.getOffHeap())) .withDetail(cacheRegionKey(regionName, "pool-name"), Optional.ofNullable(regionAttributes.getPoolName()) .filter(StringUtils::hasText) .orElse("")) .withDetail(cacheRegionKey(regionName, "scope"), String.valueOf(regionAttributes.getScope())) .withDetail(cacheRegionKey(regionName, "statistics-enabled"), toYesNoString(regionAttributes.getStatisticsEnabled())) .withDetail(cacheRegionKey(regionName, "value-constraint"), nullSafeClassName(regionAttributes.getValueConstraint()))); }; }