public boolean getStatisticsEnabled() { return this.ra.getStatisticsEnabled(); }
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.keys(); 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; } }
if (name.equals(regionName)) { gfsh.println(" " + name); if (rgn.getAttributes().getStatisticsEnabled()) { CacheStatistics stats = rgn.getStatistics(); gfsh.println(" " + stats);
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.keys(); 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 ex) { return true; } if (expTime == 0) return false; return expTime <= cacheTimeMillis(); }
/** * 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 ex) { return true; } if (expTime == 0) return false; return expTime <= cacheTimeMillis(); }
buf.append("\n regionTimeToLive: " + r.getRegionTimeToLive()); buf.append("\n scope: " + r.getScope()); buf.append("\n statisticsEnabled: " + r.getStatisticsEnabled()); buf.append("\n valueConstraint: " + r.getValueConstraint()); return buf.toString();
buf.append("\n regionTimeToLive: " + r.getRegionTimeToLive()); buf.append("\n scope: " + r.getScope()); buf.append("\n statisticsEnabled: " + r.getStatisticsEnabled()); buf.append("\n valueConstraint: " + r.getValueConstraint()); return buf.toString();
r1.getCache().getDistributedSystem().getProperties().get("cache-xml-file")); RegionAttributes ra = r1.getAttributes(); assertEquals(ra.getStatisticsEnabled(), true); assertEquals(ra.getScope().isDistributedAck(), true); assertEquals(ra.getValueConstraint(), Integer.class);
public void testSetStatisticsEnabled() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL); r1 = factory.setStatisticsEnabled(true).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(true, ra.getStatisticsEnabled()); } finally { cleanUpRegion(r1); } }
assertBasicRegionFunctionality(r1, r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(ra.getStatisticsEnabled(), true); assertEquals(ra.getScope().isDistributedAck(), true); assertEquals(ra.getValueConstraint(), Integer.class);
public void testSetStatisticsEnabled() throws CacheException, IOException { ClientCache c = new ClientCacheFactory().create(); Region r1 = null; try { ClientRegionFactory factory = c.createClientRegionFactory(CACHING_PROXY); r1 = factory.setStatisticsEnabled(true).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(true, ra.getStatisticsEnabled()); } finally { cleanUpRegion(r1); } }
rd.setStatisticsEnabled(Boolean.valueOf(ra.getStatisticsEnabled())); rd.setValueConstraint(ra.getValueConstraint());
public static void assertEquals(RegionAttributes ra1, RegionAttributes ra2) { assertEquals(ra1.getScope(), ra2.getScope()); assertEquals(ra1.getKeyConstraint(), ra2.getKeyConstraint()); assertEquals(ra1.getValueConstraint(), ra2.getValueConstraint()); assertEquals(ra1.getCacheListener(), ra2.getCacheListener()); assertEquals(ra1.getCacheWriter(), ra2.getCacheWriter()); assertEquals(ra1.getCacheLoader(), ra2.getCacheLoader()); assertEquals(ra1.getStatisticsEnabled(), ra2.getStatisticsEnabled()); assertEquals(ra1.getConcurrencyLevel(), ra2.getConcurrencyLevel()); assertEquals(ra1.getInitialCapacity(), ra2.getInitialCapacity()); assertTrue(ra1.getLoadFactor() == ra2.getLoadFactor()); assertEquals(ra1.getEarlyAck(), ra2.getEarlyAck()); assertEquals(ra1.isDiskSynchronous(), ra2.isDiskSynchronous()); assertEquals(ra1.getDiskStoreName(), ra2.getDiskStoreName()); }
public static void assertEquals(RegionAttributes ra1, RegionAttributes ra2) { assertEquals(ra1.getScope(), ra2.getScope()); assertEquals(ra1.getKeyConstraint(), ra2.getKeyConstraint()); assertEquals(ra1.getValueConstraint(), ra2.getValueConstraint()); assertEquals(ra1.getCacheListener(), ra2.getCacheListener()); assertEquals(ra1.getCacheWriter(), ra2.getCacheWriter()); assertEquals(ra1.getCacheLoader(), ra2.getCacheLoader()); assertEquals(ra1.getStatisticsEnabled(), ra2.getStatisticsEnabled()); assertEquals(ra1.getConcurrencyLevel(), ra2.getConcurrencyLevel()); assertEquals(ra1.getInitialCapacity(), ra2.getInitialCapacity()); assertTrue(ra1.getLoadFactor() == ra2.getLoadFactor()); assertEquals(ra1.getEarlyAck(), ra2.getEarlyAck()); assertEquals(ra1.isDiskSynchronous(), ra2.isDiskSynchronous()); assertEquals(ra1.getDiskStoreName(), ra2.getDiskStoreName()); }
this.regAttrs = region.getAttributes(); this.isStatisticsEnabled = regAttrs.getStatisticsEnabled();
this.regAttrs = region.getAttributes(); this.isStatisticsEnabled = regAttrs.getStatisticsEnabled();
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();