/** * 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; }
@Override public ClientRegionFactory<K, V> setStatisticsEnabled(boolean statisticsEnabled) { this.attrsFactory.setStatisticsEnabled(statisticsEnabled); return this; }
@Override public void run2() throws CacheException { RegionAttributes<?, ?> ra = getRegionAttributes(); AttributesFactory<?, ?> factory = new AttributesFactory<>(ra); final boolean partitioned = ra.getPartitionAttributes() != null || ra.getDataPolicy().withPartitioning(); // MUST be nonmirrored, so turn off persistBackup if this is a disk region test if (!partitioned) { if (ra.getEvictionAttributes() == null || !ra.getEvictionAttributes().getAction().isOverflowToDisk()) { factory.setDiskStoreName(null); } factory.setDataPolicy(DataPolicy.NORMAL); } factory.setStatisticsEnabled(true); ExpirationAttributes expire = new ExpirationAttributes(shortTimeout, ExpirationAction.DESTROY); factory.setEntryTimeToLive(expire); System.setProperty(LocalRegion.EXPIRY_MS_PROPERTY, "true"); try { createRegion(name, factory.create()); } finally { System.getProperties().remove(LocalRegion.EXPIRY_MS_PROPERTY); } } });
@Override public void run2() throws CacheException { RegionAttributes<?, ?> ra = getRegionAttributes(); AttributesFactory<?, ?> factory = new AttributesFactory<>(ra); final boolean partitioned = ra.getPartitionAttributes() != null || ra.getDataPolicy().withPartitioning(); // MUST be nonmirrored, so turn off persistBackup if this is a disk region test if (!partitioned) { if (ra.getEvictionAttributes() == null || !ra.getEvictionAttributes().getAction().isOverflowToDisk()) { factory.setDiskStoreName(null); } factory.setDataPolicy(DataPolicy.NORMAL); } factory.setStatisticsEnabled(true); ExpirationAttributes expire = new ExpirationAttributes(shortTimeout, ExpirationAction.DESTROY); factory.setEntryIdleTimeout(expire); System.setProperty(LocalRegion.EXPIRY_MS_PROPERTY, "true"); try { createRegion(name, factory.create()); } finally { System.getProperties().remove(LocalRegion.EXPIRY_MS_PROPERTY); } } });
attributesFactory.setKeyConstraint(String.class); attributesFactory.setScope(Scope.DISTRIBUTED_ACK); attributesFactory.setStatisticsEnabled(false); attributesFactory.setValueConstraint(String.class);
@Override 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); } } });
private void createHARegion(String processedRegionName, InternalCache 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(); } }
ExpirationAttributes expire = new ExpirationAttributes(timeout, ExpirationAction.INVALIDATE); factory.setEntryTimeToLive(expire); factory.setStatisticsEnabled(true); RegionAttributes attrs = factory.create();
ExpirationAttributes expire = new ExpirationAttributes(timeout, ExpirationAction.DESTROY); factory.setEntryTimeToLive(expire); factory.setStatisticsEnabled(true); RegionAttributes attrs = factory.create();
ExpirationAttributes expire = new ExpirationAttributes(timeout, ExpirationAction.DESTROY); factory.setRegionIdleTimeout(expire); factory.setStatisticsEnabled(true); RegionAttributes attrs = factory.create();
new ExpirationAttributes(timeout, ExpirationAction.INVALIDATE); factory.setRegionTimeToLive(expire); factory.setStatisticsEnabled(true); RegionAttributes attrs = factory.create();
factory.setStatisticsEnabled(true); RegionAttributes attrs = factory.create();
ExpirationAttributes expire = new ExpirationAttributes(timeout, ExpirationAction.INVALIDATE); factory.setEntryTimeToLive(expire); factory.setStatisticsEnabled(true); factory.setCacheLoader(new TestCacheLoader() { @Override
ExpirationAttributes expire = new ExpirationAttributes(timeout, ExpirationAction.DESTROY); factory.setRegionTimeToLive(expire); factory.setStatisticsEnabled(true); RegionAttributes attrs = factory.create();
factory.setStatisticsEnabled(true); RegionAttributes attrs = factory.create(); Region region = null;
factory.setStatisticsEnabled(true); attrs = factory.create();
factory.setStatisticsEnabled(true); RegionAttributes attrs = factory.create(); LocalRegion region = null;
/** * This method creates the client health monitoring region. * <p> * GuardedBy ClientHealthMonitoringRegion.class * * @param cache The current GemFire Cache */ private static void initialize(InternalCache cache) { try { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setEntryTimeToLive( new ExpirationAttributes(ADMIN_REGION_EXPIRY_INTERVAL, ExpirationAction.DESTROY)); cache.getLogger().fine("ClientHealthMonitoringRegion, setting TTL for entry...."); factory.addCacheListener(prepareCacheListener()); factory.setValueConstraint(ClientHealthStats.class); factory.setStatisticsEnabled(true); RegionAttributes regionAttrs = factory.create(); InternalRegionArguments internalArgs = new InternalRegionArguments(); internalArgs.setIsUsedForMetaRegion(true); internalArgs.setIsUsedForPartitionedRegionAdmin(false); currentInstance = cache.createVMRegion(ADMIN_REGION_NAME, regionAttrs, internalArgs); } catch (Exception ex) { cache.getLogger().error( "Error while creating an admin region", ex); } }
ExpirationAttributes expireTtl = new ExpirationAttributes(timeout, ExpirationAction.DESTROY); factory.setEntryTimeToLive(expireTtl); factory.setStatisticsEnabled(true); RegionAttributes attrs = factory.create();
ExpirationAttributes expire = new ExpirationAttributes(timeout, ExpirationAction.DESTROY); factory.setEntryIdleTimeout(expire); factory.setStatisticsEnabled(true); RegionAttributes attrs = factory.create();