Reputation: 277
When I read the source code of Spark, I see this in the RDD class:
def getStorageLevel = storageLevel
What does this statement mean?
Is it defining a variable? If yes, why we don't use var
instead?
Or is it a function? If yes, why they do not define the parameters and return values at the same time?
Upvotes: 1
Views: 124
Reputation: 369556
Is it defining a variable?
No. It's defining a method.
Or is it a function?
No. It's a method.
If yes, why they do not define the parameters and return values at the same time?
I don't understand the question. There are no parameters here, the method has zero parameter lists.
Upvotes: 1