【发布时间】:2013-11-08 12:51:52
【问题描述】:
我正在学习Trident 框架。在 Trident Streams 上有几种方法用于批处理中的聚合元组,包括 this one,它允许使用 Aggregator 接口对元组进行状态映射。但不幸的是,不存在用于额外持久化地图状态的内置对应项,例如 persistentAggregate() 的其他 9 个重载,仅以 Aggregator 作为参数。
因此,如何通过结合较低级别的 Trident 和 Storm 抽象和工具来实现所需的功能?探索 API 非常困难,因为几乎没有 Javadoc 文档。
换句话说,persistentAggregate() 方法允许通过更新一些持久状态来结束流处理:
stream of tuples ---> persistent state
我想更新持久化状态,顺便发出不同的元组:
stream of tuples ------> stream of different tuples
with
persistent state
Stream.aggregate(Fields, Aggregator, Fields) 不提供容错:
stream of tuples ------> stream of different tuples
with
simple in-memory state
【问题讨论】:
-
你能不能说得详细点。你的问题不清楚
-
@GlobalWarrior 查看问题更新
-
你不能用同一套元组发布两个单独的流吗?其中一个保持状态,而其他人则执行您想要的修改。
-
@GlobalWarrior 映射是有状态的。要发出一个新元组,我需要知道当前状态。
标签: stream state apache-storm trident