org.apache.geode.cache.RegionAttributes.getStatisticsEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(91)

本文整理了Java中org.apache.geode.cache.RegionAttributes.getStatisticsEnabled方法的一些代码示例,展示了RegionAttributes.getStatisticsEnabled的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RegionAttributes.getStatisticsEnabled方法的具体详情如下:
包路径:org.apache.geode.cache.RegionAttributes
类名称:RegionAttributes
方法名:getStatisticsEnabled

RegionAttributes.getStatisticsEnabled介绍

[英]Returns whether the statistics are enabled for this region and its entries. Default is false.
[中]返回是否为此区域及其条目启用统计信息。默认值为false。

代码示例

代码示例来源:origin: apache/geode

@Override
public boolean getStatisticsEnabled() {
 return this.ra.getStatisticsEnabled();
}

代码示例来源:origin: apache/geode

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;
 }
}

代码示例来源:origin: apache/geode

/**
 * 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();
}

代码示例来源:origin: apache/geode

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());

代码示例来源:origin: apache/geode

"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())}));

代码示例来源:origin: apache/geode

poolName = ra.getPoolName();
scope = ra.getScope();
statisticsEnabled = ra.getStatisticsEnabled();
entryTimeToLive = ra.getEntryTimeToLive().getTimeout();
isLockGrantor = ra.isLockGrantor();

代码示例来源:origin: apache/geode

int concurrencyLevel = regAttrs.getConcurrencyLevel();
boolean indexMaintenanceSynchronous = regAttrs.getIndexMaintenanceSynchronous();
boolean statisticsEnabled = regAttrs.getStatisticsEnabled();

代码示例来源:origin: apache/geode

if (generateDefaults() || attrs.getStatisticsEnabled())
 atts.addAttribute("", "", STATISTICS_ENABLED, "",
   String.valueOf(attrs.getStatisticsEnabled()));

代码示例来源:origin: apache/geode

if (!attrs.getStatisticsEnabled() && (attrs.getRegionTimeToLive().getTimeout() != 0
  || attrs.getRegionIdleTimeout().getTimeout() != 0
  || attrs.getEntryTimeToLive().getTimeout() != 0

代码示例来源:origin: apache/geode

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();
}

代码示例来源:origin: apache/geode

|| 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);

代码示例来源:origin: apache/geode

this.regionTimeToLive = attrs.getRegionTimeToLive();
this.scope = attrs.getScope();
this.statisticsEnabled = attrs.getStatisticsEnabled();
this.ignoreJTA = attrs.getIgnoreJTA();
this.concurrencyLevel = attrs.getConcurrencyLevel();

代码示例来源:origin: apache/geode

this.customEntryIdleTimeout = attrs.getCustomEntryIdleTimeout();
updateEntryExpiryPossible();
this.statisticsEnabled = attrs.getStatisticsEnabled();
this.ignoreJTA = attrs.getIgnoreJTA();
this.isLockGrantor = attrs.isLockGrantor();

代码示例来源:origin: apache/geode

this.regionAttributes.statisticsEnabled = regionAttributes.getStatisticsEnabled();
this.regionAttributes.ignoreJTA = regionAttributes.getIgnoreJTA();
this.regionAttributes.keyConstraint = regionAttributes.getKeyConstraint();

代码示例来源:origin: apache/geode

this.dataPolicy = attr.getDataPolicy();
this.scope = attr.getScope();
this.statsEnabled = attr.getStatisticsEnabled();
this.ignoreJTA = attr.getIgnoreJTA();
this.concurrencyLevel = attr.getConcurrencyLevel();

代码示例来源:origin: apache/geode

assertEquals(16, attrs.getInitialCapacity());
assertEquals(0.75, attrs.getLoadFactor(), 0.0);
assertFalse(attrs.getStatisticsEnabled());
assertFalse(attrs.getPersistBackup());
DiskWriteAttributes dwa = attrs.getDiskWriteAttributes();

代码示例来源:origin: apache/geode

if (parentIsUserSpecified) {
 if (parentWithHas.hasStatisticsEnabled()) {
  setStatisticsEnabled(parent.getStatisticsEnabled());
 setStatisticsEnabled(parent.getStatisticsEnabled());

代码示例来源:origin: org.springframework.data/spring-data-gemfire

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()));
  }
}

代码示例来源:origin: org.springframework.data/spring-data-geode

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()));
  }
}

代码示例来源:origin: org.springframework.geode/spring-geode-actuator

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())));
  };
}

相关文章

微信公众号

最新文章

更多

RegionAttributes类方法