Skip to content

Commit c40c0ef

Browse files
committed
added stop in StreamingContext
1 parent 31e4260 commit c40c0ef

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

python/pyspark/streaming/context.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,15 @@ def textFileStream(self, directory):
121121
file system. FIle names starting with . are ignored.
122122
"""
123123
return DStream(self._jssc.textFileStream(directory), self, UTF8Deserializer())
124+
125+
def stop(self, stopSparkContext=True):
126+
"""
127+
Stop the execution of the streams immediately (does not wait for all received data
128+
to be processed).
129+
"""
130+
131+
try:
132+
self._jssc.stop(stopSparkContext)
133+
finally:
134+
# Stop Callback server
135+
SparkContext._gateway.shutdown()

0 commit comments

Comments
 (0)