- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个从 MQTT 代理接收数据的拓扑,我想要一个 spout 的行为如下:
IBatchSpout
似乎不允许我以特定的时间间隔批量发出元组。 最佳答案
您可以实现自己的 MQTT 喷口。举个例子,看看 MongoSpout .
重要的部分是 nextTuple
方法。
When this method is called, Storm is requesting that the Spout emit tuples to the output collector. This method should be non-blocking, so if the Spout has no tuples to emit, this method should return. nextTuple, ack, and fail are all called in a tight loop in a single thread in the spout task. When there are no tuples to emit, it is courteous to have nextTuple sleep for a short amount of time (like a single millisecond) so as not to waste too much CPU.
nextTuple
这样它只偶尔发出一个元组。
private static final EMISSION_PERIOD = 2000; // 2 seconds
private long lastEmission;
@Override
public void nextTuple() {
if (lastEmission == null ||
lastEmission + EMISSION_PERIOD >= System.currentMillis()) {
List<Object> tuple = pollMQTT();
if (tuple != null) {
this.collector.emit(tuple);
return;
}
}
Utils.sleep(50);
}
关于stream - 创建一个每 X 秒发出一次元组的 Apache Storm spout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26595148/
我有一个用例,我想等待一个 spout 发出并开始从其他 spout 监听 kafka。这在 Storm 中可能吗? 例如:Spout A 做一些处理并发出 done,一旦我收到 done 消息,Sp
由于 Spouts 中不允许阻塞进程,那么将 Spout 实现为 Socket 监听器以接收 DataGram 数据包的最佳方法是什么? 最佳答案 最著名的软件开发规则之一是: We can solv
我正在使用 spout 库在 PHP 中读取和写入 excel 文件。我只是有一个关于速度的问题。 当我尝试读/写 100k 条记录时,只用了 15 分钟 当我尝试读/写 20 万条记录时,现在需要
我想知道 Storm Spout 上的各种方法何时被调用。 我看过ISpout javadoc ,这给了我以下思维模型: "instantiated" -- open(...) -----> "act
OpaqueTridentKafkaSpout 和 TransactionalTridentKafkaSpout 有什么区别?你什么时候会用一个而不是另一个? 最佳答案 不在于哪个更好,而在于你的需求
我遇到 Apache Storm 性能问题,主要来自 spout。 我有一个从 kestrel 队列中发出项目的拓扑。我获取大约 2000 个项目,每次在 spout 中调用 nextTuple 时,
是否可以使用框/喷口卡住电子表格的第一行(卡住 Pane )? 使用 PHPexcel,我确实喜欢这样: $objPHPExcel=new PHPExcel(); $ActiveSheet=$objP
我有两个主题 BACKUPDATA 和 LIVEDATA。 阅读这两个主题的最佳解决方案是什么? 1. 两种不同的拓扑? 2. 一种拓扑有两个 spout? 我尝试了两种不同的拓扑,但 Storm 没
可以对 kafka spout 发出的元组进行字段分组吗?如果是,那么 Storm 如何知道 Kafka 记录中的字段? 最佳答案 Storm 中的字段分组(和一般的分组)是针对 bolt 的,而不是
一般:我是一名学生,想要在 Storm/Kafka/Flink/MS Azure SA/Spark 上运行一些性能测试(WordCount)。我想使用 Kafka Broker 作为输入源。 我使用了
我有一个 Storm Spout,它将从日志文件中读取。因此,当我在本地测试代码时,它运行良好,因为我在运行作业时传递运行时参数。 但是当我在集群中部署代码时,它给出了 FileNotFoundExc
我有一个目录,另一个进程将文件放入其中。 我们当前的 Storm 实现读取此目录并选择最旧的文件并打开文件读取器。该读取器作为 spout 中的一个字段保存,因此当调用 nextTuple() 时,将
我已经开始使用 storm,所以我使用 this tutorial 创建了简单的拓扑 当我使用 LocalCluster 运行我的拓扑时,一切看起来都很好,我的问题是我没有在元组上收到 ACK,这意味
我是 Storm 的初学者。我正在尝试执行下面的示例程序 How to create a topology in storm SampleSpout.java import java.util.
我有两个 Kafka Spouts,我想将它们的值发送到同一个 bolt。 这可能吗? 最佳答案 是的,这是可能的: TopologyBuilder b = new TopologyBuilder()
我看到很多代码片段,其中在 Spout.nextTuple() 中使用了循环。 (例如读取整个文件并为每一行发出一个元组): public void nextTuple() { // do o
我们将 Storm 与 Kafka Spout 一起使用。当消息失败时,我们希望重放它们,但在某些情况下,坏数据或代码错误会导致消息始终无法通过 Bolt,因此我们将进入无限重放循环。显然,当我们发现
我只是在尝试这里提到的 kafka-storm spout https://github.com/nathanmarz/storm-contrib/tree/master/storm-kafka我使用
在我的拓扑中使用 Storm 1.1.0 时,我遇到了这样的问题:当拓扑具有高延迟的 Bolt 时,Storm 会重新调度或让 Bolt 和 Spouts 崩溃。 现在我创建了一个 LatencyTe
我正在使用 Storm 1.1.2、JDK 8(Storm 不喜欢 JDK 9 编译的代码)、Kafka 0.11 和 Docker Compose 制作一个 Spring 应用程序。 这个想法是拥有
我是一名优秀的程序员,十分优秀!