Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当我阅读spark的源代码时,会看到一些scala语法_Scala_Apache Spark - Fatal编程技术网

当我阅读spark的源代码时,会看到一些scala语法

当我阅读spark的源代码时,会看到一些scala语法,scala,apache-spark,Scala,Apache Spark,1、 这里的=>是什么意思 import org.apache.spark.ml.recommendation.{ALS => NewALS} 2、 函数前面的“@”是什么意思 @DeveloperApi def setIntermediateRDDStorageLevel(storageLevel: StorageLevel): this.type = { require(storageLevel != StorageLevel.NONE,

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
    def setIntermediateRDDStorageLevel(storageLevel: StorageLevel): this.type = {
        require(storageLevel != StorageLevel.NONE,
          "ALS is not designed to run without persisting intermediate RDDs.")
        this.intermediateRDDStorageLevel = storageLevel
        this
    }

@-(在提供的示例中)用于使用注释进行标记@DeveloperApi-意味着用注释标记函数。如果您访问org.apache.spark.annotation.DeveloperApi,您将找到此注释的定义。---通过@baju

ALS=>NewALS
-它是导入的重命名。现在在代码中可以使用NewALS而不是ALS。如果您使用的类具有相同的名称,但来自不同的包,那么这种构造可能非常有用。非常感谢!您知道@是什么意思吗?@-(在提供的示例中)用于标记注释
@DeveloperApi
-表示用注释标记函数。如果您访问
org.apache.spark.annotation.DeveloperApi
,您将找到此注释的定义。您能将这些注释复制到答案中吗?:)