2014年9月15日

Scala系列:数组

摘要: 定长数组:val nums = new Array[Int](10)变长数组:val b = new ArrayBuffer[Int] 或 ArrayBuffer[Int]()b.+=1b.+= (2, 3, 4)b.++= Array(5, 6, 7, 8)b.trimEnd(3)b.insert... 阅读全文

posted @ 2014-09-15 09:24 宁 弘道 阅读(289) 评论(0) 推荐(0) 编辑

2014年9月14日

Scala系列:控制结构与函数

摘要: 在java语言中,表达式表示值,语句表示执行动作。 例如:表达式1+1表示值;thread.start()表示执行动作。所有语法结构都有值,那怕是不存在用Unit类型.if/else语句有值,为跟在if或else之后的表达式的值。例:val s = if(x > 0) 1 else 0; 等同于v... 阅读全文

posted @ 2014-09-14 23:08 宁 弘道 阅读(237) 评论(0) 推荐(0) 编辑

Scala系列:基本语法

摘要: 1、常量和变量val声明出来的为常量,不能再次赋值;可以省略类型,scala会自动推导。var声明出来的为变量,可以再次赋值;可以省略类型,scala会自动推导。var a = "xxx"; 等同于 var a : String = "xxx";a = "String 2";val b = 2;b ... 阅读全文

posted @ 2014-09-14 16:18 宁 弘道 阅读(396) 评论(0) 推荐(0) 编辑

Scala系列:安装与解释器

摘要: 1、安装JDK2、安装Scala到http://scala-lang.org/下载scala程序wgethttp://scala-lang.org/files/archive/scala-2.10.4.tgztar -zxvfscala-2.10.4.tgz -C /optln -s /opt/sc... 阅读全文

posted @ 2014-09-14 15:14 宁 弘道 阅读(641) 评论(0) 推荐(0) 编辑

2014年9月12日

Linux Shell:参数传递

摘要: $0-9$n$#$*$@ 阅读全文

posted @ 2014-09-12 13:59 宁 弘道 阅读(122) 评论(0) 推荐(0) 编辑

运维系列:08、Spark Shell

摘要: ./bin/spark-shell --master spark://MASTER:PORT启动集群模式:MASTER=spark://`hostname`:7077 bin/spark-shellbin/spark-shell --master spark://es122:7077单机模式:bin... 阅读全文

posted @ 2014-09-12 11:13 宁 弘道 阅读(352) 评论(0) 推荐(0) 编辑

开发系列:03、Spark Streaming Custom Receivers(译)

摘要: Spark Streaming can receive streaming data from any arbitrary data source beyond the one’s for which it has in-built support (that is, beyond Flume, K... 阅读全文

posted @ 2014-09-12 10:27 宁 弘道 阅读(607) 评论(0) 推荐(0) 编辑

运维系列:07、spark-submit

摘要: bin/spark-submit --helpUsage: spark-submit [options] [app options]Options:--master MASTER_URL spark://host:port, mesos://host:port, yarn, or local. -... 阅读全文

posted @ 2014-09-12 10:25 宁 弘道 阅读(422) 评论(0) 推荐(0) 编辑

开发系列:02、使用Scala和SBT开发Spark应用

摘要: 1、SBT添加插件.sbt/0.13/plugins/plugins.sbt 没用手工创建1 addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.5.0")2 3 addSbtPlugin("com.github.mp... 阅读全文

posted @ 2014-09-12 10:19 宁 弘道 阅读(344) 评论(0) 推荐(0) 编辑

开发系列:01、使用Java和Maven开发Spark应用

摘要: 1、POM.xml 1 3 4.0.0 4 5 org.hansight.spark 6 examples 7 0.0.1-SNAPSHOT 8 jar 9 10 examples 11 http://maven.apac... 阅读全文

posted @ 2014-09-12 10:18 宁 弘道 阅读(1989) 评论(0) 推荐(0) 编辑

导航