LuciferYang commented on code in PR #46218:
URL: https://github.com/apache/spark/pull/46218#discussion_r1578972785
##########
mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:
##########
@@ -397,17 +398,12 @@ private[spark] object SummaryBuilderImpl extends Logging {
override def serialize(state: SummarizerBuffer): Array[Byte] = {
// TODO: Use ByteBuffer to optimize
- val bos = new ByteArrayOutputStream()
- val oos = new ObjectOutputStream(bos)
- oos.writeObject(state)
- bos.toByteArray
+ Utils.serialize(state)
}
override def deserialize(bytes: Array[Byte]): SummarizerBuffer = {
// TODO: Use ByteBuffer to optimize
- val bis = new ByteArrayInputStream(bytes)
- val ois = new ObjectInputStream(bis)
- ois.readObject().asInstanceOf[SummarizerBuffer]
+ Utils.deserialize(bytes)
Review Comment:
https://github.com/apache/spark/blob/08caa567fb29e762f3f7f9d94cd42c02f1e47247/common/utils/src/main/scala/org/apache/spark/util/SparkSerDeUtils.scala#L32-L36
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]