pyspark.streaming.StreamingContext.socketTextStream¶
-
StreamingContext.
socketTextStream
(hostname: str, port: int, storageLevel: pyspark.storagelevel.StorageLevel = StorageLevel(True, True, False, False, 2)) → pyspark.streaming.dstream.DStream[str]¶ Create an input from TCP source hostname:port. Data is received using a TCP socket and receive byte is interpreted as UTF8 encoded
\n
delimited lines.- Parameters
- hostnamestr
Hostname to connect to for receiving data
- portint
Port to connect to for receiving data
- storageLevel
pyspark.StorageLevel
, optional Storage level to use for storing the received objects