@Override public void run() { Properties localProps = new Properties(); localProps.setProperty(DistributionConfig.NAME_NAME, alterVm2Name); localProps.setProperty(DistributionConfig.GROUPS_NAME, "Group1,Group2"); getSystem(localProps); Cache cache = getCache(); cache.createRegionFactory(RegionShortcut.PARTITION).setStatisticsEnabled(true).create(alterRegionName); } });
@Override public void run() { Cache cache = getCache(); cache.createRegionFactory(RegionShortcut.PARTITION).setStatisticsEnabled(true).create(alterRegionName); } });
try { final Region r = this.cache.createRegionFactory(RegionShortcut.LOCAL) .setStatisticsEnabled(true) .setCustomEntryIdleTimeout(new CustomExpiry() { private boolean secondTime;
try { final Region r = this.cache.createRegionFactory(RegionShortcut.LOCAL) .setStatisticsEnabled(true) .setCustomEntryTimeToLive(new CustomExpiry() { @Override
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); } }
@Override public void run() { Properties localProps = new Properties(); localProps.setProperty(DistributionConfig.NAME_NAME, alterVm1Name); localProps.setProperty(DistributionConfig.GROUPS_NAME, "Group1"); getSystem(localProps); Cache cache = getCache(); // Setup queues and gateway senders to be used by all tests cache.createRegionFactory(RegionShortcut.PARTITION).setStatisticsEnabled(true).create(alterRegionName); AsyncEventListener listener = new AsyncEventListener<Object, Object>() { @Override public void close() { // Nothing to do } @Override public boolean processEvents(List<AsyncEvent<Object, Object>> events) { return true; } }; cache.createAsyncEventQueueFactory().create(alterAsyncEventQueueId1, listener); cache.createAsyncEventQueueFactory().create(alterAsyncEventQueueId2, listener); cache.createAsyncEventQueueFactory().create(alterAsyncEventQueueId3, listener); GatewaySenderFactory gatewaySenderFactory = cache.createGatewaySenderFactory(); gatewaySenderFactory.setManualStart(true); gatewaySenderFactory.create(alterGatewaySenderId1, 2); gatewaySenderFactory.create(alterGatewaySenderId2, 3); gatewaySenderFactory.create(alterGatewaySenderId3, 4); } });
public void testRegionFactoryRegionAttributes() throws CacheException { Region r1 = null, r2 = null, r3 = null; try { Properties p = new Properties(); p.put("mcast-port", "0"); r1 = new RegionFactory(p).setScope(Scope.LOCAL) .setConcurrencyLevel(1).setLoadFactor(0.8F).setKeyConstraint( String.class).setStatisticsEnabled(true).create(r1Name); assertBasicRegionFunctionality(r1, r1Name); final RegionFactory factory = new RegionFactory(p, r1.getAttributes()); r2 = factory.create(r2Name); assertBasicRegionFunctionality(r2, r2Name); assertEquals(r1.getAttributes(), r2.getAttributes()); r3 = factory.create(r3Name); try { assertEquals(r2.getAttributes(), r3.getAttributes()); fail("Expected r2 attributes to be different from r3"); } catch (AssertionFailedError expected) { } } finally { cleanUpRegion(r1); cleanUpRegion(r2); cleanUpRegion(r3); } }
regionFactory.setKeyConstraint(regionDefinition.getKeyConstraint()); regionFactory.setScope(Scope.DISTRIBUTED_NO_ACK); regionFactory.setStatisticsEnabled(true); regionFactory.setValueConstraint(regionDefinition.getValueConstraint());
factory.setStatisticsEnabled(regionCreateArgs.isStatisticsEnabled());
factory.setStatisticsEnabled(regionCreateArgs.isStatisticsEnabled());