- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们一直在使用带有 kafka 的 spark 流,直到现在我们使用的是 createStream
来自 KafkaUtils
的方法.
我们刚刚开始探索 createDirectStream
喜欢它有两个原因:
1)更好/更简单的“恰好一次”语义
2) kafka topic partition 与 rdd partitions 更好的关联
我确实注意到 createDirectStream
被标记为实验性的。我的问题是(对不起,如果这不是很具体):
我们是否应该探索 createDirectStream
方法是否恰好一次对我们很重要?如果你们能分享你的经验,那就太棒了。我们是否冒着不得不处理可靠性等其他问题的风险?
最佳答案
直接方法的创建者 (Cody) here 有一篇很棒的、内容丰富的博文.
一般来说,阅读 Kafka 交付语义部分,最后一部分说:
So effectively Kafka guarantees at-least-once delivery by default and allows the user to implement at most once delivery by disabling retries on the producer and committing its offset prior to processing a batch of messages. Exactly-once delivery requires co-operation with the destination storage system but Kafka provides the offset which makes implementing this straight-forward.
Second, understand that Spark does not guarantee exactly-once semantics for output actions. When the Spark streaming guide talks about exactly-once, it’s only referring to a given item in an RDD being included in a calculated value once, in a purely functional sense. Any side-effecting output operations (i.e. anything you do in foreachRDD to save the result) may be repeated, because any stage of the process might fail and be retried.
The first approach (Receiver based) uses Kafka’s high level API to store consumed offsets in Zookeeper. This is traditionally the way to consume data from Kafka. While this approach (in combination with write ahead logs) can ensure zero data loss (i.e. at-least once semantics), there is a small chance some records may get consumed twice under some failures.
关于apache-spark - 使用 Kafka 进行 Spark 流式传输 - createDirectStream 与 createStream,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38468906/
目前,我正在尝试使用 FMOD 设计一个声音播放器。我想实现只使用一个 Sound 指针的目标,但最终在多次调用 createStream 时内存使用量不断增加。无论如何不使用多个声音指针来改进它吗?
我在 python 中一起玩 spark-streaming 和 kafka,并松散地跟随 this post但我对前面提到的 KafkaUtils.createStream() 函数有点困惑。 do
文档中的定义: org.apache.spark.streaming.kafka Class KafkaUtils static JavaPairReceiverInputDStream create
我们一直在使用带有 kafka 的 spark 流,直到现在我们使用的是 createStream来自 KafkaUtils 的方法. 我们刚刚开始探索 createDirectStream喜欢它有两
您好! 编写RTMP 流媒体服务器用于流式传输AVC+AAC 视频。它与 rtmpdump 配合使用效果很好。但我不能强制它在 flowplayer 和其他 Flash 视频播放器中工作。 握手后的消
我是一名优秀的程序员,十分优秀!