public ClientRegionFactory<K,V> setStatisticsEnabled(boolean statisticsEnabled) { this.attrsFactory.setStatisticsEnabled(statisticsEnabled); return this; }
public ClientRegionFactory<K,V> setStatisticsEnabled(boolean statisticsEnabled) { this.attrsFactory.setStatisticsEnabled(statisticsEnabled); return this; }
/** * Sets whether statistics are enabled for this region and its entries. * * @param statisticsEnabled * whether statistics are enabled * @return a reference to this RegionFactory object * @see AttributesFactory#setStatisticsEnabled */ public RegionFactory<K,V> setStatisticsEnabled(boolean statisticsEnabled) { this.attrsFactory.setStatisticsEnabled(statisticsEnabled); return this; }
/** * Sets whether statistics are enabled for this region and its entries. * * @param statisticsEnabled * whether statistics are enabled * @return a reference to this RegionFactory object * @see AttributesFactory#setStatisticsEnabled */ public RegionFactory<K,V> setStatisticsEnabled(boolean statisticsEnabled) { this.attrsFactory.setStatisticsEnabled(statisticsEnabled); return this; }
public void run2() throws CacheException { AttributesFactory factory = new AttributesFactory(getRegionAttributes()); factory.setStatisticsEnabled(true); ExpirationAttributes expire = new ExpirationAttributes(longTimeout, ExpirationAction.DESTROY); factory.setEntryIdleTimeout(expire); Region region = null; System.setProperty(LocalRegion.EXPIRY_MS_PROPERTY, "true"); try { region = createRegion(name, factory.create()); region.create(key, value); } finally { System.getProperties().remove(LocalRegion.EXPIRY_MS_PROPERTY); } } };
public void run2() throws CacheException { Cache cache = getCache(); AttributesFactory factory = new AttributesFactory(); factory.setStatisticsEnabled(true); RegionAttributes attrs = factory.create(); cache.createRegion(name, attrs); } });
public void run2() throws CacheException { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setEarlyAck(false); factory.setStatisticsEnabled(true); createRegion(name, factory.create()); } };
protected Region getOrCreateRootRegion() throws CacheException { Region root = getRootRegion(); if (root == null) { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setEarlyAck(false); factory.setStatisticsEnabled(true); root = createRootRegion(factory.create()); } return root; }
public void run2() throws CacheException { AttributesFactory factory = new AttributesFactory(getRegionAttributes()); factory.setStatisticsEnabled(true); ExpirationAttributes expire = new ExpirationAttributes(timeout, ExpirationAction.DESTROY); factory.setEntryIdleTimeout(expire); Region region = createRegion(name, factory.create()); region.create(key, null); } });
private void createHARegion(String processedRegionName, GemFireCacheImpl cache) throws IOException, ClassNotFoundException { AttributesFactory af = new AttributesFactory(); af.setMirrorType(MirrorType.KEYS_VALUES); af.addCacheListener(createCacheListenerForHARegion()); af.setStatisticsEnabled(true); RegionAttributes ra = af.create(); this.region = HARegion.getInstance(processedRegionName, cache, this, ra); if (isPrimary) {//fix for 41878 // since it's primary queue, we will disable the EntryExpiryTask // this should be done after region creation disableEntryExpiryTasks(); } }
public void run() { try { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setEarlyAck(false); factory.setStatisticsEnabled(true); Region region = createRegion(name,factory.create()); region.create(objectName,null); } catch (CacheException ex) { fail("While creating ACK region", ex); } } });
public void run() { try { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setEarlyAck(false); factory.setStatisticsEnabled(true); Region region = createRegion(name,factory.create()); region.put(objectName,value); } catch (CacheException ex) { fail("While creating ACK region", ex); } } });
public void run() { try { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setEarlyAck(false); factory.setStatisticsEnabled(true); Region region = createRegion(name,factory.create()); region.create(objectName,null); } catch (CacheException ex) { fail("While creating ACK region", ex); } } });
public void run2() throws CacheException { AttributesFactory factory = new AttributesFactory(getRegionAttributes()); factory.setStatisticsEnabled(true); ExpirationAttributes expire = new ExpirationAttributes(timeout, ExpirationAction.DESTROY); factory.setEntryIdleTimeout(expire); if(getRegionAttributes().getPartitionAttributes() != null){ createRegion(name, factory.create()); } else { createRegion(name); } } });
protected void createWithExpiration(String regionName, ExpirationAttributes ttl, ExpirationAttributes idle) throws CacheException { AttributesFactory factory = new AttributesFactory(); factory.setStatisticsEnabled(true); if (ttl != null) factory.setRegionTimeToLive(ttl); if (idle != null) factory.setRegionIdleTimeout(idle); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setEarlyAck(false); RegionAttributes attrs = factory.create(); getLogWriter().info("4: " + regionName + " ttl action is " + ttl); getOrCreateRootRegion().createSubregion(regionName, attrs); }
private static Region _createRegion(String name, int ttl, ExpirationAction action, SubscriptionAttributes subAttrs, GenericListener l) throws CacheException { Region region = getRegion(); AttributesFactory factory = new AttributesFactory(); factory.setStatisticsEnabled(true); factory.setEntryTimeToLive(new ExpirationAttributes(ttl, action)); factory.setSubscriptionAttributes(subAttrs); factory.addCacheListener(l); factory.setPartitionAttributes((new PartitionAttributesFactory()).create()); Region sub = region.createSubregion(name, factory.create()); return sub; }
/** * Expiration needs some more work in the new TX model. */ public void DISABLED_TILL_NEW_TX_IMPL_COMPLETE_testEntryTTLExpiration() throws CacheException { AttributesFactory af = new AttributesFactory(); af.setScope(Scope.DISTRIBUTED_NO_ACK); af.setStatisticsEnabled(true); af.setEntryTimeToLive(new ExpirationAttributes(2, ExpirationAction.DESTROY)); Region exprReg = this.cache.createRegion("TXEntryTTL", af.create()); generalEntryExpirationTest(exprReg, 2); AttributesMutator mutator = exprReg.getAttributesMutator(); mutator.setEntryTimeToLive(new ExpirationAttributes(1, ExpirationAction.DESTROY)); generalEntryExpirationTest(exprReg, 1); }
public void testRegionTTLExpiration() throws CacheException { AttributesFactory af = new AttributesFactory(); af.setScope(Scope.DISTRIBUTED_NO_ACK); af.setStatisticsEnabled(true); af.setRegionTimeToLive(new ExpirationAttributes(1, ExpirationAction.INVALIDATE)); Region exprReg = this.cache.createRegion("TXRegionTTL", af.create()); generalRegionExpirationTest(exprReg, 1, null, true); generalRegionExpirationTest(exprReg, 2, new ExpirationAttributes(2, ExpirationAction.INVALIDATE), true); generalRegionExpirationTest(exprReg, 1, new ExpirationAttributes(1, ExpirationAction.INVALIDATE), true); generalRegionExpirationTest(exprReg, 1, new ExpirationAttributes(1, ExpirationAction.DESTROY), true); }
public void testRegionIdleExpiration() throws CacheException { AttributesFactory af = new AttributesFactory(); af.setScope(Scope.DISTRIBUTED_NO_ACK); af.setStatisticsEnabled(true); af.setRegionIdleTimeout(new ExpirationAttributes(2, ExpirationAction.INVALIDATE)); Region exprReg = this.cache.createRegion("TXRegionIdle", af.create()); generalRegionExpirationTest(exprReg, 2, null, false); generalRegionExpirationTest(exprReg, 1, new ExpirationAttributes(1, ExpirationAction.INVALIDATE), false); generalRegionExpirationTest(exprReg, 2, new ExpirationAttributes(2, ExpirationAction.INVALIDATE), false); generalRegionExpirationTest(exprReg, 1, new ExpirationAttributes(1, ExpirationAction.DESTROY), false); } public void testRegionTTLExpiration() throws CacheException {
public void testLocalInvalidateIdleTimeout() { Cache cache = getCache(); AttributesFactory attr = new AttributesFactory(); PartitionAttributesFactory paf = new PartitionAttributesFactory(); paf.setRedundantCopies(1); paf.setRecoveryDelay(-1); paf.setStartupRecoveryDelay(-1); PartitionAttributes prAttr = paf.create(); attr.setStatisticsEnabled(true); attr.setEntryIdleTimeout(new ExpirationAttributes(1000, ExpirationAction.LOCAL_INVALIDATE)); attr.setPartitionAttributes(prAttr); try { cache.createRegion("region1", attr.create()); fail("We should not have been able to create the region"); } catch(IllegalStateException expected) { } }