IBM流事件大集成

streamsx.eventstore的Python项目详细描述


概述

提供一个函数,用于将IBM流元组数据插入IBM DB2事件存储中的表中。

ibmdb2eventstore是一个内存数据库,用于在事件驱动应用程序中快速接收和分析流式数据。它为快速数据提供了结构,能够实时处理大量事件,并为高级分析和可操作的见解优化流式数据性能。

这个包将com.ibm.streamsx.eventstore工具箱和com.ibm.streamsx.jdbc工具箱公开为python方法。

支持的版本:

  • DB2事件存储1.x:streamsx.event store版本1.x
  • DB2事件存储2.x:streamsx.event store版本2.x

样品

streams应用程序向 DB2事件存储数据库中的表:

from streamsx.topology.topology import Topology
from streamsx.topology.schema import CommonSchema, StreamSchema
from streamsx.topology.context import submit
from streamsx.topology.context import ContextTypes
import streamsx.spl.toolkit
import streamsx.eventstore as es

topo = Topology('EventStoreSample')

# provide connection endpoint information
es_connection = 'HostIP:Port1;HostIP:Port2'

# generate sample tuples with the schema of the target table
s = topo.source([1,2,3,4,5,6,7,8,9])
schema=StreamSchema('tuple<int32 id, rstring name>').as_tuple()
s = s.map(lambda x : (x,'X'+str(x*2)), schema=schema)

# insert tuple data into table as rows
res = es.insert(s, connection=es_connection, database='TESTDB', table='SampleTable', primary_key='id', partitioning_key='id')

submit (ContextTypes.DISTRIBUTED, topo)
# The Streams job is kept running.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
未绘制java OpenGL顶点   swing无法在Java框架中设置文本   java使用xmemcached客户端访问AWS ElastiCache   java将元素添加到默认arraylist   java从给定位置向后逐个字符地读取文件   java将为此处显示的代码创建多少个对象?   Java异步返回CompletableFuture   java在滚动视图中显示图像   我想为用Netbeans开发的Java项目创建安装程序,并使用Mysql Xampp   java是否可以将COUNT与不同的JPA投影一起使用?   java如何定制javafx。场景图表NumberAxis用于更改20个主要记号的硬编码上限   javajavax。xml。ws。WebServiceException:无法访问WSDL   Jboss中的java多线程   java类不是抽象类,并且不重写抽象方法actionPerformed(ActionEvent)   基于java Spring安全令牌的身份验证   java如何在Spring MVC的自定义验证器中从属性文件中读取参数值   使用OpenCV和java在Android中点击获取图像维度?   java无法解析为变量解析。通用域名格式