Spark 异步Action

异步不保序,但大作业执行时间后移。
.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.

posted @ 2018-12-08 17:14  澄轶  阅读(1256)  评论(0编辑  收藏  举报