Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Optimizer MXKVStoreUpdater bug fix in serializeState method #14337

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ List of Contributors
* [Gordon Reid](https://github.com/gordon1992)

* [Ming Yang](http://ufoym.com)
* [Satya Krishna Gorti](https://github.com/satyakrishnagorti)

Label Bot
---------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,13 @@ object Optimizer {
val out = new ObjectOutputStream(bos)
out.writeInt(states.size)
states.foreach { case (k, v) =>
if (v != null) {
out.writeInt(k)
val stateBytes = optimizer.serializeState(v)
if (stateBytes == null) {
out.writeInt(0)
} else {
out.writeInt(stateBytes.length)
out.write(stateBytes)
}
out.writeInt(k)
val stateBytes = optimizer.serializeState(v)
if (stateBytes == null) {
out.writeInt(0)
} else {
out.writeInt(stateBytes.length)
out.write(stateBytes)
}
}
out.flush()
Expand Down