加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

美元符号在scala中做了什么?

发布时间:2020-12-16 19:08:44 所属栏目:安全 来源:网络整理
导读:当我阅读火花源代码 here时,我看到像$(a_variable)这样的代码. 这是什么意思? 我在这里复制代码: final val blockSize: IntParam = new IntParam(this,"blockSize","Block size for stacking input data in matrices. Data is stacked within partitions."
当我阅读火花源代码 here时,我看到像$(a_variable)这样的代码.
这是什么意思?

我在这里复制代码:

final val blockSize: IntParam = new IntParam(this,"blockSize","Block size for stacking input data in matrices. Data is stacked within partitions." +
      " If block size is more than remaining data in a partition then " +
      "it is adjusted to the size of this data. Recommended size is between 10 and 1000",ParamValidators.gt(0))

  /** @group getParam */
  final def getBlockSize: Int = $(blockSize)

解决方法

这不是特殊的Scala语法,它是一个方法名称.在Scala $是一个合法的标识符.该方法从org.apache.spark.ml.param.Param trait继承.

见source.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读