spark streaming什么时候会对Dstream执行输出操作
When spark streaming will execute the output operation on Dstream
我正在研究 Spark Streaming 编程指南。我有一个基本的疑问,比如它什么时候会 execute/compute Dstream
输出操作。
例如(我从一个例子中得到的):
val ssc = new StreamingContext(conf, Seconds(1))
val lines = ssc.socketTextStream("localhost", 7777)
lines.foreachRDD { rdd =>
rdd.foreachPartition { partitionOfRecords =>
val connection = createNewConnection()
partitionOfRecords.foreach(record => connection.send(record))
connection.close()
}
}
// Start the computation
ssc.start()
// Wait for the computation to terminate
ssc.awaitTermination()
它会在batch-iterval
这里每1秒做一次操作吗?或者等到终止。
Will it do the operation at each batch-iterval here 1 second. Or it wait till termination.
它会每隔 1 秒读取一个批次,每次 运行 整个图形。在 Spark 术语中,它被称为在每个时间间隔执行 job。
流媒体作业只会在您选择停止后终止。
我正在研究 Spark Streaming 编程指南。我有一个基本的疑问,比如它什么时候会 execute/compute Dstream
输出操作。
例如(我从一个例子中得到的):
val ssc = new StreamingContext(conf, Seconds(1))
val lines = ssc.socketTextStream("localhost", 7777)
lines.foreachRDD { rdd =>
rdd.foreachPartition { partitionOfRecords =>
val connection = createNewConnection()
partitionOfRecords.foreach(record => connection.send(record))
connection.close()
}
}
// Start the computation
ssc.start()
// Wait for the computation to terminate
ssc.awaitTermination()
它会在batch-iterval
这里每1秒做一次操作吗?或者等到终止。
Will it do the operation at each batch-iterval here 1 second. Or it wait till termination.
它会每隔 1 秒读取一个批次,每次 运行 整个图形。在 Spark 术语中,它被称为在每个时间间隔执行 job。
流媒体作业只会在您选择停止后终止。