This file contains 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 chunkedresponses | |
import akka.actor.ActorRef | |
import akka.util.Timeout | |
import akka.pattern.ask | |
import play.api.libs.iteratee.{Done, Step, Input, Iteratee} | |
import spray.http.HttpData | |
import scala.concurrent.duration._ | |
This file contains 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
libraryDependencies ++= Seq("com.softwaremill.reactivekafka" %% "reactive-kafka-core" % "0.10.0") |
This file contains 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
libraryDependencies ++= Seq( | |
"org.apache.spark" %% "spark-core" % "1.6.1", | |
"org.apache.spark" %% "spark-streaming" % "1.6.1", | |
"org.apache.spark" %% "spark-streaming-kafka" % "1.6.1" | |
) |
This file contains 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
libraryDependencies ++= Seq("org.apache.kafka" % "kafka-clients" % "0.9.0.1") |
This file contains 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 akka.actor.ActorSystem | |
import akka.stream.ActorMaterializer | |
import akka.stream.scaladsl.Source | |
import com.softwaremill.react.kafka.{ConsumerProperties, ReactiveKafka} | |
import org.apache.kafka.common.serialization.StringDeserializer | |
import scala.concurrent.duration._ | |
implicit val system = ActorSystem() | |
implicit val materializer = ActorMaterializer() |
This file contains 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 kafka.serializer.StringDecoder | |
import org.apache.spark.streaming.kafka.KafkaUtils | |
import org.apache.spark.streaming.{Seconds, StreamingContext} | |
import org.apache.spark.{SparkConf, SparkContext} | |
val checkpointDir = "/tmp/sparkcheckpoints" | |
val sparkConfig = new SparkConf().setAppName("SparkDriver").setMaster("local[2]") | |
val sparkContext = new SparkContext(sparkConfig) |
This file contains 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 java.util.Properties | |
import org.apache.kafka.clients.consumer.KafkaConsumer | |
import collection.JavaConverters._ | |
val pollingTimeoutInMS = 100 | |
val props = new Properties() | |
props.put("bootstrap.servers", "localhost:9092") | |
props.put("group.id", "JavaConsumer") |
This file contains 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 succeeded(name: String) | |
def failed(name: String) |
This file contains 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 timed[T](name: String)(f: => T):T |
This file contains 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 measured(name: String, value: Long) |
NewerOlder