Skip to content

Commit

Permalink
[hotfix][fs][gs] Update serializer version.
Browse files Browse the repository at this point in the history
The purpose of this change is to prevent serialization/deserialization problems
between the PR and the final merged versions, as the PR has been opened for a
long time and we noticed it already have many users before being merged.

This commit should change nothing for new users of the officially merged version.

See the following discussion for more details:
apache#15599 (comment)

This closes apache#18409
  • Loading branch information
xintongsong committed Jan 26, 2022
1 parent d1b6cf6 commit 19eb5f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class GSCommitRecoverableSerializer implements SimpleVersionedSerializer<GSCommi
LoggerFactory.getLogger(GSCommitRecoverableSerializer.class);

/** Current version of serializer. */
private static final int SERIALIZER_VERSION = 0;
private static final int SERIALIZER_VERSION = 1;

/** The one and only instance of the serializer. */
public static final GSCommitRecoverableSerializer INSTANCE =
Expand Down Expand Up @@ -133,7 +133,7 @@ static GSCommitRecoverable deserializeCommitRecoverable(DataInputStream dataInpu

@Override
public GSCommitRecoverable deserialize(int version, byte[] serialized) throws IOException {
Preconditions.checkArgument(version >= 0);
Preconditions.checkArgument(version > 0);
Preconditions.checkNotNull(serialized);

// ensure this serializer can deserialize data with this version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class GSResumeRecoverableSerializer implements SimpleVersionedSerializer<GSResum
LoggerFactory.getLogger(GSResumeRecoverableSerializer.class);

/** Current version of serializer. */
private static final int SERIALIZER_VERSION = 0;
private static final int SERIALIZER_VERSION = 1;

/** The one and only instance of the serializer. */
public static final GSResumeRecoverableSerializer INSTANCE =
Expand Down Expand Up @@ -83,7 +83,7 @@ public byte[] serialize(GSResumeRecoverable recoverable) throws IOException {

@Override
public GSResumeRecoverable deserialize(int version, byte[] serialized) throws IOException {
Preconditions.checkArgument(version >= 0);
Preconditions.checkArgument(version > 0);
Preconditions.checkNotNull(serialized);

// ensure this serializer can deserialize data with this version
Expand Down

0 comments on commit 19eb5f3

Please sign in to comment.