Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portable versioning documentation #177

Merged

Conversation

yagmurdulger
Copy link
Contributor

This PR adds documentation for multiversion support of Portable Serialization in README inspired by the Reference Manual (with necessary changes for Python). It also improves the format of the headings and subheadings under Portable Serialization. It includes a versioning example for the Foo class as well.

@devOpsHazelcast
Copy link
Contributor

Can one of the admins verify this patch?

1 similar comment
@devOpsHazelcast
Copy link
Contributor

Can one of the admins verify this patch?

@mdumandag
Copy link
Contributor

verify

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
@yagmurdulger yagmurdulger force-pushed the portable-versioning-documentation branch from 5208e0a to e504285 Compare July 9, 2019 08:55
@mdumandag
Copy link
Contributor

verify

Copy link
Contributor

@Serdaro Serdaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed.

README.md Outdated
@@ -766,7 +767,7 @@ As an alternative to the existing serialization methods, Hazelcast offers portab

In order to support these features, a serialized `Portable` object contains meta information like the version and concrete location of the each field in the binary data. This way Hazelcast is able to navigate in the binary data and deserialize only the required field without actually deserializing the whole object which improves the query performance.

With multiversion support, you can have two members where each of them having different versions of the same object, and Hazelcast will store both meta information and use the correct one to serialize and deserialize portable objects depending on the member. This is very helpful when you are doing a rolling upgrade without shutting down the cluster.
With multiversion support, you can have two members that each have different versions of the same object, and Hazelcast will store both meta information and use the correct one to serialize and deserialize portable objects depending on the member. This is very helpful when you are doing a rolling upgrade without shutting down the cluster.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With multiversion support, you can have two members each having different versions of the same object; Hazelcast stores both meta information and uses the correct one to serialize and deserialize portable objects depending on the member. This is very helpful when you are doing a rolling upgrade without shutting down the cluster.

README.md Outdated

Portable serialization supports versioning. It is a global versioning, meaning that all portable classes that are serialized through a member get the globally configured portable version.

You can declare Version in the configuration file `hazelcast.xml` using the `portable-version` element, as shown below.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can declare the version in the hazelcast.xml configuration file using the ....

(I will improve this sentence also in the Hazelcast IMDG Reference Manual)

README.md Outdated

If you update the class by changing the type of one of the fields or by adding a new field, it is a good idea to upgrade the version of the class, rather than sticking to the global version specified in the `hazelcast.xml` file.

In Python Client, you can achieve this by simply adding the `get_class_version()` method to your class’s implementation of `Portable`, and setting the `CLASS_VERSION` to be different than the default global version.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Python client, you can ....

(Also, the two paragraphs above are connected, it is a good practice not to put a new line between them.)

README.md Outdated

In Python Client, you can achieve this by simply adding the `get_class_version()` method to your class’s implementation of `Portable`, and setting the `CLASS_VERSION` to be different than the default global version.

> Note: If your class that implements `Portable` doesn’t implement this method, its version is set by default to be the global version.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"> NOTE: If you do not use the get_class_version() method in your Portable implementation, it will have the global version, by default."

README.md Show resolved Hide resolved
README.md Outdated

You should consider the following when you perform versioning:
* It is important to change the version whenever an update is performed in the serialized fields of a class, for example by incrementing the version.
* If a client performs a Portable deserialization on a field and then that Portable is updated by removing that field on the cluster side, this may lead to a problem.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is the same content in the Hazelcast IMDG Reference Manual. However, for the sake of improving both documentation, could we give some examples:

"... , this may lead to problems such as ..."

@yagmurdulger yagmurdulger force-pushed the portable-versioning-documentation branch from 25430be to 2c4b9cd Compare July 10, 2019 13:05
Copy link
Contributor

@Serdaro Serdaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed.

README.md Outdated
@@ -766,7 +767,7 @@ As an alternative to the existing serialization methods, Hazelcast offers portab

In order to support these features, a serialized `Portable` object contains meta information like the version and concrete location of the each field in the binary data. This way Hazelcast is able to navigate in the binary data and deserialize only the required field without actually deserializing the whole object which improves the query performance.

With multiversion support, you can have two members where each of them having different versions of the same object, and Hazelcast will store both meta information and use the correct one to serialize and deserialize portable objects depending on the member. This is very helpful when you are doing a rolling upgrade without shutting down the cluster.
With multiversion support, you can have two members each having different versions of the same object; Hazelcast stores both meta information and use the correct one to serialize and deserialize portable objects depending on the member. This is very helpful when you are doing a rolling upgrade without shutting down the cluster.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... information and uses the ...

README.md Outdated
If you update the class by changing the type of one of the fields or by adding a new field, it is a good idea to upgrade the version of the class, rather than sticking to the global version specified in the `hazelcast.xml` file.
In the Python client, you can achieve this by simply adding the `get_class_version()` method to your class’s implementation of `Portable`, and setting the `CLASS_VERSION` to be different than the default global version.

> Note: If you do not use the `get_class_version()` method in your `Portable` implementation, it will have the global version, by default.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's stick with the standard "Note" admonition:

"> **NOTE: ........ **"

@mdumandag
Copy link
Contributor

verify

@mdumandag mdumandag merged commit ec810c4 into hazelcast:master Jul 12, 2019
@yagmurdulger yagmurdulger deleted the portable-versioning-documentation branch July 6, 2020 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants