LuciferYang commented on code in PR #39487:
URL: https://github.com/apache/spark/pull/39487#discussion_r1067649883
##########
core/src/main/scala/org/apache/spark/status/protobuf/KVStoreProtobufSerializer.scala:
##########
@@ -40,10 +41,16 @@ private[spark] class KVStoreProtobufSerializer extends
KVStoreScalaSerializer {
private[spark] object KVStoreProtobufSerializer {
- private[this] lazy val serializerMap: Map[Class[_], ProtobufSerDe] =
- ServiceLoader.load(classOf[ProtobufSerDe])
- .asScala.map(serDe => serDe.supportClass -> serDe).toMap
+ private[this] lazy val serializerMap: Map[Class[_], ProtobufSerDe[Any]] = {
+ def getGenericsType(klass: Class[_]): Class[_] = {
+ klass.getGenericInterfaces.head.asInstanceOf[ParameterizedType]
+ .getActualTypeArguments.head.asInstanceOf[Class[_]]
Review Comment:
The result of
```
klass.getGenericInterfaces.head.asInstanceOf[ParameterizedType]
.getRawType.asInstanceOf[Class[_]]
```
is always `interface org.apache.spark.status.protobuf.ProtobufSerDe`, this
is not what we need(serializerMap key)
--
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]