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 all commits
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
* [Zach Boldyga](https://github.com/zboldyga)
* [Gordon Reid](https://github.com/gordon1992)
* [Ming Yang](http:https://ufoym.com)
* [Satya Krishna Gorti](https://github.com/satyakrishnagorti)
* [Neo Chien](https://github.com/cchung100m)

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