码迷,mamicode.com
首页 > 数据库 > 详细

nanomsg 如何写数据到PipelineDB

时间:2017-05-03 22:50:53      阅读:388      评论:0      收藏:0      [点我收藏+]

标签:nanomsg   code   roc   bsp   generic   str   rri   tin   tcp   

nanomsg:https://github.com/nanomsg/nanomsg

PipelineDB:https://github.com/pipelinedb/pipelinedb

nanomsgToPipelineDB:https://github.com/sangli00/nanomsgtopdb

 

创建extension

pipeline=# create extension nanomsgtopdb ;
CREATE EXTENSION

 

 默认数据接收流

pipeline=# \d generic_stream
         Stream "public.generic_stream"
      Column       |            Type
-------------------+-----------------------------
 data              | text
 arrival_timestamp | timestamp(0) with time zone

pipeline=#

 

创建Continuous View

pipeline=# create continuous view cv as select data from generic_stream;
CREATE CONTINUOUS VIEW
pipeline=# \d cv
Continuous view "public.cv"
 Column | Type | Modifiers
--------+------+-----------
 data   | text |

pipeline=#

 

发送数据:

[root@localhost test]# ./send_msg
connect to tcp://127.0.0.1:9999
Send msg size is 64

pipeline=# select * from cv;
 data
------
(0 rows)

pipeline=# select * from cv;
           data
--------------------------
 Hello ,from nanomsg msg.
(1 row)

pipeline=#

 

运用PostgreSQL来创建后台进程,如图所示:

技术分享

 

多nanomsg worker process进行数据写入,提高数据接收速度。

 

运用场景:

在底层数据采集的时候,原始数据直接写入到Stream生成CV结果。

 

nanomsg 如何写数据到PipelineDB

标签:nanomsg   code   roc   bsp   generic   str   rri   tin   tcp   

原文地址:http://www.cnblogs.com/sangli/p/6803974.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!