Reader small image

You're reading from  Big Data Analytics with Hadoop 3

Product typeBook
Published inMay 2018
PublisherPackt
ISBN-139781788628846
Edition1st Edition
Tools
Concepts
Right arrow
Author (1)
Sridhar Alla
Sridhar Alla
author image
Sridhar Alla

Sridhar?Alla?is the co-founder and CTO of Blue Whale Consulting and is expert at helping companies (big and small) define their vision for systems and capabilities that will allow them to establish a strategic execution plan to deal with the ever-growing data collected to support analytics and product teams. He has very experienced at dealing with all aspects of data collection, security, governance, and processing as part of end-to-end big data analytics and machine learning initiatives (including predictive modeling, deep learning, and ML automation). Sridhar?is a published book author and an avid presenter at numerous conferences, including Strata, Hadoop World, and Spark Summit.? He also has several patents filed with the US PTO on large-scale computing and distributed systems.? He has over 18 years' experience writing code in Scala, Java, C, C++, Python, R, and Go, and has extensive hands-on knowledge of Spark, Flink, TensorFlow, Keras, Hadoop, Cassandra, HBase, MongoDB, Riak, Redis, Zeppelin, Mesos, Docker, Kafka, ElasticSearch, Solr, H2O, machine learning, text analytics, distributed computing, and high-performance computing. Sridhar lives with his wife and daughter in New Jersey and in his spare time loves blogging and coaching organizations on next-generation advancements in technology and their alignment with business goals.
Read more about Sridhar Alla

Right arrow

Driver failure recovery


We can achieve driver failure recovery with the help of StreamingContext.getOrCreate(). As previously mentioned, this will either initialize a StreamingContext from a checkpoint that already exists, or create a new one. 

We will not implement a function called createStreamContext0, which creates a StreamingContext and sets up DStreams to interpret tweets and generate the top five most-used hashtags, using a window every 15 seconds. Instead of invoking createStreamContext() and then calling ssc.start(), we will invoke getOrCreate(), so that if a checkpoint exists, then the StreamingContext will be recreated from the data in the checkpoint Directory. If there is no such directory, or if the application is on its first run, then createStreamContext() will be invoked:

val ssc = StreamingContext.getOrCreate(checkpointDirectory,
createStreamContext _)

The following code shows how the function is defined, and how getOrCreate() can be invoked:

val checkpointDirectory = "checkpoints...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Big Data Analytics with Hadoop 3
Published in: May 2018Publisher: PacktISBN-13: 9781788628846

Author (1)

author image
Sridhar Alla

Sridhar?Alla?is the co-founder and CTO of Blue Whale Consulting and is expert at helping companies (big and small) define their vision for systems and capabilities that will allow them to establish a strategic execution plan to deal with the ever-growing data collected to support analytics and product teams. He has very experienced at dealing with all aspects of data collection, security, governance, and processing as part of end-to-end big data analytics and machine learning initiatives (including predictive modeling, deep learning, and ML automation). Sridhar?is a published book author and an avid presenter at numerous conferences, including Strata, Hadoop World, and Spark Summit.? He also has several patents filed with the US PTO on large-scale computing and distributed systems.? He has over 18 years' experience writing code in Scala, Java, C, C++, Python, R, and Go, and has extensive hands-on knowledge of Spark, Flink, TensorFlow, Keras, Hadoop, Cassandra, HBase, MongoDB, Riak, Redis, Zeppelin, Mesos, Docker, Kafka, ElasticSearch, Solr, H2O, machine learning, text analytics, distributed computing, and high-performance computing. Sridhar lives with his wife and daughter in New Jersey and in his spare time loves blogging and coaching organizations on next-generation advancements in technology and their alignment with business goals.
Read more about Sridhar Alla