-
Notifications
You must be signed in to change notification settings - Fork 38
Consider extending API to configure PARTITION Region attributes on PartitionRegionFactoryBean #566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Rename the CollocatedRegionIntegrationTests class to CollocatedRegionsXmlConfigurationIntegrationTests. Rename the associated XML context configuration file acccordingly. Rename test case method. Resolves spring-projectsgh-566.
… SDG Java config (PartitionedRegionFactoryBean). Resolves spring-projectsgh-566.
… SDG Java config (PartitionedRegionFactoryBean). Resolves spring-projectsgh-566.
To confirm the 3 different methods for the configuration of collocated Given SDG XML configuration is likely the easiest and arguably most familiar approach to configuring Apache Geode objects, and specifically collocated The test class can be seen here along with the XML configuration. The XML configuration approach for configuring collocated |
Next, I explored the use of Spring JavaConfig using the SDG API, and specifically the Again, these SDG API classes were intentionally designed to resemble the Apache Geode API as closely as possible, but to marry the corresponding Apache Geode classes (i.e. The test class can be seen here along with the corresponding Java configuration using the SDG API, here. It is necessary in this case due to the collocation between Anyway, this should be apparent from the test class and test configuration linked above. |
Finally, we explore the use of SDG's Annotation-based configuration model to create collocated The test class is here, the test configuration is here, and the application domain model classes (persistent entities) are here. There is a Both entity classes also defined Apache Geode additionally requires the number of redundant copies to match between collocated The configuration of these collocated Anyway, it should be apparent that the XML and Annotation-based approaches are the easiest and most concise. Annotation-based configuration is the most convenient as it is expressed in Java, close to your application code. While Spring does not have a strong preference, Annotation-config is recommended and encouraged since it can enable other Spring Boot auto-configuration capabilities. It is also easier to catch configuration errors earlier given the Annotation-config follows Java's strong typing system. At any rate, SDG has your approach covered. |
Uh oh!
There was an error while loading. Please reload this page.
It should be possible via the
o.s.data.gemfire.PartitionedRegionFactoryBean
API to directly configure or customizePARTITION
Region attributes, such as, but not limited to:PartitionResolvers
Essentially, any property or attribute exposed in the
org.apache.geode.cache.PartitionAttributes
API (Javadoc), or rather theorg.apache.geode.cache.PartitionAttributesFactory
API (Javadoc), should be configurable via the SDGPartitionedRegionFactoryBean
API (Javadoc).The Apache Geode API is a bit confusing in that the attributes specific to
PARTITION
Regions are still configured with generic Region attributes (i.e.RegionAttributes
) set on theRegionFactory
used when creating a Region, regardless if it is aPARTITION
Region or otherwise.For example, a developer using the Apache Geode API would need to use the peer
Cache
instance to create aRegionFactory
and then set the appropriate attributes when creating a Region of the desired type (e.g.PARTITION
).While the SDG XML namespace is quite convenient when configuring a
PARTITION
Region, using JavaConfig is less apparent in its approach given the SDG Java API (Javadoc) more closely aligns with the Apache Geode API (Javadoc).For example, in the SDG XML namespace, it is quite easy to collocate a
PARTITION
Region (B) with anotherPARTITION
Region (A) by doing the following:However, it is less apparent, perhaps, when using Spring JavaConfig and API (and specifically, the SDG
PartitionedRegionFactoryBean
class in JavaConfig), and especially SDG Annotations, such as@EnableEntityDefinedRegions
to say, collocate 2PARTITION
Regions, or even configure otherPARTITION
Region attributes (e.g.PartitionResolvers
).By way of example, using SDG Annotation a user would do the following in his/her Spring Boot, Spring Data Geode application:
Then, a package of [persistent] entities used by the application could be defined as:
The text was updated successfully, but these errors were encountered: