import org.apache.spark.storage.StorageLevel._; val fileRDD = sc.textFile("/tests/yahoo_stocks.csv"); fileRDD.persist(MEMORY_ONLY); System.out.println("Count of RDD (first run): "+fileRDD.count()); System.out.println("Count of RDD (second run): "+fileRDD.count());
park-shell -i test14.scala
第一次
18/02/17 22:21:10 INFO DAGScheduler: Job 0 finished: count at <console>:33, took 1,425495 s Count of RDD (first run): 4794
18/02/17 22:21:11 INFO DAGScheduler: Job 1 finished: count at <console>:33, took 0,121783 s Count of RDD (second run): 4794
猜你喜欢
本站原创《复杂软件设计之道:领域驱动设计全面解析与实战》
其他人在看