Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning Hadoop 2

You're reading from  Learning Hadoop 2

Product type Book
Published in Feb 2015
Publisher Packt
ISBN-13 9781783285518
Pages 382 pages
Edition 1st Edition
Languages

Table of Contents (18) Chapters

Learning Hadoop 2
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Introduction Storage Processing – MapReduce and Beyond Real-time Computation with Samza Iterative Computation with Spark Data Analysis with Apache Pig Hadoop and SQL Data Lifecycle Management Making Development Easier Running a Hadoop Cluster Where to Go Next Index

Processing data with Apache Spark


In this section, we will implement the examples from Chapter 3, Processing – MapReduce and Beyond, using the Scala API. We will consider both the batch and real-time processing scenarios. We will show you how Spark Streaming can be used to compute statistics on the live Twitter stream.

Building and running the examples

Scala source code for the examples can be found at https://github.com/learninghadoop2/book-examples/tree/master/ch5. We will be using sbt to build, manage, and execute code.

The build.sbt file controls the codebase metadata and software dependencies; these include the version of the Scala interpreter that Spark links to, a link to the Akka package repository used to resolve implicit dependencies, as well as dependencies on Spark and Hadoop libraries.

The source code for all examples can be compiled with:

$ sbt compile

Or, it can be packaged into a JAR file with:

$ sbt package

A helper script to execute compiled classes can be generated with:

...
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}