【发布时间】:2013-09-14 04:00:27
【问题描述】:
我想通过 spout 从一个数据库中获取数据并处理数据并使用 trident 将其存储在另一个数据库中。我是 Storm 和 trident 的新手,我不知道如何实现它。我从spout 中的数据库(实现 trident 支持的 IRichSpout 的单独 java 类),我将其作为对象发出。我需要将它传递给 trident 拓扑进行处理(计算记录数)并将其存储到数据库中。
TridentTopology topology = new TridentTopology();
TridentState wordCounts =
topology.newStream("spout1",spout)
现在新的流接受一个 spout 作为输入,即语法是
Stream storm.trident.TridentTopology.newStream(String txId, IRichSpout spout)
但我想将 spout 发出的对象作为流的输入,以便 trident 处理并保存到数据库。那么如何将我的 spout 类带入 trident 并将其传递给新的流,或者我应该结合spout 和 trident 同一个类??
有人可以帮忙吗.....
【问题讨论】:
标签: apache-storm trident