读spark源码时的一些scala语法

some scala grammar when I read the source code of spark

1、这里的=>是什么意思?

 import org.apache.spark.ml.recommendation.{ALS => NewALS}

2、函数前的'@'是什么意思?

  @DeveloperApi
    def setIntermediateRDDStorageLevel(storageLevel: StorageLevel): this.type = {
        require(storageLevel != StorageLevel.NONE,
          "ALS is not designed to run without persisting intermediate RDDs.")
        this.intermediateRDDStorageLevel = storageLevel
        this
    }

它是函数的装饰器吗?

ALS => NewALS - 它是导入的重命名。现在在代码中您可以使用 NewALS 而不是 ALS。如果您使用 类 具有相同的名称但来自不同的包,那么这种构造可能很有用。 ----来自@baju

@ -(在提供的示例中)用于使用注释进行标记。 @DeveloperApi - 表示您使用注释标记函数。如果你去 org.apache.spark.annotation.DeveloperApi 你会找到这个注释的定义。 ----来自@baju