Class

org.apache.spark.sql.streaming

SchemaDStream

Related Doc: package streaming

Permalink

class SchemaDStream extends DStream[Row]

A SQL based DStream with support for schema/Product This class offers the ability to manipulate SQL query on DStreams It is similar to SchemaRDD, which offers the similar functions Internally, RDD of each batch duration is treated as a small table and CQs are evaluated on those small tables Some of the abstraction and code is borrowed from the project: https://github.com/Intel-bigdata/spark-streamingsql

Linear Supertypes
DStream[Row], internal.Logging, Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SchemaDStream
  2. DStream
  3. Logging
  4. Serializable
  5. Serializable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SchemaDStream(ssc: SnappyStreamingContext, logicalPlan: LogicalPlan)

    Permalink
  2. new SchemaDStream(snsc: SnappyStreamingContext, queryExecution: QueryExecution)

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. val baseScope: Option[String]

    Permalink

    The base scope associated with the operation that created this DStream.

    The base scope associated with the operation that created this DStream.

    This is the medium through which we pass the DStream operation name (e.g. updatedStateByKey) to the RDDs created by this DStream. Note that we never use this scope directly in RDDs. Instead, we instantiate a new scope during each call to compute based on this one.

    This is not defined if the DStream is created outside of one of the public DStream operations.

    Attributes
    protected[org.apache.spark.streaming]
    Definition Classes
    DStream
  6. def cache(): SchemaDStream

    Permalink

    Persist RDDs of this SchemaDStream with the default storage level (MEMORY_ONLY_SER)

    Persist RDDs of this SchemaDStream with the default storage level (MEMORY_ONLY_SER)

    Definition Classes
    SchemaDStreamDStream
  7. def checkpoint(interval: Duration): SchemaDStream

    Permalink

    Enable periodic checkpointing of RDDs of this SchemaDStream

    Enable periodic checkpointing of RDDs of this SchemaDStream

    interval

    Time interval after which generated RDD will be checkpointed

    Definition Classes
    SchemaDStreamDStream
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def columns: Array[String]

    Permalink

    Returns all column names as an array.

  10. def compute(validTime: Time): Option[RDD[Row]]

    Permalink

    Method that generates a RDD for the given time

    Method that generates a RDD for the given time

    Definition Classes
    SchemaDStreamDStream
  11. def context: StreamingContext

    Permalink

    Return the StreamingContext associated with this DStream

    Return the StreamingContext associated with this DStream

    Definition Classes
    DStream
  12. def count(): DStream[Long]

    Permalink

    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
  13. def countByValue(numPartitions: Int = ssc.sc.defaultParallelism)(implicit ord: Ordering[Row] = null): DStream[(Row, Long)]

    Permalink

    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
  14. def countByValueAndWindow(windowDuration: Duration, slideDuration: Duration, numPartitions: Int = ssc.sc.defaultParallelism)(implicit ord: Ordering[Row] = null): DStream[(Row, Long)]

    Permalink

    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
  15. def countByWindow(windowDuration: Duration, slideDuration: Duration): DStream[Long]

    Permalink

    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
  16. def createRDDWithLocalProperties[U](time: Time, displayInnerRDDOps: Boolean)(body: ⇒ U): U

    Permalink

    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 generated this will be displayed.

    body

    RDD creation code to execute with certain local properties.

    Attributes
    protected[org.apache.spark.streaming]
    Definition Classes
    DStream
  17. def dependencies: List[DStream[InternalRow]]

    Permalink

    List of parent DStreams on which this SchemaDStream depends on

    List of parent DStreams on which this SchemaDStream depends on

    Definition Classes
    SchemaDStreamDStream
  18. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  20. def filter(filterFunc: (Row) ⇒ Boolean): SchemaDStream

    Permalink

    Return a new SchemaDStream containing only the elements that satisfy a predicate.

    Return a new SchemaDStream containing only the elements that satisfy a predicate.

    Definition Classes
    SchemaDStreamDStream
  21. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. def flatMap[U](flatMapFunc: (Row) ⇒ TraversableOnce[U])(implicit arg0: ClassTag[U]): DStream[U]

    Permalink

    Return a new DStream by applying a function to all elements of this SchemaDStream, and then flattening the results

    Return a new DStream by applying a function to all elements of this SchemaDStream, and then flattening the results

    Definition Classes
    SchemaDStreamDStream
  23. def foreachDataFrame(foreachFunc: (DataFrame, Time) ⇒ Unit, needsConversion: Boolean): Unit

    Permalink

    Apply a function to each DataFrame in this SchemaDStream.

    Apply a function to each DataFrame in this SchemaDStream. This is an output operator, so 'this' SchemaDStream will be registered as an output stream and therefore materialized.

  24. def foreachDataFrame(foreachFunc: (DataFrame, Time) ⇒ Unit): Unit

    Permalink

    Apply a function to each DataFrame in this SchemaDStream.

    Apply a function to each DataFrame in this SchemaDStream. This is an output operator, so 'this' SchemaDStream will be registered as an output stream and therefore materialized.

  25. def foreachDataFrame(foreachFunc: VoidFunction2[DataFrame, Time]): Unit

    Permalink

    Apply a function to each DataFrame in this SchemaDStream.

    Apply a function to each DataFrame in this SchemaDStream. This is an output operator, so 'this' SchemaDStream will be registered as an output stream and therefore materialized.

  26. def foreachDataFrame(foreachFunc: VoidFunction[DataFrame], needsConversion: Boolean): Unit

    Permalink

    Apply a function to each DataFrame in this SchemaDStream.

    Apply a function to each DataFrame in this SchemaDStream. This is an output operator, so 'this' SchemaDStream will be registered as an output stream and therefore materialized.

  27. def foreachDataFrame(foreachFunc: VoidFunction[DataFrame]): Unit

    Permalink

    Apply a function to each DataFrame in this SchemaDStream.

    Apply a function to each DataFrame in this SchemaDStream. This is an output operator, so 'this' SchemaDStream will be registered as an output stream and therefore materialized.

  28. def foreachDataFrame(foreachFunc: (DataFrame) ⇒ Unit, needsConversion: Boolean): Unit

    Permalink

    Apply a function to each DataFrame in this SchemaDStream.

    Apply a function to each DataFrame in this SchemaDStream. This is an output operator, so 'this' SchemaDStream will be registered as an output stream and therefore materialized.

  29. def foreachDataFrame(foreachFunc: (DataFrame) ⇒ Unit): Unit

    Permalink

    Apply a function to each DataFrame in this SchemaDStream.

    Apply a function to each DataFrame in this SchemaDStream. This is an output operator, so 'this' SchemaDStream will be registered as an output stream and therefore materialized.

  30. def foreachRDD(foreachFunc: (RDD[Row], Time) ⇒ Unit): Unit

    Permalink

    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
  31. def foreachRDD(foreachFunc: (RDD[Row]) ⇒ Unit): Unit

    Permalink

    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
  32. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  33. def glom(): DStream[Array[Row]]

    Permalink

    Return a new DStream in which each RDD is generated by applying glom() to each RDD of this SchemaDStream.

    Return a new DStream in which each RDD is generated by applying glom() to each RDD of this SchemaDStream. Applying glom() to an RDD coalesces all elements within each partition into an array.

    Definition Classes
    SchemaDStreamDStream
  34. def hashCode(): Int

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

    Permalink
    Definition Classes
    DStream
  36. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean = false): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  37. def initializeLogIfNecessary(isInterpreter: Boolean): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  38. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  39. def isTraceEnabled(): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  40. def log: Logger

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

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

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

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

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

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

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  47. def logName: String

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

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

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

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

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  52. val logicalPlan: LogicalPlan

    Permalink
  53. def map[U](mapFunc: (Row) ⇒ U)(implicit arg0: ClassTag[U]): DStream[U]

    Permalink

    Return a new DStream by applying a function to all elements of this SchemaDStream.

    Return a new DStream by applying a function to all elements of this SchemaDStream.

    Definition Classes
    SchemaDStreamDStream
  54. def mapPartitions[U](mapPartFunc: (Iterator[Row]) ⇒ Iterator[U], preservePartitioning: Boolean = false)(implicit arg0: ClassTag[U]): DStream[U]

    Permalink

    Return a new DStream in which each RDD is generated by applying mapPartitions() to each RDDs of this SchemaDStream.

    Return a new DStream in which each RDD is generated by applying mapPartitions() to each RDDs of this SchemaDStream. Applying mapPartitions() to an RDD applies a function to each partition of the RDD.

    Definition Classes
    SchemaDStreamDStream
  55. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  56. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  57. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  58. def persist(): SchemaDStream

    Permalink

    Persist RDDs of this SchemaDStream with the default storage level (MEMORY_ONLY_SER)

    Persist RDDs of this SchemaDStream with the default storage level (MEMORY_ONLY_SER)

    Definition Classes
    SchemaDStreamDStream
  59. def persist(level: StorageLevel): SchemaDStream

    Permalink

    Persist the RDDs of this SchemaDStream with the given storage level

    Persist the RDDs of this SchemaDStream with the given storage level

    Definition Classes
    SchemaDStreamDStream
  60. def print(num: Int): Unit

    Permalink

    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
  61. def print(): Unit

    Permalink

    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
  62. def printSchema(): Unit

    Permalink
  63. val queryExecution: QueryExecution

    Permalink
  64. def reduce(reduceFunc: (Row, Row) ⇒ Row): DStream[Row]

    Permalink

    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
  65. def reduceByWindow(reduceFunc: (Row, Row) ⇒ Row, invReduceFunc: (Row, Row) ⇒ Row, windowDuration: Duration, slideDuration: Duration): DStream[Row]

    Permalink

    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 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
  66. def reduceByWindow(reduceFunc: (Row, Row) ⇒ Row, windowDuration: Duration, slideDuration: Duration): DStream[Row]

    Permalink

    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
  67. def registerAsTable(tableName: String): Unit

    Permalink

    Registers this SchemaDStream as a table in the catalog.

  68. def repartition(numPartitions: Int): SchemaDStream

    Permalink

    Return a new SchemaDStream with an increased or decreased level of parallelism.

    Return a new SchemaDStream with an increased or decreased level of parallelism. Each RDD in the returned SchemaDStream has exactly numPartitions partitions.

    Definition Classes
    SchemaDStreamDStream
  69. def saveAsObjectFiles(prefix: String, suffix: String = ""): Unit

    Permalink

    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
  70. def saveAsTextFiles(prefix: String, suffix: String = ""): Unit

    Permalink

    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
  71. def schema: StructType

    Permalink

    Returns the schema of this SchemaDStream (represented by a StructType).

  72. def slice(fromTime: Time, toTime: Time): Seq[RDD[Row]]

    Permalink

    Return all the RDDs between 'fromTime' to 'toTime' (both included)

    Return all the RDDs between 'fromTime' to 'toTime' (both included)

    Definition Classes
    DStream
  73. def slice(interval: Interval): Seq[RDD[Row]]

    Permalink

    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
  74. def slideDuration: Duration

    Permalink

    Time interval after which the SchemaDStream generates a RDD

    Time interval after which the SchemaDStream generates a RDD

    Definition Classes
    SchemaDStreamDStream
  75. val snsc: SnappyStreamingContext

    Permalink
  76. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  77. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  78. def transform[U](transformFunc: (RDD[Row], Time) ⇒ RDD[U])(implicit arg0: ClassTag[U]): DStream[U]

    Permalink

    Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' SchemaDStream.

    Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' SchemaDStream.

    Definition Classes
    SchemaDStreamDStream
  79. def transform[U](transformFunc: (RDD[Row]) ⇒ RDD[U])(implicit arg0: ClassTag[U]): DStream[U]

    Permalink

    Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' SchemaDStream.

    Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' SchemaDStream.

    Definition Classes
    SchemaDStreamDStream
  80. def transformWith[U, V](other: DStream[U], transformFunc: (RDD[Row], RDD[U], Time) ⇒ RDD[V])(implicit arg0: ClassTag[U], arg1: ClassTag[V]): DStream[V]

    Permalink

    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
    SchemaDStreamDStream
  81. def transformWith[U, V](other: DStream[U], transformFunc: (RDD[Row], RDD[U]) ⇒ RDD[V])(implicit arg0: ClassTag[U], arg1: ClassTag[V]): DStream[V]

    Permalink

    Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' SchemaDStream and 'other' SchemaDStream.

    Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' SchemaDStream and 'other' SchemaDStream.

    Definition Classes
    SchemaDStreamDStream
  82. def union(that: DStream[Row]): DStream[Row]

    Permalink

    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
  83. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  86. def window(windowDuration: Duration, slideDuration: Duration): DStream[Row]

    Permalink

    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
  87. def window(windowDuration: Duration): DStream[Row]

    Permalink

    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

Inherited from DStream[Row]

Inherited from internal.Logging

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped