Skip to content
Snippets Groups Projects
Commit 4d9b0ab4 authored by Tathagata Das's avatar Tathagata Das
Browse files

Added waitForStop and stop to JavaStreamingContext.

parent f5108ffc
No related branches found
No related tags found
No related merge requests found
......@@ -432,7 +432,7 @@ class StreamingContext private[streaming] (
/**
* Wait for the execution to stop. Any exceptions that occurs during the execution
* will be thrown here.
* will be thrown in this thread.
*/
def waitForStop() {
waiter.waitForStopOrError()
......@@ -440,7 +440,7 @@ class StreamingContext private[streaming] (
/**
* Wait for the execution to stop. Any exceptions that occurs during the execution
* will be thrown here.
* will be thrown in this thread.
* @param timeout time to wait
*/
def waitForStop(timeout: Long) {
......@@ -449,6 +449,7 @@ class StreamingContext private[streaming] (
/**
* Stop the execution of the streams.
* @param stopSparkContext Stop the associated SparkContext or not
*/
def stop(stopSparkContext: Boolean = true) = synchronized {
scheduler.stop()
......
......@@ -483,9 +483,28 @@ class JavaStreamingContext(val ssc: StreamingContext) {
def start() = ssc.start()
/**
* Stop the execution of the streams.
* Wait for the execution to stop. Any exceptions that occurs during the execution
* will be thrown in this thread.
*/
def waitForStop() = ssc.waitForStop()
/**
* Wait for the execution to stop. Any exceptions that occurs during the execution
* will be thrown in this thread.
* @param timeout time to wait
*/
def waitForStop(timeout: Long) = ssc.waitForStop(timeout)
/**
* Stop the execution of the streams. Will stop the associated JavaSparkContext as well.
*/
def stop() = ssc.stop()
/**
* Stop the execution of the streams.
* @param stopSparkContext Stop the associated SparkContext or not
*/
def stop(stopSparkContext: Boolean) = ssc.stop(stopSparkContext)
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment