Spark生态之Alluxio学习2---Spark从tachyon中读取文件
2016-05-04 22:46
465 查看
1.启动spark-shell
2.上传文件到tachyon:
3.读取:
2.上传文件到tachyon:
xubo@xubo:~/cloud/test/tachyon$ ../../tachyon-0.7.1/bin/tachyon tfs copyFromLocal 1.txt / Copied 1.txt to / xubo@xubo:~/cloud/test/tachyon$ ../../tachyon-0.7.1/bin/tachyon tfs cat /1.txt hello tachyon 1 2 3
3.读取:
scala> val text1= sc.textFile("tachyon://localhost:19998/1.txt") text1: org.apache.spark.rdd.RDD[String] = MapPartitionsRDD[1] at textFile at <console>:21 scala> text text1 text scala> text1.foreach foreach foreachPartition foreachWith scala> text1.foreach def foreach(f: T => Unit): Unit scala> text1.foreach(println) 1 hello tachyon 2 3
相关文章推荐
- 《java入门第一季》之面向对象(static关键字)
- 7.首次运行 - IntelliJ IDEA 使用教程
- 《java入门第一季》之面向对象(static关键字)
- WIN10 JAVA环境变量配置——几经辗转又重装了系统,分享一下Java环境变量的配置
- 修剪草坪
- 如何查看VS中预设的路径变量
- Win10系统开启Linux Bash命令行
- 一个新人对于DW标签的理解
- EF框架—Database-First
- SpringMVC3.2.x整合fastJson实现JSONP服务端
- 基于PCL拾取屏幕上三维点坐标
- zoj-3927-Programming Ability Test
- 缓存机制
- EF框架—Database-First
- HDU - 1060 Leftmost Digit (数学取对数)规律
- SpringMVC处理JSON数据
- 关于Linux的常忘命令积累
- 6.安装总结 - IntelliJ IDEA 使用教程
- 5.Mac 系统下安装 IntelliJ IDEA - IntelliJ IDEA 使用教程
- zoj-3693-Happy Great BG