From 8e53d534ba534ca308831f0ef07d705c0db26987 Mon Sep 17 00:00:00 2001 From: John Blum Date: Wed, 14 Jul 2021 14:38:23 -0700 Subject: [PATCH] Declare getter and setter for statisticsEnabled. Set statisticsEnabled property for client and peer (server) Regions. Resolves gh-518. --- .../support/CacheTypeAwareRegionFactoryBean.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/spring-data-geode/src/main/java/org/springframework/data/gemfire/config/annotation/support/CacheTypeAwareRegionFactoryBean.java b/spring-data-geode/src/main/java/org/springframework/data/gemfire/config/annotation/support/CacheTypeAwareRegionFactoryBean.java index e10c2ecbb..0b389e83f 100644 --- a/spring-data-geode/src/main/java/org/springframework/data/gemfire/config/annotation/support/CacheTypeAwareRegionFactoryBean.java +++ b/spring-data-geode/src/main/java/org/springframework/data/gemfire/config/annotation/support/CacheTypeAwareRegionFactoryBean.java @@ -14,7 +14,6 @@ * limitations under the License. * */ - package org.springframework.data.gemfire.config.annotation.support; import static org.springframework.data.gemfire.util.ArrayUtils.nullSafeArray; @@ -171,6 +170,7 @@ protected Region newClientRegion(GemFireCache gemfireCache, String regionN clientRegionFactory.setRegionConfigurers(this.regionConfigurers); clientRegionFactory.setRegionName(regionName); clientRegionFactory.setShortcut(getClientRegionShortcut()); + clientRegionFactory.setStatisticsEnabled(getStatisticsEnabled()); clientRegionFactory.setValueConstraint(getValueConstraint()); getPoolName().ifPresent(clientRegionFactory::setPoolName); @@ -228,6 +228,7 @@ protected Region newServerRegion(GemFireCache gemfireCache, String regionN serverRegionFactory.setRegionConfigurers(this.regionConfigurers); serverRegionFactory.setRegionName(regionName); serverRegionFactory.setShortcut(getServerRegionShortcut()); + serverRegionFactory.setStatisticsEnabled(getStatisticsEnabled()); serverRegionFactory.setValueConstraint(getValueConstraint()); configureEviction(serverRegionFactory); @@ -502,6 +503,14 @@ protected Optional getSmartLifecycleComponent() { return Optional.ofNullable(this.smartLifecycleComponent); } + public void setStatisticsEnabled(Boolean statisticsEnabled) { + this.statisticsEnabled = statisticsEnabled; + } + + public Boolean getStatisticsEnabled() { + return statisticsEnabled; + } + public void setValueConstraint(Class valueConstraint) { this.valueConstraint = valueConstraint; }