DATAGEODE-1 - Remove support for DynamicRegionFactory.
Resolves gh-29.
This commit is contained in:
committed by
John Blum
parent
dc0d14b8ee
commit
1a012c992a
@@ -121,9 +121,7 @@ or child elements, as the following listing shows:
|
||||
|
||||
<gfe:gateway-conflict-resolver ref="myGatewayConflictResolver"/> <!--7-->
|
||||
|
||||
<gfe:dynamic-region-factory/> <!--8-->
|
||||
|
||||
<gfe:jndi-binding jndi-name="myDataSource" type="ManagedDataSource"/> <!--9-->
|
||||
<gfe:jndi-binding jndi-name="myDataSource" type="ManagedDataSource"/> <!--8-->
|
||||
|
||||
</gfe:cache>
|
||||
----
|
||||
@@ -157,9 +155,8 @@ must implement {x-data-store-javadoc}/org/apache/geode/cache/util/GatewayConflic
|
||||
[GatewayConflictResolver].
|
||||
A `GatewayConflictResolver` is a `Cache`-level plugin that is called upon to decide what to do with events
|
||||
that originate in other systems and arrive through the WAN Gateway.
|
||||
<8> Enables {data-store-name}'s {x-data-store-docs}/developing/region_options/dynamic_region_creation.html[DynamicRegionFactory],
|
||||
which provides a distributed Region creation service.
|
||||
<9> Declares a JNDI binding to enlist an external DataSource in a {data-store-name} transaction.
|
||||
<8> Declares a JNDI binding to enlist an external DataSource in a {data-store-name} transaction.
|
||||
|
||||
[[bootstrap:cache:pdx-serialization]]
|
||||
=== Enabling PDX Serialization
|
||||
|
||||
@@ -41,7 +41,6 @@ import org.apache.geode.GemFireException;
|
||||
import org.apache.geode.cache.Cache;
|
||||
import org.apache.geode.cache.CacheClosedException;
|
||||
import org.apache.geode.cache.CacheFactory;
|
||||
import org.apache.geode.cache.DynamicRegionFactory;
|
||||
import org.apache.geode.cache.GemFireCache;
|
||||
import org.apache.geode.cache.RegionService;
|
||||
import org.apache.geode.cache.TransactionListener;
|
||||
@@ -87,11 +86,11 @@ import org.springframework.util.StringUtils;
|
||||
* @author Costin Leau
|
||||
* @author David Turanski
|
||||
* @author John Blum
|
||||
* @author Patrick Johnson
|
||||
* @see java.util.Properties
|
||||
* @see org.apache.geode.cache.Cache
|
||||
* @see org.apache.geode.cache.CacheFactory
|
||||
* @see org.apache.geode.cache.GemFireCache
|
||||
* @see org.apache.geode.cache.DynamicRegionFactory
|
||||
* @see org.apache.geode.cache.RegionService
|
||||
* @see org.apache.geode.distributed.DistributedMember
|
||||
* @see org.apache.geode.distributed.DistributedSystem
|
||||
@@ -127,8 +126,6 @@ public class CacheFactoryBean extends AbstractFactoryBeanSupport<GemFireCache>
|
||||
|
||||
private GemFireCache cache;
|
||||
|
||||
private DynamicRegionSupport dynamicRegionSupport;
|
||||
|
||||
private Float criticalHeapPercentage;
|
||||
private Float criticalOffHeapPercentage;
|
||||
private Float evictionHeapPercentage;
|
||||
@@ -321,7 +318,6 @@ public class CacheFactoryBean extends AbstractFactoryBeanSupport<GemFireCache>
|
||||
catch (CacheClosedException cause) {
|
||||
|
||||
this.cacheResolutionMessagePrefix = "Created new";
|
||||
initDynamicRegionFactory();
|
||||
|
||||
return (T) createCache(postProcess(configureFactory(initializeFactory(createFactory(resolveProperties())))));
|
||||
}
|
||||
@@ -342,17 +338,6 @@ public class CacheFactoryBean extends AbstractFactoryBeanSupport<GemFireCache>
|
||||
return (T) Optional.ofNullable(getCache()).orElseGet(CacheFactory::getAnyInstance);
|
||||
}
|
||||
|
||||
/**
|
||||
* If Pivotal GemFire/Apache Geode Dynamic Regions are enabled, create and initialize a {@link DynamicRegionFactory}
|
||||
* before creating the {@link Cache}.
|
||||
*
|
||||
* @see org.springframework.data.gemfire.CacheFactoryBean.DynamicRegionSupport#initDynamicRegionFactory()
|
||||
* @see #getDynamicRegionSupport()
|
||||
*/
|
||||
private void initDynamicRegionFactory() {
|
||||
Optional.ofNullable(getDynamicRegionSupport()).ifPresent(DynamicRegionSupport::initializeDynamicRegionFactory);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the Pivotal GemFire/Apache Geode {@link Properties} used to configure the {@link Cache}.
|
||||
*
|
||||
@@ -947,22 +932,6 @@ public class CacheFactoryBean extends AbstractFactoryBeanSupport<GemFireCache>
|
||||
return this.criticalOffHeapPercentage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets an instance of the DynamicRegionSupport to support Dynamic Regions in this GemFire Cache.
|
||||
*
|
||||
* @param dynamicRegionSupport the DynamicRegionSupport class to setup Dynamic Regions in this Cache.
|
||||
*/
|
||||
public void setDynamicRegionSupport(DynamicRegionSupport dynamicRegionSupport) {
|
||||
this.dynamicRegionSupport = dynamicRegionSupport;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the dynamicRegionSupport
|
||||
*/
|
||||
public DynamicRegionSupport getDynamicRegionSupport() {
|
||||
return dynamicRegionSupport;
|
||||
}
|
||||
|
||||
/**
|
||||
* Controls whether auto-reconnect functionality introduced in GemFire 8 is enabled or not.
|
||||
*
|
||||
@@ -1366,58 +1335,6 @@ public class CacheFactoryBean extends AbstractFactoryBeanSupport<GemFireCache>
|
||||
|
||||
}
|
||||
|
||||
public static class DynamicRegionSupport {
|
||||
|
||||
private Boolean persistent = Boolean.TRUE;
|
||||
private Boolean registerInterest = Boolean.TRUE;
|
||||
|
||||
private String diskDirectory;
|
||||
private String poolName;
|
||||
|
||||
public void setDiskDir(String diskDirectory) {
|
||||
this.diskDirectory = diskDirectory;
|
||||
}
|
||||
|
||||
public String getDiskDir() {
|
||||
return diskDirectory;
|
||||
}
|
||||
|
||||
public void setPersistent(Boolean persistent) {
|
||||
this.persistent = persistent;
|
||||
}
|
||||
|
||||
public Boolean getPersistent() {
|
||||
return persistent;
|
||||
}
|
||||
|
||||
public void setPoolName(String poolName) {
|
||||
this.poolName = poolName;
|
||||
}
|
||||
|
||||
public String getPoolName() {
|
||||
return poolName;
|
||||
}
|
||||
|
||||
public void setRegisterInterest(Boolean registerInterest) {
|
||||
this.registerInterest = registerInterest;
|
||||
}
|
||||
|
||||
public Boolean getRegisterInterest() {
|
||||
return registerInterest;
|
||||
}
|
||||
|
||||
public void initializeDynamicRegionFactory() {
|
||||
|
||||
File localDiskDirectory = this.diskDirectory != null ? new File(this.diskDirectory) : null;
|
||||
|
||||
DynamicRegionFactory.Config config =
|
||||
new DynamicRegionFactory.Config(localDiskDirectory, this.poolName, this.persistent,
|
||||
this.registerInterest);
|
||||
|
||||
DynamicRegionFactory.get().open(config);
|
||||
}
|
||||
}
|
||||
|
||||
public static class JndiDataSource {
|
||||
|
||||
private List<ConfigProperty> configProperties;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
package org.springframework.data.gemfire.config.annotation;
|
||||
|
||||
import static org.springframework.data.gemfire.CacheFactoryBean.DynamicRegionSupport;
|
||||
import static org.springframework.data.gemfire.CacheFactoryBean.JndiDataSource;
|
||||
import static org.springframework.data.gemfire.util.CollectionUtils.nullSafeList;
|
||||
|
||||
@@ -59,6 +58,7 @@ import org.springframework.util.StringUtils;
|
||||
* and {@link org.apache.geode.cache.client.ClientCache client caches}.
|
||||
*
|
||||
* @author John Blum
|
||||
* @author Patrick Johnson
|
||||
* @see java.lang.annotation.Annotation
|
||||
* @see java.util.Properties
|
||||
* @see org.apache.geode.cache.Cache
|
||||
@@ -110,8 +110,6 @@ public abstract class AbstractCacheConfiguration extends AbstractAnnotationConfi
|
||||
private boolean copyOnRead = DEFAULT_COPY_ON_READ;
|
||||
private boolean useBeanFactoryLocator = DEFAULT_USE_BEAN_FACTORY_LOCATOR;
|
||||
|
||||
private DynamicRegionSupport dynamicRegionSupport;
|
||||
|
||||
private Integer mcastPort = DEFAULT_MCAST_PORT;
|
||||
|
||||
private Float criticalHeapPercentage;
|
||||
@@ -345,7 +343,6 @@ public abstract class AbstractCacheConfiguration extends AbstractAnnotationConfi
|
||||
gemfireCache.setCopyOnRead(getCopyOnRead());
|
||||
gemfireCache.setCriticalHeapPercentage(getCriticalHeapPercentage());
|
||||
gemfireCache.setCriticalOffHeapPercentage(getCriticalOffHeapPercentage());
|
||||
gemfireCache.setDynamicRegionSupport(getDynamicRegionSupport());
|
||||
gemfireCache.setEvictionHeapPercentage(getEvictionHeapPercentage());
|
||||
gemfireCache.setEvictionOffHeapPercentage(getEvictionOffHeapPercentage());
|
||||
gemfireCache.setGatewayConflictResolver(getGatewayConflictResolver());
|
||||
@@ -499,14 +496,6 @@ public abstract class AbstractCacheConfiguration extends AbstractAnnotationConfi
|
||||
return this.criticalOffHeapPercentage;
|
||||
}
|
||||
|
||||
void setDynamicRegionSupport(DynamicRegionSupport dynamicRegionSupport) {
|
||||
this.dynamicRegionSupport = dynamicRegionSupport;
|
||||
}
|
||||
|
||||
protected DynamicRegionSupport getDynamicRegionSupport() {
|
||||
return this.dynamicRegionSupport;
|
||||
}
|
||||
|
||||
void setEvictionHeapPercentage(Float evictionHeapPercentage) {
|
||||
this.evictionHeapPercentage = evictionHeapPercentage;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ import org.springframework.util.xml.DomUtils;
|
||||
* @author Oliver Gierke
|
||||
* @author David Turanski
|
||||
* @author John Blum
|
||||
* @author Patrick Johnson
|
||||
* @see org.springframework.beans.factory.support.AbstractBeanDefinition
|
||||
* @see org.springframework.beans.factory.support.BeanDefinitionBuilder
|
||||
* @see org.springframework.beans.factory.support.BeanDefinitionRegistry
|
||||
@@ -129,7 +130,6 @@ class CacheParser extends AbstractSingleBeanDefinitionParser {
|
||||
gatewayConflictResolver, parserContext, cacheBuilder));
|
||||
}
|
||||
|
||||
parseDynamicRegionFactory(element, cacheBuilder);
|
||||
parseJndiBindings(element, cacheBuilder);
|
||||
}
|
||||
|
||||
@@ -173,56 +173,6 @@ class CacheParser extends AbstractSingleBeanDefinitionParser {
|
||||
return builder.getBeanDefinition();
|
||||
}
|
||||
|
||||
private void parseDynamicRegionFactory(Element element, BeanDefinitionBuilder cacheBuilder) {
|
||||
|
||||
Element dynamicRegionFactory =
|
||||
DomUtils.getChildElementByTagName(element, "dynamic-region-factory");
|
||||
|
||||
if (dynamicRegionFactory != null) {
|
||||
|
||||
BeanDefinitionBuilder dynamicRegionSupport = buildDynamicRegionSupport(dynamicRegionFactory);
|
||||
|
||||
postProcessDynamicRegionSupport(element, dynamicRegionSupport);
|
||||
cacheBuilder.addPropertyValue("dynamicRegionSupport", dynamicRegionSupport.getBeanDefinition());
|
||||
}
|
||||
}
|
||||
|
||||
private BeanDefinitionBuilder buildDynamicRegionSupport(Element dynamicRegionFactory) {
|
||||
|
||||
if (dynamicRegionFactory != null) {
|
||||
|
||||
BeanDefinitionBuilder dynamicRegionSupport =
|
||||
BeanDefinitionBuilder.genericBeanDefinition(CacheFactoryBean.DynamicRegionSupport.class);
|
||||
|
||||
String diskDirectory = dynamicRegionFactory.getAttribute("disk-dir");
|
||||
|
||||
if (StringUtils.hasText(diskDirectory)) {
|
||||
dynamicRegionSupport.addPropertyValue("diskDir", diskDirectory);
|
||||
}
|
||||
|
||||
String persistent = dynamicRegionFactory.getAttribute("persistent");
|
||||
|
||||
if (StringUtils.hasText(persistent)) {
|
||||
dynamicRegionSupport.addPropertyValue("persistent", persistent);
|
||||
}
|
||||
|
||||
String registerInterest = dynamicRegionFactory.getAttribute("register-interest");
|
||||
|
||||
if (StringUtils.hasText(registerInterest)) {
|
||||
dynamicRegionSupport.addPropertyValue("registerInterest", registerInterest);
|
||||
}
|
||||
|
||||
return dynamicRegionSupport;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dynamicRegionSupport {@link BeanDefinitionBuilder} for <gfe:dynamic-region-factory> element.
|
||||
*/
|
||||
protected void postProcessDynamicRegionSupport(Element element, BeanDefinitionBuilder dynamicRegionSupport) { }
|
||||
|
||||
private void parseJndiBindings(Element element, BeanDefinitionBuilder cacheBuilder) {
|
||||
|
||||
List<Element> jndiBindings = DomUtils.getChildElementsByTagName(element, "jndi-binding");
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.springframework.data.gemfire.client.ClientCacheFactoryBean;
|
||||
* @author David Turanski
|
||||
* @author Lyndon Adams
|
||||
* @author John Blum
|
||||
* @author Patrick Johnson
|
||||
* @see org.springframework.data.gemfire.client.ClientCacheFactoryBean
|
||||
* @see CacheParser
|
||||
*/
|
||||
@@ -56,12 +57,4 @@ class ClientCacheParser extends CacheParser {
|
||||
ParsingUtils.setPropertyValue(element, clientCacheBuilder, "pool-name");
|
||||
ParsingUtils.setPropertyValue(element, clientCacheBuilder, "ready-for-events");
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected void postProcessDynamicRegionSupport(Element element, BeanDefinitionBuilder dynamicRegionSupport) {
|
||||
ParsingUtils.setPropertyValue(element, dynamicRegionSupport, "pool-name");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,38 +89,6 @@ use inner bean declarations.
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="dynamic-region-factory" minOccurs="0" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Enables Dynamic Regions and specifies their configuration.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="disk-dir" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Specifies the directory path for disk persistence for dynamic regions.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="persistent" type="xsd:string"
|
||||
default="true">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Enables persistence for dynamic regions.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="register-interest" type="xsd:string"
|
||||
default="true">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Specifies whether dynamic regions register interest in all keys in a corresponding server region.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="jndi-binding" type="jndiBindingType" minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
|
||||
Reference in New Issue
Block a user