org.apache.spark.streaming.dstream

ConstantInputDStream

class ConstantInputDStream[T] extends InputDStream[T]

An input stream that always returns the same RDD on each timestep. Useful for testing.

Linear Supertypes
InputDStream[T], DStream[T], Logging, Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. ConstantInputDStream
  2. InputDStream
  3. DStream
  4. Logging
  5. Serializable
  6. Serializable
  7. AnyRef
  8. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ConstantInputDStream(ssc_: StreamingContext, rdd: RDD[T])(implicit arg0: ClassManifest[T])

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def addMetadata(metadata: Any): Unit

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. 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
  9. 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
  10. val checkpointData: DStreamCheckpointData[T]

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  11. var checkpointDuration: Duration

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  12. def clearOldMetadata(time: Time): Unit

    Clear metadata that are older than rememberDuration of this DStream.

    Clear metadata that are older than rememberDuration of this DStream. This is an internal method that should not be called directly. This default implementation clears the old generated RDDs. Subclasses of DStream may override this to clear their own metadata along with the generated RDDs.

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  13. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. def compute(validTime: Time): Option[RDD[T]]

    Method that generates a RDD for the given time

    Method that generates a RDD for the given time

    Definition Classes
    ConstantInputDStreamDStream
  15. def context: StreamingContext

    Return the StreamingContext associated with this DStream

    Return the StreamingContext associated with this DStream

    Definition Classes
    DStream
  16. 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
  17. def countByValue(numPartitions: Int = ssc.sc.defaultParallelism): 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 if numPartitions not specified).

    Definition Classes
    DStream
  18. def countByValueAndWindow(windowDuration: Duration, slideDuration: Duration, numPartitions: Int = ssc.sc.defaultParallelism): 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 if numPartitions 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
  19. 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
  20. def dependencies: List[Nothing]

    List of parent DStreams on which this DStream depends on

    List of parent DStreams on which this DStream depends on

    Definition Classes
    InputDStreamDStream
  21. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  22. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  23. 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
  24. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  25. def flatMap[U](flatMapFunc: (T) ⇒ Traversable[U])(implicit arg0: ClassManifest[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
  26. def foreach(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
  27. def foreach(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
  28. def generateJob(time: Time): Option[Job]

    Generate a SparkStreaming job for the given time.

    Generate a SparkStreaming job for the given time. This is an internal method that should not be called directly. This default implementation creates a job that materializes the corresponding RDD. Subclasses of DStream may override this to generate their own jobs.

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  29. var generatedRDDs: HashMap[Time, RDD[T]]

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  30. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  31. def getOrCompute(time: Time): Option[RDD[T]]

    Retrieve a precomputed RDD of this DStream, or computes the RDD.

    Retrieve a precomputed RDD of this DStream, or computes the RDD. This is an internal method that should not be called directly.

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  32. 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
  33. var graph: DStreamGraph

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  34. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  35. def initLogging(): Unit

    Attributes
    protected
    Definition Classes
    Logging
  36. def initialize(time: Time): Unit

    Initialize the DStream by setting the "zero" time, based on which the validity of future times is calculated.

    Initialize the DStream by setting the "zero" time, based on which the validity of future times is calculated. This method also recursively initializes its parent DStreams.

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  37. def isInitialized: Boolean

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  38. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  39. def isTimeValid(time: Time): Boolean

    Checks whether the 'time' is valid wrt slideDuration for generating RDD.

    Checks whether the 'time' is valid wrt slideDuration for generating RDD. Additionally it also ensures valid times are in strictly increasing order. This ensures that InputDStream.compute() is called strictly on increasing times.

    Attributes
    protected
    Definition Classes
    InputDStreamDStream
  40. def isTraceEnabled(): Boolean

    Attributes
    protected
    Definition Classes
    Logging
  41. var lastValidTime: Time

    Definition Classes
    InputDStream
  42. def log: Logger

    Attributes
    protected
    Definition Classes
    Logging
  43. def logDebug(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  44. def logDebug(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  45. def logError(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  46. def logError(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  47. def logInfo(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  48. def logInfo(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  49. def logTrace(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  50. def logTrace(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  51. def logWarning(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  52. def logWarning(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  53. def map[U](mapFunc: (T) ⇒ U)(implicit arg0: ClassManifest[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
  54. def mapPartitions[U](mapPartFunc: (Iterator[T]) ⇒ Iterator[U], preservePartitioning: Boolean)(implicit arg0: ClassManifest[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
  55. val mustCheckpoint: Boolean

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  56. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  57. final def notify(): Unit

    Definition Classes
    AnyRef
  58. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  59. def parentRememberDuration: Duration

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  60. 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
  61. 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
  62. 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
  63. 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
  64. 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 :

    1. 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 reduce function

    invReduceFunc

    inverse 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
  65. 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 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
  66. def register(): Unit

    Definition Classes
    DStream
  67. def remember(duration: Duration): Unit

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  68. var rememberDuration: Duration

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  69. 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
  70. def restoreCheckpointData(): Unit

    Restore the RDDs in generatedRDDs from the checkpointData.

    Restore the RDDs in generatedRDDs from the checkpointData. This is an internal method that should not be called directly. This is a default implementation that recreates RDDs from the checkpoint file names stored in checkpointData. Subclasses of DStream that override the updateCheckpointData() method would also need to override this method.

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  71. 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 and suffix: "prefix-TIME_IN_MS.suffix".

    Definition Classes
    DStream
  72. 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 and suffix: "prefix-TIME_IN_MS.suffix".

    Definition Classes
    DStream
  73. def setContext(s: StreamingContext): Unit

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  74. def setGraph(g: DStreamGraph): Unit

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  75. 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
  76. 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)

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  77. def slideDuration: Duration

    Time interval after which the DStream generates a RDD

    Time interval after which the DStream generates a RDD

    Definition Classes
    InputDStreamDStream
  78. var ssc: StreamingContext

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  79. def start(): Unit

    Method called to start receiving data.

    Method called to start receiving data. Subclasses must implement this method.

    Definition Classes
    ConstantInputDStreamInputDStream
  80. def stop(): Unit

    Method called to stop receiving data.

    Method called to stop receiving data. Subclasses must implement this method.

    Definition Classes
    ConstantInputDStreamInputDStream
  81. var storageLevel: StorageLevel

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  82. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  83. def toString(): String

    Definition Classes
    AnyRef → Any
  84. def transform[U](transformFunc: (RDD[T], Time) ⇒ RDD[U])(implicit arg0: ClassManifest[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
  85. def transform[U](transformFunc: (RDD[T]) ⇒ RDD[U])(implicit arg0: ClassManifest[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
  86. def transformWith[U, V](other: DStream[U], transformFunc: (RDD[T], RDD[U], Time) ⇒ RDD[V])(implicit arg0: ClassManifest[U], arg1: ClassManifest[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
  87. def transformWith[U, V](other: DStream[U], transformFunc: (RDD[T], RDD[U]) ⇒ RDD[V])(implicit arg0: ClassManifest[U], arg1: ClassManifest[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
  88. 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
  89. def updateCheckpointData(currentTime: Time): Unit

    Refresh the list of checkpointed RDDs that will be saved along with checkpoint of this stream.

    Refresh the list of checkpointed RDDs that will be saved along with checkpoint of this stream. This is an internal method that should not be called directly. This is a default implementation that saves only the file names of the checkpointed RDDs to checkpointData. Subclasses of DStream (especially those of InputDStream) may override this method to save custom checkpoint data.

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  90. def validate(): Unit

    Attributes
    protected[streaming]
    Definition Classes
    DStream
  91. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  92. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  93. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  94. 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
  95. 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
  96. var zeroTime: Time

    Attributes
    protected[streaming]
    Definition Classes
    DStream

Inherited from InputDStream[T]

Inherited from DStream[T]

Inherited from Logging

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any