首页 > 其他 > 详细

Spark 异步Action

时间:2018-12-08 17:36:45      阅读:381      评论:0      收藏:0      [点我收藏+]

异步不保序,但大作业执行时间后移。
.set("spark.scheduler.mode", "FAIR")
公平调度,充分使用集群资源。

Spark Doc

def
collectAsync(): FutureAction[Seq[T]]
Returns a future for retrieving all elements of this RDD.

def
countAsync(): FutureAction[Long]
Returns a future for counting the number of elements in the RDD.

def
foreachAsync(f: (T) ? Unit): FutureAction[Unit]
Applies a function f to all elements of this RDD.

def
foreachPartitionAsync(f: (Iterator[T]) ? Unit): FutureAction[Unit]
Applies a function f to each partition of this RDD.

def
takeAsync(num: Int): FutureAction[Seq[T]]
Permalink
Returns a future for retrieving the first num elements of the RDD.

Spark 异步Action

原文:https://www.cnblogs.com/suanec/p/10088318.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!