目录
Zeppelin、Spark 使用 Docker
- Download from apache/zeppelin - Docker Image
- Web based notebook style editor.
- Built-in Apache Spark support
下载 Neo4j Community
Scala
- scala.lang.org: A Scala Tutorial for Java Programmers
- 所有东西都是 Object (数字、符号、function)
- 没有 static
- Object => singleton class
- Unit => like void
- 定义 fuction 使用 "def"
- function 可以当参数传送
- Scala 之于 Java 类似 Typescript 之于 Javascript
- 可直接 import Java library
- "=>" 箭头符号
- 覆写 function 要加上 "override"
- // 以下内容尚不明白如何操作
- "Case Classes and Pattern Matching"
- 实体化时不需使用 "new"
- properties 自动建位 get set function
- default "hashCode", "equals"
- default "toString" => print "source form"
- "pattern matching"
- "type Environment = String => Int" => 定义 alias
- "trait"
- "Genericity" 泛型
Zeppelin notebook
- Zeppelin 0.10.0 预先安装了 Neo4j Interpreter
- docker pull apache/zeppelin 会有错误,加上 tag(0.10.0) 可正常下载
- Interpreter => 概念类似 Linux 的 Shell (ex: bash、csh、ksh)
- 使用方式:在notebook “%” + Interpreter 名称可进入该 Interpreter (ex: %neo4j 进入neo4j Interpreter)
- 设定:在notebook右上角的 “anonymouse” => "Interpreter" 可进入
- 设定 Neo4j Interpreter
- 下载 Neo4j Spark Connector
- Download Neo4j Connector for Apache Spark
- Copy 进入 Docker image 内,"docker cp xxx.jar server:/......"
- 设定Spark与Neo4j Connector
- 进入 Spark Interpreter Section
- 加入 Dependenices
- 测试 Neo4j Interpreter
- 启动 Neo4j
- 进入 notebook,"Notebook" => "spark1"
- 进入 neo4j Interpreter,输入 Cypher 语法
- 启动 Neo4j
- 测试 Spark => Neo4j
- 使用 Scala
- 在预设的 Interpreter 输入 Scale 语法