I'm new to scala and working with GraphX api. Here I'm trying to create Graph using below code snippet
val graph = Graph(verticesRDD, edgesRDD).cache()
Graph
is abstract class in org.apache.spark.graphx
package, since its a abstract class we can not have its constructor.
Above code snippet must be calling Graph
concrete class constructor. So In same abstract class, I found Graph
object under which I found apply
method and when I use like Graph.apply(verticesRDD, edgesRDD).cache()
, its produce same output like Graph(verticesRDD, edgesRDD).cache()
So my doubts are, How come apply
method in Graph object
is related to Graph
abstract class. I'm confused here, Can anyone help me to understand this ?
Which constructor of Graph
abstract class is being called here ? Is apply
method is being called as constructor or something else ?
Thanks
trying to understand