zoukankan      html  css  js  c++  java
  • nanomsg 如何写数据到PipelineDB

    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结果。

  • 相关阅读:
    poj(1458)(最长公共子序列)
    二叉搜索树
    hdu1087
    poj3641(学习了)
    平年和闰年的由来。。。。
    Linux system函数返回值(转)
    VS2010单元测试(转)
    QT QTableWidget 用法总结(转)
    QT显示图片(转)
    Qt正则表达式类QRegExp(转)
  • 原文地址:https://www.cnblogs.com/sangli/p/6803974.html
Copyright © 2011-2022 走看看