微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Tormenta 分布式系统的脚本包

程序名称:Tormenta

授权协议: Apache

操作系统: 跨平台

开发语言: Scala

Tormenta 介绍

Tormenta 是 Storm 分布式计算机系统的 Scala
扩展包。Tormenta 在 Storm 的
Kafka
Kestrel spouts消息
添加一个安全类型的包装器。此安全类型允许用户推送映射消息和筛选转换信息到 spout 消息层上去。

代码示例:

import com.twitter.tormenta.scheme._
import com.twitter.tormenta.spout._

// produces strings:
val scheme: Scheme[String] = Scheme { bytes => Some(new String(bytes)) }

// produces integers w/ string length:
val mappedScheme: Scheme[Int] = scheme.map(_.length)

// filters out all tuples less than 5:
val filteredScheme: Scheme[Int] = mappedScheme.filter(_ > 5)

// produces lengths for input strings > length of 5
val spout: Kestrelspout[Int] = new Kestrelspout(filteredScheme, hostSeq, "spout")

Tormenta 官网

https://github.com/twitter/tormenta

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐