Like in the vanilla Storm API, spouts are the source of streams in a Trident topology. On top of the vanilla Storm spouts, Trident exposes additional APIs for more sophisticated spouts.
就像在vanilla Strom API, spouts是一个Trident topology数据流的源头。在vanilla Storm spouts之上,Trident有一些附加的APIs用于复杂的spouts。
There is an inextricable link between how you source your data streams and how you update state (e.g. databases) based on those data streams. SeeTrident
state docfor an explanation of this – understanding this link is imperative for understanding the spout options available.
在你的数据源头和你如何基于这些数据流更新状态(例如,数据库)之前有很深的关联。请看Trident state doc的解释 – 理解这个关联对理解spout选项是重要的。
Regular Storm spouts will be non-transactional spouts in a Trident topology. To use a regular Storm IRichSpout, create the stream like this in a TridentTopology:
Regular Stormspouts是non-transactional的spouts在一个Trident topology。用一个Regular Storm IRichSpout,创建数据流在TridentTopology里:
TridentTopology topology = new TridentTopology(); topology.newStream("myspoutid", new MyRichSpout());
All spouts in a Trident topology are required to be given a unique identifier for the stream – this identifier must be unique across all topologies run on the cluster. Trident will use this identifier to store metadata about what the spout has consumed in Zookeeper,
including the txid and any metadata associated with the spout.
所有Trident topology的spouts要求有一个唯一的标示数据流 – 这个标示必须是所有topologies云心集群上唯一的。Trident会用标示存储一些元数据信息关于这个spout消耗在Zookeeper上,包括txid和相关元数据信息。
You can configure the Zookeeper storage of spout metadata via the following configuration options:
你可以配置Zookeeper存储spout信息通过下面的配置:
-
transactional.zookeeper.servers
: A list of Zookeeper hostnames -
transactional.zookeeper.port
: The port of the Zookeeper cluster -
transactional.zookeeper.root
: The root dir in Zookeeper where metadata is stored. Metadata will be stored at the path /
Pipelining
By default, Trident processes a single batch at a time, waiting for the batch to succeed or fail before trying another batch. You can get significantly higher throughput – and lower latency of processing of each batch – by pipelining the batches. You configure
the maximum amount of batches to be processed simultaneously with the “topology.max.spout.pending” property.
默认下,Trident一次处理一个独立的batch,等待这个batch成功或者失败在开始另一个batch前。你可以得到显著的吞吐量提高 – 低延时处理每个batch – 通过流水线处理batches。你配置最大的同时处理batches量通过”topology.max.spout.pending”属性。
Even while processing multiple batches simultaneously, Trident will order any state updates taking place in the topology among batches. For example, suppose you’re doing a global count aggregation into a database. The idea is that while you’re updating the
count in the database for batch 1, you can still be computing the partial counts for batches 2 through 10. Trident won’t move on to the state updates for batch 2 until the state updates for batch 1 have succeeded. This is essential for achieving exactly-once
processing semantics, as outline inTrident state doc.
当多batches同时处理时,Trident将排序任一个更新在topology的batches之间。例如,假设你做一个全局count聚合到数据库。当你更新batch 1的count值到数据库,你可能正在计算局部的batches 2的counts值到10.Trident不会给batch 2更新batch值直到batch 1更新成功。这样基本实现了准确-一次处理语义,具体请看Trident
state.
Trident spout types(Trident spout类型)
Here are the following spout APIs available:
有如下spout APIs是可用的:
-
ITridentSpout: The most general API that can support transactional
or opaque transactional semantics. Generally you’ll use one of the partitioned flavors of this API rather than this one directly.
ITridentSpout:最通用的API可以支持事务或者不透明事务语义。一般你会用这个API分区的实现,而不是直接使用。 -
IBatchSpout: A non-transactional spout that emits batches of
tuples at a time
IBatchSpout:一个非事务spout,发射batches一次。 -
IPartitionedTridentSpout: A transactional spout
that reads from a partitioned data source (like a cluster of Kafka servers)
IPartitionedTridentSpout:一个事务spout,读分区数据从数据源(比如一个Kafka集群) -
IOpaquePartitionedTridentSpout: An opaque
transactional spout that reads from a partitioned data source
IOpaquePartitionedTridentSpout:一个不透明事务spout,读从分区数据源
And, like mentioned in the beginning of this tutorial, you can use regular IRichSpout’s as well.
正如开始所说的,你可以用regular IRichSpout一样很好用。
转自:http://www.coderzhang.com/blog/trident-spouts/
相关推荐
01.Storm项目实战课程大纲 02.CDH5搭建之CM5安装部署 03.CDH5搭建和CM界面化集群管理 04.Hadoop、HBase、Zookeeper集群管理和角色分配 05.Kafka基础知识和集群搭建 06.Kafka基本操作和最优设置 07.Kafka Java API ...
java swing用户交互界面的美观开发工具包,便于界面开发。
《大数据技术丛书:Storm实时数据处理》通过丰富的实例,系统讲解Storm的基础知识和实时数据处理的最佳实践方法,内容涵盖Storm本地开发环境搭建、日志流数据处理、Trident、分布式远程过程调用、Topology在不同...
radiance-trident-2.0-SNAPSHOT.jar, radiance 一套用于构建现代、优雅和快速应用程序的库。2019-3-30 Java8编译。
应用用法建造$ git clone git@github.com:mayconbordin/trident-examples.git$ cd trident-examples/$ mvn -P < profile> package 使用local配置文件以本地模式运行应用程序或使用cluster在远程集群中运行。...
三叉戟教程实用的Storm Trident教程本教程以的的出色为基础。 流浪者的设置基于Taylor Goetz的。 Hazelcast状态代码基于wurstmeister的。 看看随附的。本教程的结构浏览Part * .java,了解Trident的基础知识使用...
trident-ml,感谢Trident-ml的开源精神。 开放流算法概述: 平均数 移动平均线[1] EWMA 平均值[2] 基数 LogLog 基数[3] HyperLogLog 基数[4] 自适应计数基数[5] 线性计数 分类 委员会分类器[6] 被动攻击分类器[7] ...
01.Storm项目实战课程大纲 02.CDH5搭建之CM5安装部署 03.CDH5搭建和CM界面化集群管理 04.Hadoop、HBase、Zookeeper集群管理和角色分配 05.Kafka基础知识和集群搭建 06.Kafka基本操作和最优设置 07.Kafka Java API ...
storm_Trident例子
这是一个使用 Kafka、Storm 和 Storm Trident 的简单示例。 注意:您的本地 Maven 存储库中应该有最新版本的 Storm。 您可以通过在终端中执行来做到这一点: git clone https://github.com/apache/storm cd storm...
01.Storm项目实战课程大纲 02.CDH5搭建之CM5安装部署 03.CDH5搭建和CM界面化集群管理 04.Hadoop、HBase、Zookeeper集群管理和角色分配 05.Kafka基础知识和集群搭建 06.Kafka基本操作和最优设置 07.Kafka Java API ...
杜克大学图书馆的数字存储库和元数据编辑计划
数据管道指南(使用 Apache Storm)该项目侧重于将 Apache Storm/Trident 与 Java 结合使用。 有关在没有Storm 的情况下使用 .NET 的指南,请参阅随附的。概述该项目的两个主要问题是: 促进数据的冷存储以供以后...
语言:English 三叉戟扩展 我们的Dialoga PBX是我们WebRTC服务产品的核心组件。 它结合了高级动态呼叫控制和路由引擎的所有优点以及功能齐全的呼叫者交互解决方案。 所有这些都可以通过易于使用的自我管理和报告界面...
Trident 是一种高级语言编译器,用于针对 FPGA 用 C 语言编写的科学算法。
Storm Trident实战之计算网站PV.rar
内置的JAR将./Trident/target/trident-*.jar方法二:从Sonatype Nexus下载对于一个预编译的解决方案,它已经通过了我们编写的测试,并且如果您懒得下载2个文件并安装预要求的,则可以自己下载一个。先决条件一只...
这个项目是 Storm's Trident 的游乐场。 在这个项目中,您可以找到我用于柏林的 Trident hackaton @ Big Data ... 包含 hackaton 会话内容的博客文章: ://www.datasalt.com/2013/04/an-storms-trident-api-overview/
适用于内核版本2.4的Trident Blade3D(以及其他)卡的内核帧缓冲低级驱动程序