上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 45 下一页
摘要: 由spark的源码源码的注释可以知道,spark可以读取本地数据文件,但是需要在所有的节点都有这个数据文件(亲测,在有三个节点的集群中,只在master中有这个数据文件时执行textFile方法一直报找不到文件, 在另外两个work中复制这个文件之后,就可以读取文件了) 阅读全文
posted @ 2017-08-09 14:26 牵牛花 阅读(14540) 评论(0) 推荐(0)
摘要: spark 1.5.1是支持直接读取gz格式的压缩包的,和普通文件没有什么区别: 使用spark-shell进入spark shell 交互界面: 输入命令: sc.textFile("\huawei\mr\20161120\880873\*.gz").foreach(println) 回车后是可以 阅读全文
posted @ 2017-08-09 11:24 牵牛花 阅读(2522) 评论(0) 推荐(0)
摘要: http://phoenix.apache.org/Phoenix-in-15-minutes-or-less.html Blah, blah, blah - I just want to get started!Ok, great! Just follow our install instruct 阅读全文
posted @ 2017-08-09 10:03 牵牛花 阅读(280) 评论(0) 推荐(0)
摘要: 脚本使用小结: 1.开启集群,start-hbase.sh 2.关闭集群,stop-hbase.sh 3.开启/关闭所有的regionserver、zookeeper,hbase-daemons.sh start/stop regionserver/zookeeper 4.开启/关闭单个region 阅读全文
posted @ 2017-08-09 09:08 牵牛花 阅读(517) 评论(0) 推荐(0)
摘要: https://stackoverflow.com/questions/38495331/apache-phoenix-unable-to-connect-to-hbase 这个坑不该啊 首选配置hbase 集群是按照官网配置的 配置phoenix 是按照官网上配置的,结果就是报错了,看了stock 阅读全文
posted @ 2017-08-09 01:21 牵牛花 阅读(5382) 评论(0) 推荐(0)
摘要: 首先实现rdd缓存 准备了500M的数据 10份,每份 100万条,存在hdfs 中通过sc.textFile方法读取 val rdd1 = sc.textFile("hdfs://mini1:9000/spark/input/visitlog").cache 在启动spark集群模式时分配内存2g 阅读全文
posted @ 2017-08-08 10:55 牵牛花 阅读(356) 评论(0) 推荐(0)
摘要: result: List(2, 4, a, b) List(2, 4, List(a, b)) flatMap就是在Map的基础上加了压平flatten的功能 foldLeft 从左边起折叠,累加 https://alvinalexander.com/scala/scala-reduceleft-e 阅读全文
posted @ 2017-08-07 23:05 牵牛花 阅读(552) 评论(0) 推荐(0)
摘要: package my.bigdata.scala08import scala.collection.mutableimport scala.collection.mutable.ArrayBufferimport scala.io.Source/** scala word count * Created by lq on 2017/8/7. */object Task2 { /** ... 阅读全文
posted @ 2017-08-07 22:36 牵牛花 阅读(302) 评论(0) 推荐(0)
摘要: val data2Mysql2 = (iterator: Iterator[(String, Int)]) => { var conn: Connection = null; var ps: PreparedStatement = null val sql = "Insert into location_info(location,counts,accesse_date)... 阅读全文
posted @ 2017-08-07 10:12 牵牛花 阅读(263) 评论(0) 推荐(0)
摘要: class NetworkUtilTest extends FunSuite with Matchers { test("testIp2Int") { val ip = NetworkUtil.ip2Int("192.168.120.60") ip should be(1014540480) }} org.scalatest ... 阅读全文
posted @ 2017-08-07 09:43 牵牛花 阅读(505) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 45 下一页