protected PartitionRegionCacheStatistics(Region<?, ?> region) { Assert.isInstanceOf(PartitionedRegion.class, region, () -> String.format("Region [%1$s] must be of type [%2$s]", RegionUtils.toRegionPath(region), PartitionedRegion.class.getName())); this.partitionRegion = computeStatistics((PartitionedRegion) region); }
private boolean isIncludedJsonRegion(Region region) { boolean result = false; if (isIncludedJsonRegion(toRegionName(region), toRegionPath(region))) { if (log.isDebugEnabled()) { log.debug(String.format("Region [%s] is included for JSON conversion", region.getName())); } result = true; } return result; }
private boolean isIncludedJsonRegion(Region region) { boolean result = false; if (isIncludedJsonRegion(toRegionName(region), toRegionPath(region))) { if (log.isDebugEnabled()) { log.debug(String.format("Region [%s] is included for JSON conversion", region.getName())); } result = true; } return result; }
/** * Constructs a Pivotal GemFire {@link Index} over the attributes of the {@link HttpSession}. * * @return a Pivotal GemFire {@link Index} over the {@link HttpSession} attributes. * @throws Exception if an error occurs while initializing the Pivotal GemFire {@link Index}. * @see org.springframework.data.gemfire.IndexFactoryBean */ protected Index newIndex() throws Exception { IndexFactoryBean indexFactory = new IndexFactoryBean(); indexFactory.setBeanFactory(this.beanFactory); indexFactory.setBeanName(this.beanName); indexFactory.setCache(this.gemfireCache); indexFactory.setName("sessionAttributesIndex"); indexFactory.setExpression(String.format("s.attributes[%1$s]", getIndexableSessionAttributesAsGemFireIndexExpression())); indexFactory.setFrom(String.format("%1$s s", RegionUtils.toRegionPath(this.regionName))); indexFactory.setOverride(true); indexFactory.afterPropertiesSet(); return indexFactory.getObject(); }
/** * Defines a Pivotal GemFire Index bean on the Pivotal GemFire cache {@link Region} storing and managing Sessions, * specifically on the 'principalName' property for quick lookup of Sessions by 'principalName'. * * @param gemfireCache a reference to the Pivotal GemFire cache. * @return a {@link IndexFactoryBean} to create an Pivotal GemFire Index on the 'principalName' property * for Sessions stored in the Pivotal GemFire cache {@link Region}. * @see org.springframework.data.gemfire.IndexFactoryBean * @see org.apache.geode.cache.GemFireCache */ @Bean @DependsOn(DEFAULT_SESSION_REGION_NAME) public IndexFactoryBean principalNameIndex(GemFireCache gemfireCache) { IndexFactoryBean principalNameIndex = new IndexFactoryBean(); principalNameIndex.setCache(gemfireCache); principalNameIndex.setName("principalNameIndex"); principalNameIndex.setExpression("principalName"); principalNameIndex.setFrom(RegionUtils.toRegionPath(getSessionRegionName())); principalNameIndex.setOverride(true); principalNameIndex.setType(IndexType.HASH); return principalNameIndex; }