Class/Object

org.apache.spark.streaming.api.java

JavaSnappyStreamingContext

Related Docs: object JavaSnappyStreamingContext | package java

Permalink

class JavaSnappyStreamingContext extends JavaStreamingContext

Linear Supertypes
JavaStreamingContext, Closeable, AutoCloseable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JavaSnappyStreamingContext
  2. JavaStreamingContext
  3. Closeable
  4. AutoCloseable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new JavaSnappyStreamingContext(path: String, sparkContext: JavaSparkContext)

    Permalink

    Recreate a JavaSnappyStreamingContext from a checkpoint file using an existing SparkContext.

    Recreate a JavaSnappyStreamingContext from a checkpoint file using an existing SparkContext.

    path

    Path to the directory that was specified as the checkpoint directory

    sparkContext

    Existing SparkContext

  2. new JavaSnappyStreamingContext(path: String)

    Permalink

    Recreate a JavaSnappyStreamingContext from a checkpoint file.

    Recreate a JavaSnappyStreamingContext from a checkpoint file.

    path

    Path to the directory that was specified as the checkpoint directory

  3. new JavaSnappyStreamingContext(path: String, hadoopConf: Configuration)

    Permalink

    Recreate a JavaSnappyStreamingContext from a checkpoint file.

    Recreate a JavaSnappyStreamingContext from a checkpoint file.

    path

    Path to the directory that was specified as the checkpoint directory

    hadoopConf

    Optional, configuration object if necessary for reading from HDFS compatible filesystems

  4. new JavaSnappyStreamingContext(conf: SparkConf, batchDuration: Duration)

    Permalink

    Create a JavaSnappyStreamingContext by providing the configuration necessary for a new SparkContext.

    Create a JavaSnappyStreamingContext by providing the configuration necessary for a new SparkContext.

    conf

    a org.apache.spark.SparkConf object specifying Spark parameters

    batchDuration

    the time interval at which streaming data will be divided into batches

  5. new JavaSnappyStreamingContext(sparkContext: JavaSparkContext, batchDuration: Duration)

    Permalink

    Create a JavaSnappyStreamingContext using an existing SparkContext.

    Create a JavaSnappyStreamingContext using an existing SparkContext.

    sparkContext

    existing SparkContext

    batchDuration

    the time interval at which streaming data will be divided into batches

  6. new JavaSnappyStreamingContext(sparkContext: JavaSparkContext, checkpoint: Checkpoint, batchDuration: Duration)

    Permalink

    Create a JavaSnappyStreamingContext using an existing SparkContext.

    Create a JavaSnappyStreamingContext using an existing SparkContext.

    sparkContext

    existing SparkContext

    checkpoint

    checkpoint directory

    batchDuration

    the time interval at which streaming data will be divided into batches

  7. new JavaSnappyStreamingContext(snsc: SnappyStreamingContext)

    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. def addStreamingListener(streamingListener: StreamingListener): Unit

    Permalink

    Add a org.apache.spark.streaming.scheduler.StreamingListener object for receiving system events related to streaming.

    Add a org.apache.spark.streaming.scheduler.StreamingListener object for receiving system events related to streaming.

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

    Permalink
    Definition Classes
    Any
  6. def awaitTermination(): Unit

    Permalink

    Wait for the execution to stop.

    Wait for the execution to stop. Any exceptions that occurs during the execution will be thrown in this thread.

    Definition Classes
    JavaStreamingContext
    Annotations
    @throws( ... )
  7. def awaitTerminationOrTimeout(timeout: Long): Boolean

    Permalink

    Wait for the execution to stop.

    Wait for the execution to stop. Any exceptions that occurs during the execution will be thrown in this thread.

    timeout

    time to wait in milliseconds

    returns

    true if it's stopped; or throw the reported error during the execution; or false if the waiting time elapsed before returning from the method.

    Definition Classes
    JavaStreamingContext
    Annotations
    @throws( ... )
  8. def binaryRecordsStream(directory: String, recordLength: Int): JavaDStream[Array[Byte]]

    Permalink

    Create an input stream that monitors a Hadoop-compatible filesystem for new files and reads them as flat binary files with fixed record lengths, yielding byte arrays

    Create an input stream that monitors a Hadoop-compatible filesystem for new files and reads them as flat binary files with fixed record lengths, yielding byte arrays

    directory

    HDFS directory to monitor for new files

    recordLength

    The length at which to split the records

    Definition Classes
    JavaStreamingContext
    Note

    We ensure that the byte array for each record in the resulting RDDs of the DStream has the provided record length.

  9. def checkpoint(directory: String): Unit

    Permalink

    Sets the context to periodically checkpoint the DStream operations for master fault-tolerance.

    Sets the context to periodically checkpoint the DStream operations for master fault-tolerance. The graph will be checkpointed every batch interval.

    directory

    HDFS-compatible directory where the checkpoint data will be reliably stored

    Definition Classes
    JavaStreamingContext
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def close(): Unit

    Permalink
    Definition Classes
    JavaStreamingContext → Closeable → AutoCloseable
  12. def createSchemaDStream(rowStream: JavaDStream[_], beanClass: Class[_]): SchemaDStream

    Permalink
  13. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  15. def fileStream[K, V, F <: InputFormat[K, V]](directory: String, kClass: Class[K], vClass: Class[V], fClass: Class[F], filter: Function[Path, Boolean], newFilesOnly: Boolean, conf: Configuration): JavaPairInputDStream[K, V]

    Permalink

    Create an input stream that monitors a Hadoop-compatible filesystem for new files and reads them using the given key-value types and input format.

    Create an input stream that monitors a Hadoop-compatible filesystem for new files and reads them using the given key-value types and input format. Files must be written to the monitored directory by "moving" them from another location within the same file system. File names starting with . are ignored.

    K

    Key type for reading HDFS file

    V

    Value type for reading HDFS file

    F

    Input format for reading HDFS file

    directory

    HDFS directory to monitor for new file

    kClass

    class of key for reading HDFS file

    vClass

    class of value for reading HDFS file

    fClass

    class of input format for reading HDFS file

    filter

    Function to filter paths to process

    newFilesOnly

    Should process only new files and ignore existing files in the directory

    conf

    Hadoop configuration

    Definition Classes
    JavaStreamingContext
  16. def fileStream[K, V, F <: InputFormat[K, V]](directory: String, kClass: Class[K], vClass: Class[V], fClass: Class[F], filter: Function[Path, Boolean], newFilesOnly: Boolean): JavaPairInputDStream[K, V]

    Permalink

    Create an input stream that monitors a Hadoop-compatible filesystem for new files and reads them using the given key-value types and input format.

    Create an input stream that monitors a Hadoop-compatible filesystem for new files and reads them using the given key-value types and input format. Files must be written to the monitored directory by "moving" them from another location within the same file system. File names starting with . are ignored.

    K

    Key type for reading HDFS file

    V

    Value type for reading HDFS file

    F

    Input format for reading HDFS file

    directory

    HDFS directory to monitor for new file

    kClass

    class of key for reading HDFS file

    vClass

    class of value for reading HDFS file

    fClass

    class of input format for reading HDFS file

    filter

    Function to filter paths to process

    newFilesOnly

    Should process only new files and ignore existing files in the directory

    Definition Classes
    JavaStreamingContext
  17. def fileStream[K, V, F <: InputFormat[K, V]](directory: String, kClass: Class[K], vClass: Class[V], fClass: Class[F]): JavaPairInputDStream[K, V]

    Permalink

    Create an input stream that monitors a Hadoop-compatible filesystem for new files and reads them using the given key-value types and input format.

    Create an input stream that monitors a Hadoop-compatible filesystem for new files and reads them using the given key-value types and input format. Files must be written to the monitored directory by "moving" them from another location within the same file system. File names starting with . are ignored.

    K

    Key type for reading HDFS file

    V

    Value type for reading HDFS file

    F

    Input format for reading HDFS file

    directory

    HDFS directory to monitor for new file

    kClass

    class of key for reading HDFS file

    vClass

    class of value for reading HDFS file

    fClass

    class of input format for reading HDFS file

    Definition Classes
    JavaStreamingContext
  18. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  20. def getSchemaDStream(tableName: String): SchemaDStream

    Permalink
  21. def getState(): StreamingContextState

    Permalink

    :: DeveloperApi ::

    :: DeveloperApi ::

    Return the current state of the context. The context can be in three possible states -

    - StreamingContextState.INITIALIZED - The context has been created, but not been started yet. Input DStreams, transformations and output operations can be created on the context.

    - StreamingContextState.ACTIVE - The context has been started, and been not stopped. Input DStreams, transformations and output operations cannot be created on the context.

    - StreamingContextState.STOPPED - The context has been stopped and cannot be used any more.

    Definition Classes
    JavaStreamingContext
  22. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  24. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  27. def queueStream[T](queue: Queue[JavaRDD[T]], oneAtATime: Boolean, defaultRDD: JavaRDD[T]): JavaInputDStream[T]

    Permalink

    Create an input stream from a queue of RDDs.

    Create an input stream from a queue of RDDs. In each batch, it will process either one or all of the RDDs returned by the queue.

    T

    Type of objects in the RDD

    queue

    Queue of RDDs

    oneAtATime

    Whether only one RDD should be consumed from the queue in every interval

    defaultRDD

    Default RDD is returned by the DStream when the queue is empty

    Definition Classes
    JavaStreamingContext
    Note

    1. Changes to the queue after the stream is created will not be recognized. 2. Arbitrary RDDs can be added to queueStream, there is no way to recover data of those RDDs, so queueStream doesn't support checkpointing.

  28. def queueStream[T](queue: Queue[JavaRDD[T]], oneAtATime: Boolean): JavaInputDStream[T]

    Permalink

    Create an input stream from a queue of RDDs.

    Create an input stream from a queue of RDDs. In each batch, it will process either one or all of the RDDs returned by the queue.

    T

    Type of objects in the RDD

    queue

    Queue of RDDs

    oneAtATime

    Whether only one RDD should be consumed from the queue in every interval

    Definition Classes
    JavaStreamingContext
    Note

    1. Changes to the queue after the stream is created will not be recognized. 2. Arbitrary RDDs can be added to queueStream, there is no way to recover data of those RDDs, so queueStream doesn't support checkpointing.

  29. def queueStream[T](queue: Queue[JavaRDD[T]]): JavaDStream[T]

    Permalink

    Create an input stream from a queue of RDDs.

    Create an input stream from a queue of RDDs. In each batch, it will process either one or all of the RDDs returned by the queue.

    T

    Type of objects in the RDD

    queue

    Queue of RDDs

    Definition Classes
    JavaStreamingContext
    Note

    1. Changes to the queue after the stream is created will not be recognized. 2. Arbitrary RDDs can be added to queueStream, there is no way to recover data of those RDDs, so queueStream doesn't support checkpointing.

  30. def rawSocketStream[T](hostname: String, port: Int): JavaReceiverInputDStream[T]

    Permalink

    Create an input stream from network source hostname:port, where data is received as serialized blocks (serialized using the Spark's serializer) that can be directly pushed into the block manager without deserializing them.

    Create an input stream from network source hostname:port, where data is received as serialized blocks (serialized using the Spark's serializer) that can be directly pushed into the block manager without deserializing them. This is the most efficient way to receive data.

    T

    Type of the objects in the received blocks

    hostname

    Hostname to connect to for receiving data

    port

    Port to connect to for receiving data

    Definition Classes
    JavaStreamingContext
  31. def rawSocketStream[T](hostname: String, port: Int, storageLevel: StorageLevel): JavaReceiverInputDStream[T]

    Permalink

    Create an input stream from network source hostname:port, where data is received as serialized blocks (serialized using the Spark's serializer) that can be directly pushed into the block manager without deserializing them.

    Create an input stream from network source hostname:port, where data is received as serialized blocks (serialized using the Spark's serializer) that can be directly pushed into the block manager without deserializing them. This is the most efficient way to receive data.

    T

    Type of the objects in the received blocks

    hostname

    Hostname to connect to for receiving data

    port

    Port to connect to for receiving data

    storageLevel

    Storage level to use for storing the received objects

    Definition Classes
    JavaStreamingContext
  32. def receiverStream[T](receiver: Receiver[T]): JavaReceiverInputDStream[T]

    Permalink

    Create an input stream with any arbitrary user implemented receiver.

    Create an input stream with any arbitrary user implemented receiver. Find more details at: http://spark.apache.org/docs/latest/streaming-custom-receivers.html

    receiver

    Custom implementation of Receiver

    Definition Classes
    JavaStreamingContext
  33. def registerCQ(queryStr: String): SchemaDStream

    Permalink

    Registers and executes given SQL query and returns SchemaDStream to consume the results

  34. def registerPythonCQ(queryStr: String): JavaDStream[Row]

    Permalink

    Registers and executes given SQL query and returns SchemaDStream to consume the results

  35. def remember(duration: Duration): Unit

    Permalink

    Sets each DStreams in this context to remember RDDs it generated in the last given duration.

    Sets each DStreams in this context to remember RDDs it generated in the last given duration. DStreams remember RDDs only for a limited duration of duration and releases them for garbage collection. This method allows the developer to specify how long to remember the RDDs ( if the developer wishes to query old data outside the DStream computation).

    duration

    Minimum duration that each DStream should remember its RDDs

    Definition Classes
    JavaStreamingContext
  36. def snappySession: SnappySession

    Permalink
  37. val snsc: SnappyStreamingContext

    Permalink
  38. def socketStream[T](hostname: String, port: Int, converter: Function[InputStream, Iterable[T]], storageLevel: StorageLevel): JavaReceiverInputDStream[T]

    Permalink

    Create an input stream from network source hostname:port.

    Create an input stream from network source hostname:port. Data is received using a TCP socket and the receive bytes it interpreted as object using the given converter.

    T

    Type of the objects received (after converting bytes to objects)

    hostname

    Hostname to connect to for receiving data

    port

    Port to connect to for receiving data

    converter

    Function to convert the byte stream to objects

    storageLevel

    Storage level to use for storing the received objects

    Definition Classes
    JavaStreamingContext
  39. def socketTextStream(hostname: String, port: Int): JavaReceiverInputDStream[String]

    Permalink

    Create an input stream from network source hostname:port.

    Create an input stream from network source hostname:port. Data is received using a TCP socket and the receive bytes is interpreted as UTF8 encoded \n delimited lines. Storage level of the data will be the default StorageLevel.MEMORY_AND_DISK_SER_2.

    hostname

    Hostname to connect to for receiving data

    port

    Port to connect to for receiving data

    Definition Classes
    JavaStreamingContext
  40. def socketTextStream(hostname: String, port: Int, storageLevel: StorageLevel): JavaReceiverInputDStream[String]

    Permalink

    Create an input stream from network source hostname:port.

    Create an input stream from network source hostname:port. Data is received using a TCP socket and the receive bytes is interpreted as UTF8 encoded \n delimited lines.

    hostname

    Hostname to connect to for receiving data

    port

    Port to connect to for receiving data

    storageLevel

    Storage level to use for storing the received objects

    Definition Classes
    JavaStreamingContext
  41. val sparkContext: JavaSparkContext

    Permalink

    The underlying SparkContext

    The underlying SparkContext

    Definition Classes
    JavaStreamingContext
  42. def sql(sqlText: String): Dataset[Row]

    Permalink
  43. val ssc: StreamingContext

    Permalink
    Definition Classes
    JavaStreamingContext
  44. def start(): Unit

    Permalink

    Start the execution of the streams.

    Start the execution of the streams. Also registers population of AQP tables from stream tables if present.

    Definition Classes
    JavaSnappyStreamingContextJavaStreamingContext
    Exceptions thrown

    IllegalStateException if the JavaSnappyStreamingContext is already stopped

  45. def stop(stopSparkContext: Boolean, stopGracefully: Boolean): Unit

    Permalink

    Stop the execution of the streams.

    Stop the execution of the streams.

    stopSparkContext

    Stop the associated SparkContext or not

    stopGracefully

    Stop gracefully by waiting for the processing of all received data to be completed

    Definition Classes
    JavaSnappyStreamingContextJavaStreamingContext
  46. def stop(stopSparkContext: Boolean): Unit

    Permalink

    Stop the execution of the streams.

    Stop the execution of the streams.

    stopSparkContext

    Stop the associated SparkContext or not

    Definition Classes
    JavaStreamingContext
  47. def stop(): Unit

    Permalink

    Stop the execution of the streams.

    Stop the execution of the streams. Will stop the associated JavaSparkContext as well.

    Definition Classes
    JavaStreamingContext
  48. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  49. def textFileStream(directory: String): JavaDStream[String]

    Permalink

    Create an input stream that monitors a Hadoop-compatible filesystem for new files and reads them as text files (using key as LongWritable, value as Text and input format as TextInputFormat).

    Create an input stream that monitors a Hadoop-compatible filesystem for new files and reads them as text files (using key as LongWritable, value as Text and input format as TextInputFormat). Files must be written to the monitored directory by "moving" them from another location within the same file system. File names starting with . are ignored.

    directory

    HDFS directory to monitor for new file

    Definition Classes
    JavaStreamingContext
  50. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  51. def transform[T](dstreams: List[JavaDStream[_]], transformFunc: Function2[List[JavaRDD[_]], Time, JavaRDD[T]]): JavaDStream[T]

    Permalink

    Create a new DStream in which each RDD is generated by applying a function on RDDs of the DStreams.

    Create a new DStream in which each RDD is generated by applying a function on RDDs of the DStreams. The order of the JavaRDDs in the transform function parameter will be the same as the order of corresponding DStreams in the list.

    Definition Classes
    JavaStreamingContext
    Note

    For adding a JavaPairDStream in the list of JavaDStreams, convert it to a JavaDStream using org.apache.spark.streaming.api.java.JavaPairDStream.toJavaDStream(). In the transform function, convert the JavaRDD corresponding to that JavaDStream to a JavaPairRDD using org.apache.spark.api.java.JavaPairRDD.fromJavaRDD().

  52. def transformToPair[K, V](dstreams: List[JavaDStream[_]], transformFunc: Function2[List[JavaRDD[_]], Time, JavaPairRDD[K, V]]): JavaPairDStream[K, V]

    Permalink

    Create a new DStream in which each RDD is generated by applying a function on RDDs of the DStreams.

    Create a new DStream in which each RDD is generated by applying a function on RDDs of the DStreams. The order of the JavaRDDs in the transform function parameter will be the same as the order of corresponding DStreams in the list.

    Definition Classes
    JavaStreamingContext
    Note

    For adding a JavaPairDStream in the list of JavaDStreams, convert it to a JavaDStream using org.apache.spark.streaming.api.java.JavaPairDStream.toJavaDStream(). In the transform function, convert the JavaRDD corresponding to that JavaDStream to a JavaPairRDD using org.apache.spark.api.java.JavaPairRDD.fromJavaRDD().

  53. def union[K, V](first: JavaPairDStream[K, V], rest: List[JavaPairDStream[K, V]]): JavaPairDStream[K, V]

    Permalink

    Create a unified DStream from multiple DStreams of the same type and same slide duration.

    Create a unified DStream from multiple DStreams of the same type and same slide duration.

    Definition Classes
    JavaStreamingContext
  54. def union[T](first: JavaDStream[T], rest: List[JavaDStream[T]]): JavaDStream[T]

    Permalink

    Create a unified DStream from multiple DStreams of the same type and same slide duration.

    Create a unified DStream from multiple DStreams of the same type and same slide duration.

    Definition Classes
    JavaStreamingContext
  55. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from JavaStreamingContext

Inherited from Closeable

Inherited from AutoCloseable

Inherited from AnyRef

Inherited from Any

Ungrouped