Skip to content

Commit

Permalink
Optimizer MXKVStoreUpdater bug fix in serializeState method (apache#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
satyakrishnagorti authored and vdantu committed Mar 31, 2019
1 parent 5b014c3 commit 5167cf8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
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://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

0 comments on commit 5167cf8

Please sign in to comment.