In this section, we will discuss the various APIs and operations exposed by Spark Streaming.
All Spark Streaming classes are packaged in the org.apache.spark.streaming.*
package. Spark Streaming defines two core classes which also provide access to all Spark Streaming functionality, such as StreamingContext.scala
and DStream.scala
.
Let's examine the following functions and roles performed by these classes:
org.apache.spark.streaming.StreamingContext
: This is an entry point to Spark Streaming functionality. It defines methods for creating the objects ofDStream.scala
and also for starting and stopping the Spark Streaming jobs.org.apache.spark.streaming.dstream.DStream.scala
: DStreams, or discretized streams, provide the basic abstraction for Spark Streaming. They provide the sequence of RDDs created from the live data for transforming the existing DStreams. This class defines the global operations that can be performed on all DStreams...