abstract class InputDStream[T] extends DStream[T]
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 org.apache.spark.streaming.dstream.ReceiverInputDStream as the parent class.
- Alphabetic
- By Inheritance
- InputDStream
- DStream
- Logging
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
InputDStream(_ssc: StreamingContext)(implicit arg0: ClassTag[T])
- _ssc
Streaming context that will execute this input stream
Abstract Value Members
-
abstract
def
compute(validTime: Time): Option[RDD[T]]
Method that generates an RDD for the given time
Method that generates an RDD for the given time
- Definition Classes
- DStream
-
abstract
def
start(): Unit
Method called to start receiving data.
Method called to start receiving data. Subclasses must implement this method.
-
abstract
def
stop(): Unit
Method called to stop receiving data.
Method called to stop receiving data. Subclasses must implement this method.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
val
baseScope: Option[String]
The base scope associated with the operation that created this DStream.
The base scope associated with the operation that created this DStream.
For InputDStreams, we use the name of this DStream as the scope name. If an outer scope is given, we assume that it includes an alternative name for this stream.
- Attributes
- protected[streaming]
- Definition Classes
- InputDStream → DStream
-
def
cache(): DStream[T]
Persist RDDs of this DStream with the default storage level (MEMORY_ONLY_SER)
Persist RDDs of this DStream with the default storage level (MEMORY_ONLY_SER)
- Definition Classes
- DStream
-
def
checkpoint(interval: Duration): DStream[T]
Enable periodic checkpointing of RDDs of this DStream
Enable periodic checkpointing of RDDs of this DStream
- interval
Time interval after which generated RDD will be checkpointed
- Definition Classes
- DStream
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
context: StreamingContext
Return the StreamingContext associated with this DStream
Return the StreamingContext associated with this DStream
- Definition Classes
- DStream
-
def
count(): DStream[Long]
Return a new DStream in which each RDD has a single element generated by counting each RDD of this DStream.
Return a new DStream in which each RDD has a single element generated by counting each RDD of this DStream.
- Definition Classes
- DStream
-
def
countByValue(numPartitions: Int = ssc.sc.defaultParallelism)(implicit ord: Ordering[T] = null): DStream[(T, Long)]
Return a new DStream in which each RDD contains the counts of each distinct value in each RDD of this DStream.
Return a new DStream in which each RDD contains the counts of each distinct value in each RDD of this DStream. Hash partitioning is used to generate the RDDs with
numPartitions
partitions (Spark's default number of partitions ifnumPartitions
not specified).- Definition Classes
- DStream
-
def
countByValueAndWindow(windowDuration: Duration, slideDuration: Duration, numPartitions: Int = ssc.sc.defaultParallelism)(implicit ord: Ordering[T] = null): DStream[(T, Long)]
Return a new DStream in which each RDD contains the count of distinct elements in RDDs in a sliding window over this DStream.
Return a new DStream in which each RDD contains the count of distinct elements in RDDs in a sliding window over this DStream. Hash partitioning is used to generate the RDDs with
numPartitions
partitions (Spark's default number of partitions ifnumPartitions
not specified).- windowDuration
width of the window; must be a multiple of this DStream's batching interval
- slideDuration
sliding interval of the window (i.e., the interval after which the new DStream will generate RDDs); must be a multiple of this DStream's batching interval
- numPartitions
number of partitions of each RDD in the new DStream.
- Definition Classes
- DStream
-
def
countByWindow(windowDuration: Duration, slideDuration: Duration): DStream[Long]
Return a new DStream in which each RDD has a single element generated by counting the number of elements in a sliding window over this DStream.
Return a new DStream in which each RDD has a single element generated by counting the number of elements in a sliding window over this DStream. Hash partitioning is used to generate the RDDs with Spark's default number of partitions.
- windowDuration
width of the window; must be a multiple of this DStream's batching interval
- slideDuration
sliding interval of the window (i.e., the interval after which the new DStream will generate RDDs); must be a multiple of this DStream's batching interval
- Definition Classes
- DStream
-
def
createRDDWithLocalProperties[U](time: Time, displayInnerRDDOps: Boolean)(body: ⇒ U): U
Wrap a body of code such that the call site and operation scope information are passed to the RDDs created in this body properly.
Wrap a body of code such that the call site and operation scope information are passed to the RDDs created in this body properly.
- time
Current batch time that should be embedded in the scope names
- displayInnerRDDOps
Whether the detailed callsites and scopes of the inner RDDs generated by
body
will be displayed in the UI; only the scope and callsite of the DStream operation that generatedthis
will be displayed.- body
RDD creation code to execute with certain local properties.
-
def
dependencies: List[DStream[_]]
List of parent DStreams on which this DStream depends on
List of parent DStreams on which this DStream depends on
- Definition Classes
- InputDStream → DStream
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
filter(filterFunc: (T) ⇒ Boolean): DStream[T]
Return a new DStream containing only the elements that satisfy a predicate.
Return a new DStream containing only the elements that satisfy a predicate.
- Definition Classes
- DStream
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flatMap[U](flatMapFunc: (T) ⇒ TraversableOnce[U])(implicit arg0: ClassTag[U]): DStream[U]
Return a new DStream by applying a function to all elements of this DStream, and then flattening the results
Return a new DStream by applying a function to all elements of this DStream, and then flattening the results
- Definition Classes
- DStream
-
def
foreachRDD(foreachFunc: (RDD[T], Time) ⇒ Unit): Unit
Apply a function to each RDD in this DStream.
Apply a function to each RDD in this DStream. This is an output operator, so 'this' DStream will be registered as an output stream and therefore materialized.
- Definition Classes
- DStream
-
def
foreachRDD(foreachFunc: (RDD[T]) ⇒ Unit): Unit
Apply a function to each RDD in this DStream.
Apply a function to each RDD in this DStream. This is an output operator, so 'this' DStream will be registered as an output stream and therefore materialized.
- Definition Classes
- DStream
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
glom(): DStream[Array[T]]
Return a new DStream in which each RDD is generated by applying glom() to each RDD of this DStream.
Return a new DStream in which each RDD is generated by applying glom() to each RDD of this DStream. Applying glom() to an RDD coalesces all elements within each partition into an array.
- Definition Classes
- DStream
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
val
id: Int
This is a unique identifier for the input stream.
-
def
initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
- Attributes
- protected
- Definition Classes
- Logging
-
def
initializeLogIfNecessary(isInterpreter: Boolean): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isTraceEnabled(): Boolean
- Attributes
- protected
- Definition Classes
- Logging
-
def
log: Logger
- Attributes
- protected
- Definition Classes
- Logging
-
def
logDebug(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logDebug(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logError(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logError(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logInfo(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logInfo(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logName: String
- Attributes
- protected
- Definition Classes
- Logging
-
def
logTrace(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logTrace(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logWarning(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logWarning(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
map[U](mapFunc: (T) ⇒ U)(implicit arg0: ClassTag[U]): DStream[U]
Return a new DStream by applying a function to all elements of this DStream.
Return a new DStream by applying a function to all elements of this DStream.
- Definition Classes
- DStream
-
def
mapPartitions[U](mapPartFunc: (Iterator[T]) ⇒ Iterator[U], preservePartitioning: Boolean = false)(implicit arg0: ClassTag[U]): DStream[U]
Return a new DStream in which each RDD is generated by applying mapPartitions() to each RDDs of this DStream.
Return a new DStream in which each RDD is generated by applying mapPartitions() to each RDDs of this DStream. Applying mapPartitions() to an RDD applies a function to each partition of the RDD.
- Definition Classes
- DStream
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
persist(): DStream[T]
Persist RDDs of this DStream with the default storage level (MEMORY_ONLY_SER)
Persist RDDs of this DStream with the default storage level (MEMORY_ONLY_SER)
- Definition Classes
- DStream
-
def
persist(level: StorageLevel): DStream[T]
Persist the RDDs of this DStream with the given storage level
Persist the RDDs of this DStream with the given storage level
- Definition Classes
- DStream
-
def
print(num: Int): Unit
Print the first num elements of each RDD generated in this DStream.
Print the first num elements of each RDD generated in this DStream. This is an output operator, so this DStream will be registered as an output stream and there materialized.
- Definition Classes
- DStream
-
def
print(): Unit
Print the first ten elements of each RDD generated in this DStream.
Print the first ten elements of each RDD generated in this DStream. This is an output operator, so this DStream will be registered as an output stream and there materialized.
- Definition Classes
- DStream
-
val
rateController: Option[RateController]
- Attributes
- protected[streaming]
-
def
reduce(reduceFunc: (T, T) ⇒ T): DStream[T]
Return a new DStream in which each RDD has a single element generated by reducing each RDD of this DStream.
Return a new DStream in which each RDD has a single element generated by reducing each RDD of this DStream.
- Definition Classes
- DStream
-
def
reduceByWindow(reduceFunc: (T, T) ⇒ T, invReduceFunc: (T, T) ⇒ T, windowDuration: Duration, slideDuration: Duration): DStream[T]
Return a new DStream in which each RDD has a single element generated by reducing all elements in a sliding window over this DStream.
Return a new DStream in which each RDD has a single element generated by reducing all elements in a sliding window over this DStream. However, the reduction is done incrementally using the old window's reduced value :
- reduce the new values that entered the window (e.g., adding new counts) 2. "inverse reduce" the old values that left the window (e.g., subtracting old counts) This is more efficient than reduceByWindow without "inverse reduce" function. However, it is applicable to only "invertible reduce functions".
- reduceFunc
associative and commutative reduce function
- invReduceFunc
inverse reduce function; such that for all y, invertible x:
invReduceFunc(reduceFunc(x, y), x) = y
- windowDuration
width of the window; must be a multiple of this DStream's batching interval
- slideDuration
sliding interval of the window (i.e., the interval after which the new DStream will generate RDDs); must be a multiple of this DStream's batching interval
- Definition Classes
- DStream
-
def
reduceByWindow(reduceFunc: (T, T) ⇒ T, windowDuration: Duration, slideDuration: Duration): DStream[T]
Return a new DStream in which each RDD has a single element generated by reducing all elements in a sliding window over this DStream.
Return a new DStream in which each RDD has a single element generated by reducing all elements in a sliding window over this DStream.
- reduceFunc
associative and commutative reduce function
- windowDuration
width of the window; must be a multiple of this DStream's batching interval
- slideDuration
sliding interval of the window (i.e., the interval after which the new DStream will generate RDDs); must be a multiple of this DStream's batching interval
- Definition Classes
- DStream
-
def
repartition(numPartitions: Int): DStream[T]
Return a new DStream with an increased or decreased level of parallelism.
Return a new DStream with an increased or decreased level of parallelism. Each RDD in the returned DStream has exactly numPartitions partitions.
- Definition Classes
- DStream
-
def
saveAsObjectFiles(prefix: String, suffix: String = ""): Unit
Save each RDD in this DStream as a Sequence file of serialized objects.
Save each RDD in this DStream as a Sequence file of serialized objects. The file name at each batch interval is generated based on
prefix
andsuffix
: "prefix-TIME_IN_MS.suffix".- Definition Classes
- DStream
-
def
saveAsTextFiles(prefix: String, suffix: String = ""): Unit
Save each RDD in this DStream as at text file, using string representation of elements.
Save each RDD in this DStream as at text file, using string representation of elements. The file name at each batch interval is generated based on
prefix
andsuffix
: "prefix-TIME_IN_MS.suffix".- Definition Classes
- DStream
-
def
slice(fromTime: Time, toTime: Time): Seq[RDD[T]]
Return all the RDDs between 'fromTime' to 'toTime' (both included)
Return all the RDDs between 'fromTime' to 'toTime' (both included)
- Definition Classes
- DStream
-
def
slice(interval: Interval): Seq[RDD[T]]
Return all the RDDs defined by the Interval object (both end times included)
Return all the RDDs defined by the Interval object (both end times included)
- Definition Classes
- DStream
-
def
slideDuration: Duration
Time interval after which the DStream generates an RDD
Time interval after which the DStream generates an RDD
- Definition Classes
- InputDStream → DStream
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
transform[U](transformFunc: (RDD[T], Time) ⇒ RDD[U])(implicit arg0: ClassTag[U]): DStream[U]
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.
- Definition Classes
- DStream
-
def
transform[U](transformFunc: (RDD[T]) ⇒ RDD[U])(implicit arg0: ClassTag[U]): DStream[U]
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.
- Definition Classes
- DStream
-
def
transformWith[U, V](other: DStream[U], transformFunc: (RDD[T], RDD[U], Time) ⇒ RDD[V])(implicit arg0: ClassTag[U], arg1: ClassTag[V]): DStream[V]
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.
- Definition Classes
- DStream
-
def
transformWith[U, V](other: DStream[U], transformFunc: (RDD[T], RDD[U]) ⇒ RDD[V])(implicit arg0: ClassTag[U], arg1: ClassTag[V]): DStream[V]
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.
- Definition Classes
- DStream
-
def
union(that: DStream[T]): DStream[T]
Return a new DStream by unifying data of another DStream with this DStream.
Return a new DStream by unifying data of another DStream with this DStream.
- that
Another DStream having the same slideDuration as this DStream.
- Definition Classes
- DStream
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
window(windowDuration: Duration, slideDuration: Duration): DStream[T]
Return a new DStream in which each RDD contains all the elements in seen in a sliding window of time over this DStream.
Return a new DStream in which each RDD contains all the elements in seen in a sliding window of time over this DStream.
- windowDuration
width of the window; must be a multiple of this DStream's batching interval
- slideDuration
sliding interval of the window (i.e., the interval after which the new DStream will generate RDDs); must be a multiple of this DStream's batching interval
- Definition Classes
- DStream
-
def
window(windowDuration: Duration): DStream[T]
Return a new DStream in which each RDD contains all the elements in seen in a sliding window of time over this DStream.
Return a new DStream in which each RDD contains all the elements in seen in a sliding window of time over this DStream. The new DStream generates RDDs with the same interval as this DStream.
- windowDuration
width of the window; must be a multiple of this DStream's interval.
- Definition Classes
- DStream