Class InputDStream<T>
Object
org.apache.spark.streaming.dstream.DStream<T>
org.apache.spark.streaming.dstream.InputDStream<T>
- All Implemented Interfaces:
Serializable,org.apache.spark.internal.Logging
- Direct Known Subclasses:
ConstantInputDStream,ReceiverInputDStream
This is the abstract base class for all input streams. This class provides methods
start() and stop() which are called by Spark Streaming system to start and stop
receiving data, respectively.
Input streams that can generate RDDs from new data by running a service/thread only on
the driver node (that is, without running a receiver on worker nodes), can be
implemented by directly inheriting this InputDStream. For example,
FileInputDStream, a subclass of InputDStream, monitors an HDFS directory from the driver for
new files and generates RDDs with the new files. For implementing input streams
that requires running a receiver on the worker nodes, use
ReceiverInputDStream as the parent class.
param: _ssc Streaming context that will execute this input stream
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.spark.internal.Logging
org.apache.spark.internal.Logging.LogStringContext, org.apache.spark.internal.Logging.SparkShellLoggingFilter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionscala.collection.immutable.List<DStream<?>>List of parent DStreams on which this DStream depends onintid()This is a unique identifier for the input stream.Time interval after which the DStream generates an RDDabstract voidstart()Method called to start receiving data.abstract voidstop()Method called to stop receiving data.Methods inherited from class org.apache.spark.streaming.dstream.DStream
cache, checkpoint, compute, context, count, countByValue, countByValueAndWindow, countByWindow, filter, flatMap, foreachRDD, foreachRDD, glom, map, mapPartitions, persist, persist, print, print, reduce, reduceByWindow, reduceByWindow, repartition, saveAsObjectFiles, saveAsTextFiles, slice, slice, toPairDStreamFunctions, transform, transform, transformWith, transformWith, union, window, windowMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.spark.internal.Logging
initializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, isTraceEnabled, log, logDebug, logDebug, logDebug, logDebug, logError, logError, logError, logError, logInfo, logInfo, logInfo, logInfo, logName, LogStringContext, logTrace, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, logWarning, org$apache$spark$internal$Logging$$log_, org$apache$spark$internal$Logging$$log__$eq, withLogContext
-
Constructor Details
-
InputDStream
-
-
Method Details
-
dependencies
Description copied from class:DStreamList of parent DStreams on which this DStream depends on- Specified by:
dependenciesin classDStream<T>
-
id
public int id()This is a unique identifier for the input stream. -
slideDuration
Description copied from class:DStreamTime interval after which the DStream generates an RDD- Specified by:
slideDurationin classDStream<T>
-
start
public abstract void start()Method called to start receiving data. Subclasses must implement this method. -
stop
public abstract void stop()Method called to stop receiving data. Subclasses must implement this method.
-