Once a Region is created in Geode, say as a PARTITION
type, is it possible to change the type to something else, such as PARTITION_PERSISTENT
?
@juanramos is correct. You really only have the ability to alter (modify) a Region based on the configuration exposed in the AttributesMutator
interface (see Javadoc).
Programmatically, this would be acquired with:
AttributesMutator attributesMutator = region.getAttributesMutator();
// alter the Region using the AttributesMutator, such as by adding a new CacheListener
In fact this is exactly how the alter region
command in Gfsh was implemented (i.e. by using a Function
to distribute the operation of altering/modifying the Region using the Region's AttributesMutator
across the cluster of nodes hosting the Region).
So, as Juan described, you can:
DataPolicy
(e.g. PARTITION_PERSISTENT
)Of course, if you do not have any data, then you can simply destroy and recreate the Region as well.
Spring Boot for Apache Geode makes data handling (e.g. export and import) very simple to do, and can even be performed on an application restart (particularly during development time).