This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.google.gson.Gson | |
| val json1 = """{ 'type' : 'new', 'name' : 'tim' }""" | |
| case class Message( | |
| private val `type`: String, | |
| private val name: String) { | |
| def getType() = `type` | |
| def getName() = name | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>be.icteam.demo</groupId> | |
| <artifactId>be.icteam.demo.core</artifactId> | |
| <version>1.0-SNAPSHOT</version> | |
| <name>${project.artifactId}</name> | |
| <description>My wonderfull scala app</description> | |
| <properties> | |
| <maven.compiler.source>1.6</maven.compiler.source> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mvn help:effective-pom | |
| mvn dependency:copy-dependencies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def run = | |
| loadCustomerAndCustomerIteractionRecords _ andThen | |
| determineCustomerIdsInCustomerButNotInCustomerInteraction andThen | |
| interactWithMissingCustomers andThen | |
| persistCustomerInteractions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <project> | |
| ... | |
| <build> | |
| <plugins> | |
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-jar-plugin</artifactId> | |
| <version>${maven-jar-plugin.version}</version> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project xmlns="http://maven.apache.org/POM/4.0.0" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <parent> | |
| <artifactId>mavendemo</artifactId> | |
| <groupId>be.icteam.mavendemo</groupId> | |
| <version>1.1-SNAPSHOT</version> | |
| </parent> | |
| <modelVersion>4.0.0</modelVersion> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package be.icteam.demo | |
| import org.joda.time.LocalDateTime | |
| import org.scalatest.FunSuite | |
| class LocalDateTimeIteratorSpecs extends FunSuite { | |
| test("iterating from one to localdatetime should be possible") { | |
| val from = new LocalDateTime(2016, 5, 29, 12, 0) | |
| val to = new LocalDateTime(2016, 5, 29, 14, 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package be.icteam.sandbox | |
| import java.net.URI | |
| import org.apache.hadoop.conf._ | |
| import org.apache.hadoop.fs._ | |
| object Program extends App { | |
| override def main(args: Array[String]) = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| case class RemoteIteratorWrapper[T](underlying: org.apache.hadoop.fs.RemoteIterator[T]) extends scala.collection.AbstractIterator[T] with scala.collection.Iterator[T] { | |
| def hasNext = underlying.hasNext | |
| def next() = underlying.next() | |
| } | |
| object Conversions { | |
| implicit def remoteIterator2ScalaIterator[T](underlying: org.apache.hadoop.fs.RemoteIterator[T]) : scala.collection.Iterator[T] = RemoteIteratorWrapper[T](underlying) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package be.icteam.demo | |
| import org.apache.spark._ | |
| object Program extends App { | |
| override def main(args: Array[String]) = { | |
| val sparkConf = new SparkConf(). | |
| setAppName("demo"). |