Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Fast Data Processing Systems with SMACK Stack

You're reading from  Fast Data Processing Systems with SMACK Stack

Product type Book
Published in Dec 2016
Publisher Packt
ISBN-13 9781786467201
Pages 376 pages
Edition 1st Edition
Languages
Author (1):
Raúl Estrada Raúl Estrada
Profile icon Raúl Estrada

Table of Contents (15) Chapters

Fast Data Processing Systems with SMACK Stack
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
An Introduction to SMACK The Model - Scala and Akka The Engine - Apache Spark The Storage - Apache Cassandra The Broker - Apache Kafka The Manager - Apache Mesos Study Case 1 - Spark and Cassandra Study Case 2 - Connectors Study Case 3 - Mesos and Docker

Akka and Spark


We start developing the Spark Streaming application by creating a SparkConf followed by a StreamingContext:

val conf = new SparkConf(false) 
  .setMaster("local[*]") 
  .setAppName("Spark Streaming with Akka") 
  .set("spark.logConf", "true") 
  .set("spark.driver.port", s"$driverPort") 
  .set("spark.driver.host", s"$driverHost") 
  .set("spark.akka.logLifecycleEvents", "true") 
val ssc = new StreamingContext(conf, Seconds(1)) 

This gives us a context to access the actor system that is of the type ReceiverInputDStream:

val actorName = "salutator" 
val actorStream: ReceiverInputDStream[String] = ssc.actorStream[String](Props[Salutator], actorName) 

Now that we have a DStream, let's define a high-level processing pipeline in Spark Streaming:

actorStream.print() 

In the preceding case, the print() method is going to print the first 10 elements of each RDD generated in this DStream. Nothing happens until start() is executed...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}