Persisting PDX Metadata to Disk
GemFire allows you to persist PDX metadata to disk and specify the disk store to use.
- Understand generally how to configure the GemFire cache. See Basic Configuration and Programming.
- Understand how GemFire disk stores work. See Disk Storage.
- Set the
persistentto true in your cache configuration. This is required for caches that use PDX with persistent regions and with regions that use a gateway sender to distribute events across a WAN.. Otherwise, it is optional.
(Optional) If you want to use a disk store that is not the GemFire default disk store, set the
disk-store-nameto the name of your non-default disk store. Note: If you are using PDX serialized objects as region entry keys and you are using persistent regions, then you must configure your PDX disk store to be a different one than the disk store used by the persistent regions.
(Optional) If you later want to rename the PDX types that are persisted to disk, you can do so on your offline disk-stores by executing the
pdx renamecommand. See pdx rename.
cache.xml enables PDX persistence and sets a non-default disk store in a server cache configuration:
<pdx read-serialized="true" persistent="true" disk-store-name="SerializationDiskStore"> <pdx-serializer> <class-name>pdxSerialization.defaultSerializer</class-name> </pdx-serializer> </pdx> <region ...