...
The cache-1.0.xsd
defines the permissible structure of the cluster config, currently represented in XML.
Developers can include their own cluster configuration elements in one of two places as defined in the cache-1.0.xsd
: at the cache level or at the region level.
These accept any XML element, so long as the namespace does not match Geode's (i.e., {{http://geode.apache.org/schema/cache}}).
Goals
- The API is intended to ONLY update the cluster or server-group's configuration saved by the locator(s). For example, when developer uses the api to add a region definition to the cache configuration, it should NOT be expected that the api will also create the regions for you on the existing servers.
- The API should not be tied with XML. We should be able to change how we save cluster configuration internally without changing the api.
- Expose a clean Java API for retrieval and modification of the cluster configuration
- Expose a clean Java API for retrieval and modification of the cluster configuration, as well as injection of elements into the cache and region levels of the cluster configuration.
- Do not require a developer to explicitly define methods to translate a configuration object to or from XML.
- Separate concerns of XML generation and function execution.
Approach
- Define a no-op interfaces
CacheElement
andRegionElement
to identify classes that may be saved to the cache and region XML entities, respectively. - Leverage JAXB to generate an initial set of configuration objects.
- Expose
ClusterConfigurationService
via the cache, provided a locator is managing that cache.
...
- Reduce duplication of effort by replacing "creation" classes (i.e.,
CacheCreation
,RegionCreation
,BindingCreation
, et al) with JAXB-generated classes. - Remove requirement of JAXB / XML annotations on configuration element classes.
- This api is meant to be used by commands that would modify the Cache configuration, e.g. create region, create gateway receiver etc. It's only available where these commands are executed. After this, we might expose another set of java API that would be available in other nodes like client or servers. That api would allow developer to create a region as well as modifying the cluster configuration at the same time.
Additional Concerns
Any exposure or modification of cluster configuration should immediately raise concerns for both security and concurrency.
...