lundi 15 août 2016

Can not find usage of classTag variable defined in abstract class AtomicType in spark project

When I read spark source code, I found an abstract class AtomicType. It's defined like this:

protected[sql] abstract class AtomicType extends DataType {
  private[sql] type InternalType
  private[sql] val tag: TypeTag[InternalType]
  private[sql] val ordering: Ordering[InternalType]

  @transient private[sql] val classTag = ScalaReflectionLock.synchronized {
      val mirror = runtimeMirror(Utils.getSparkClassLoader)
      ClassTag[InternalType](mirror.runtimeClass(tag.tpe))
 }
}

I understand that classTag is used to get runtime type information of type member InternelType, but I can not find how this classTag is used in subclasses of AtomicType. And I also cannot find any reference to this variable in spark project.

Can anyone tell me how this classTag is used in spark project?





Aucun commentaire:

Enregistrer un commentaire