Skip to content

Commit

Permalink
Write fields in alphabetical order when using GenericRecord and compa…
Browse files Browse the repository at this point in the history
…ct serialization for the same object [API-2215] (#1021)

* Added the warning about the write order of the fields for compact serialization when the GenericRecord is also used for the same object.

Also, added the missing deprecation notice to the `Creating New Portable Objects` section.
  • Loading branch information
ihsandemir authored Feb 19, 2024
1 parent 5e0acda commit 4d2b5d7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/modules/clusters/pages/accessing-domain-objects.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ With the introduction of `GenericRecord`, User Code Deployment should be used on

== Creating New Portable Objects

CAUTION:
.Deprecation Notice for Portable Serialization
====
Portable Serialization has been deprecated. We recommend you use Compact Serialization as Portable Serialization will be removed as of version 7.0.
====

To create a `GenericRecord` object in portable format, use the `GenericRecordBuilder.portable()` method:

[source,java]
Expand Down Expand Up @@ -74,6 +80,8 @@ GenericRecord namedRecord = GenericRecordBuilder.compact("employee")
Note that there is no need to create a class definition, or a schema in this case. A schema will be created
from the fields of the builder automatically.

WARNING: Data mismatches can occur if you use both generic and specific Compact serializers. For example, the Compact Generic Record serializer, which is included with Hazelcast, writes variable size fields in alphabetic order based on the field name. To avoid potential mismatches in your data, write explicit variable size fields for Compact serializers in alphabetic order.

== Adding and Changing Values in Domain Objects

We have also added two convenience methods in `GenericRecord` for you to
Expand Down

0 comments on commit 4d2b5d7

Please sign in to comment.