【问题标题】:When spark streaming will execute the output operation on Dstreamspark streaming什么时候会对Dstream执行输出操作
【发布时间】:2016-09-28 12:52:48
【问题描述】:

我正在研究 Spark Streaming 编程指南。我有一个基本的疑问,比如它何时会执行/计算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 秒处执行操作吗?或者等到终止。

【问题讨论】:

    标签: scala apache-spark spark-streaming


    【解决方案1】:

    它会在每个批处理-iterval 1 秒内执行操作吗?或者等到终止。

    它将每隔 1 秒读取一个批次,并每次运行整个图表。在 Spark 术语中,它被称为在每个时间间隔执行一个作业

    流式作业只会在您将其单独停止时终止。

    【讨论】:

    • 我们如何终止流。是通过中断接收线程吗?
    • 通过调用 REST API 或终止进程。
    猜你喜欢
    • 2019-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-12
    • 2016-10-07
    • 2020-06-03
    • 2020-09-09
    • 1970-01-01
    相关资源
    最近更新 更多