Re: Strategy for changing fields in a class serialized with PDX

2017-01-12 Thread Jared Stewart
> Sent: Thursday, January 12, 2017 10:52 AM > Subject: Strategy for changing fields in a class serialized with PDX > > Cluster configuration [1] is currently serialized with PDX and stored in an > internal region that is replicated on all Locators. I would like to change > the Con

Re: Strategy for changing fields in a class serialized with PDX

2017-01-12 Thread Hitesh Khamesra
rsday, January 12, 2017 10:52 AM Subject: Strategy for changing fields in a class serialized with PDX Cluster configuration [1] is currently serialized with PDX and stored in an internal region that is replicated on all Locators.  I would like to change the Configuration class from having

Re: Strategy for changing fields in a class serialized with PDX

2017-01-12 Thread Dan Smith
That Configuration class implements DataSerializable, not PdxSerializable. FYI the PdxReader does have a method to check if a field is present. The way to handle different versions of geode with DataSerializable is to use the versioning support described on this page - https://cwiki.apache.org/co

Re: Strategy for changing fields in a class serialized with PDX

2017-01-12 Thread Anilkumar Gingade
One more option would be, by taking advantage of PDX versioning support...The PDX mechanism can handle multiple versions of the same class, instead of modifying the existing field, you could add a new field with Map typeWhen new locator (with new pdx version) reads the old configuration, it con

Re: Strategy for changing fields in a class serialized with PDX

2017-01-12 Thread Anilkumar Gingade
Jared, I meant the server/product version number, if it was stored as part of the ClusterConfig definition in the pdx...If its not, we could think about adding one, which could help in the future to identify the version of the cluster configuration saved/created. -Anil. On Thu, Jan 12, 2017 at

Re: Strategy for changing fields in a class serialized with PDX

2017-01-12 Thread Jared Stewart
Anil - The class does have a serialVersionUID defined, if that’s the type of version number you mean. But the serialVersionUID is not explicitly written out by the toData() method of the class. Could you point me to any examples in the code of checking the version number on a PDX serialized ins

Re: Strategy for changing fields in a class serialized with PDX

2017-01-12 Thread Anilkumar Gingade
You can use version numbers, if its available... We use this mechanism in many cases, rolling upgrade(?), Server to client communication... -Anil. On Thu, Jan 12, 2017 at 10:52 AM, Jared Stewart wrote: > Cluster configuration [1] is currently serialized with PDX and stored in > an internal re

Strategy for changing fields in a class serialized with PDX

2017-01-12 Thread Jared Stewart
Cluster configuration [1] is currently serialized with PDX and stored in an internal region that is replicated on all Locators. I would like to change the Configuration class from having a Set jarNames to having a Map jarNamesToJarBytes. However, this would create a problem when a Locator runn