com.holdenkarau.spark.testing

JavaStreamingSuiteBase

Related Doc: package testing

class JavaStreamingSuiteBase extends JavaSuiteBase with StreamingSuiteCommon

This is the base trait for Spark Streaming testsuites. This provides basic functionality to run user-defined set of input on user-defined stream operations, and verify the output. This implementation is designer to work with JUnit for java users Note: this always uses the manual clock

Linear Supertypes
StreamingSuiteCommon, Logging, JavaSuiteBase, SharedJavaSparkContext, SparkContextProvider, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. JavaStreamingSuiteBase
  2. StreamingSuiteCommon
  3. Logging
  4. JavaSuiteBase
  5. SharedJavaSparkContext
  6. SparkContextProvider
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new JavaStreamingSuiteBase()

Value Members

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

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

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

    Definition Classes
    AnyRef → Any
  4. def actuallyWait: Boolean

    Definition Classes
    StreamingSuiteCommon
  5. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  6. def batchDuration: Duration

    Definition Classes
    StreamingSuiteCommon
  7. lazy val checkpointDir: String

    Definition Classes
    StreamingSuiteCommon
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def compareArrays[U](i1: Array[U], i2: Array[U]): Unit

    Utility wrapper around assertArrayEquals that resolves the types

    Utility wrapper around assertArrayEquals that resolves the types

    Definition Classes
    JavaSuiteBase
  10. def conf: SparkConf

    Definition Classes
    JavaStreamingSuiteBase → StreamingSuiteCommon → SharedJavaSparkContext → SparkContextProvider
  11. def createTestInputStream[T](sc: SparkContext, ssc_: TestStreamingContext, input: Seq[Seq[T]])(implicit arg0: ClassTag[T]): TestInputStream[T]

    Create an input stream for the provided input sequence.

    Create an input stream for the provided input sequence. This is done using TestInputStream as queueStream's are not checkpointable.

    Definition Classes
    StreamingSuiteCommon
  12. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  14. val eventuallyTimeout: Timeout

    Definition Classes
    StreamingSuiteCommon
  15. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def framework: String

    Definition Classes
    StreamingSuiteCommon
  17. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  20. def isTraceEnabled(): Boolean

    Attributes
    protected
    Definition Classes
    Logging
  21. def jsc(): JavaSparkContext

    Definition Classes
    SharedJavaSparkContext
  22. def log: Logger

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

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

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

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

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

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

    Attributes
    protected
    Definition Classes
    Logging
  29. def logName: String

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

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

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

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

    Attributes
    protected
    Definition Classes
    Logging
  34. def master: String

    Definition Classes
    StreamingSuiteCommon
  35. def maxWaitTimeMillis: Int

    Definition Classes
    StreamingSuiteCommon
  36. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  39. def numInputPartitions: Int

    Definition Classes
    StreamingSuiteCommon
  40. def runBefore(): Unit

    Definition Classes
    SharedJavaSparkContext
  41. def runStreams[V](outputStream: TestOutputStream[V], ssc: TestStreamingContext, numBatches: Int, numExpectedOutput: Int)(implicit arg0: ClassTag[V]): Seq[Seq[V]]

    Runs the streams set up in ssc on manual clock for numBatches batches and returns the collected output.

    Runs the streams set up in ssc on manual clock for numBatches batches and returns the collected output. It will wait until numExpectedOutput number of output data has been collected or timeout (set by maxWaitTimeMillis) is reached.

    Returns a sequence of items for each RDD.

    Definition Classes
    JavaStreamingSuiteBase → StreamingSuiteCommon
  42. def sc(): SparkContext

  43. def setupClock(): SparkConf

    Definition Classes
    StreamingSuiteCommon
  44. def setupStreams[U, V, W](input1: Seq[Seq[U]], input2: Seq[Seq[V]], operation: (DStream[U], DStream[V]) ⇒ DStream[W])(implicit arg0: ClassTag[U], arg1: ClassTag[V], arg2: ClassTag[W]): (TestOutputStream[W], TestStreamingContext)

    Set up required DStreams to test the binary operation using the sequence of input collections.

    Set up required DStreams to test the binary operation using the sequence of input collections.

    Definition Classes
    StreamingSuiteCommon
  45. def setupStreams[U, V](input: Seq[Seq[U]], operation: (DStream[U]) ⇒ DStream[V], numPartitions: Int = numInputPartitions)(implicit arg0: ClassTag[U], arg1: ClassTag[V]): (TestOutputStream[V], TestStreamingContext)

    Set up required DStreams to test the DStream operation using the two sequences of input collections.

    Set up required DStreams to test the DStream operation using the two sequences of input collections.

    Definition Classes
    StreamingSuiteCommon
  46. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  47. def testOperation[U, V](input: List[List[U]], operation: Function[JavaDStream[U], JavaDStream[V]], expectedOutput: List[List[V]], numBatches: Int, useSet: Boolean): Unit

    Test unary DStream operation with a list of inputs

    Test unary DStream operation with a list of inputs

    input

    Sequence of input collections

    operation

    Binary DStream operation to be applied to the 2 inputs

    expectedOutput

    Sequence of expected output collections

    numBatches

    Number of batches to run the operation for

    useSet

    Compare the output values with the expected output values as sets (order matters) or as lists (order does not matter)

  48. def testOperation[U, V](input: List[List[U]], operation: Function[JavaDStream[U], JavaDStream[V]], expectedOutput: List[List[V]], useSet: Boolean): Unit

  49. def testOperation[U, V](input: List[List[U]], operation: Function[JavaDStream[U], JavaDStream[V]], expectedOutput: List[List[V]]): Unit

    Test unary DStream operation with a list of inputs, with number of batches to run same as the number of expected output values

  50. def toString(): String

    Definition Classes
    AnyRef → Any
  51. def useManualClock: Boolean

    Definition Classes
    StreamingSuiteCommon
  52. def verifyOutput[V](output: Seq[Seq[V]], expectedOutput: Seq[Seq[V]], useSet: Boolean)(implicit arg0: ClassTag[V]): Unit

    Verify whether the output values after running a DStream operation is same as the expected output values, by comparing the output collections either as lists (order matters) or sets (order does not matter)

  53. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  56. def withOutputAndStreamingContext[R](outputStreamSSC: (TestOutputStream[R], TestStreamingContext))(block: (TestOutputStream[R], TestStreamingContext) ⇒ Unit): Unit

    Run a block of code with the given StreamingContext and automatically stop the context when the block completes or when an exception is thrown.

    Run a block of code with the given StreamingContext and automatically stop the context when the block completes or when an exception is thrown.

    Definition Classes
    StreamingSuiteCommon

Inherited from StreamingSuiteCommon

Inherited from Logging

Inherited from JavaSuiteBase

Inherited from SharedJavaSparkContext

Inherited from SparkContextProvider

Inherited from AnyRef

Inherited from Any

Ungrouped