anonymoustian
V2EX  ›  Hadoop

Spark 中的 transformations 的操作(如 map、filter)是不是不会一直执行?

  •  
  •   anonymoustian · Apr 24, 2016 · 3364 views
    This topic created in 3696 days ago, the information mentioned may be changed or developed.

    做项目时候发现程序的时间都用在了 count()、 collect()、 distinct() 这样的 action 操作上, 另外我查了一下它最初的设计论文:

    Resilient Distributed Datasets : A Fault-Tolerant Abstraction for In-Memory Cluster Computing 这篇文章,

    里面有写: RDDs do not need to be materialized at all times. Instead, an RDD has enough information about how it was derived form other datasets 。

    是不是说 如果不执行 action 操作,那么其实系统并不会 “真正地”将 RDD 进行转换, 而是记录下转换的顺序与方法, 在执行 action 操作时 会统一执行? 这样如果有了错误的数据产生, Spark 可以及时 重新生成正确的 RDD ,来保证容错性呢?

    因为涉及到 Spark 程序的设计,想请教一下大家,谢谢

    3 replies    2016-04-24 16:20:47 +08:00
    weikey
        1
    weikey  
       Apr 24, 2016
    是的
    sleeperqp
        2
    sleeperqp  
       Apr 24, 2016
    是 借鉴了惰性计算~
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2886 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 15:03 · PVG 23:03 · LAX 08:03 · JFK 11:03
    ♥ Do have faith in what you're doing.