kakfa连接sparkstreaming时候offset保存问题

官网的scala代码

stream.foreachRDD { rdd =>
  val offsetRanges = rdd.asInstanceOf[HasOffsetRanges].offsetRanges

  // some time later, after outputs have completed
  stream.asInstanceOf[CanCommitOffsets].commitAsync(offsetRanges)
}

你可能感兴趣的:(kakfa连接sparkstreaming时候offset保存问题)