Skip to content

Commit

Permalink
added stop in StreamingContext
Browse files Browse the repository at this point in the history
  • Loading branch information
giwa committed Sep 20, 2014
1 parent d2c01ba commit c462bb3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python/pyspark/streaming/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,15 @@ def textFileStream(self, directory):
file system. FIle names starting with . are ignored.
"""
return DStream(self._jssc.textFileStream(directory), self, UTF8Deserializer())

def stop(self, stopSparkContext=True):
"""
Stop the execution of the streams immediately (does not wait for all received data
to be processed).
"""

try:
self._jssc.stop(stopSparkContext)
finally:
# Stop Callback server
SparkContext._gateway.shutdown()

0 comments on commit c462bb3

Please sign in to comment.