• Singer 学习十 同步模式


    sync 模式是属于tap 的操作,同步模式下,tap 需要提交 schema、 record 、state message, singer 指南对于每种
    类型有详细的说明

    streams

    每个stream 的metadata 包含了详细的用来进行sync 操作的控制说明

    replication 方法

    taps 支持两种类型的同步

    • INCREMENTAL 进行增量同步申明,只有新数据,以及更新的数据在同步的时候会被复制
    • FULL_TABLE 一般都是按照起始时间,在每次同步的时候都需要同步,实际上就是按照时间进行完整同步

    stream/filed 的选择

    taps 应该允许用户选择那个streams 以及fileds 会被复制,当前定义了以下关键字

    • inclusion 只能应用到filed,如果被设置为automatic,那个filed 必须被同步,如果设置为unsupported,就不同同步,在
      discovery 的时候编写
    • selected 如果被设置为true stream (空breadcrumb) 或者filed 应该同步,如果设置为false,stream 或者filed 应该忽略,这个
      元数据是有外部的服务编写的

    遗留stream/filed 的选择

    一些遗留的taps 处理stream 以及filed 的选择是通过"selected"=true 处理的

    metric 消息

    metric 消息主要是定义了一种结构化的消息格式,方便进行日志监控、分析

    • 格式
     
    INFO METRIC: <metrics-json>
    • metrics-json 格式
      metrivs-json 定义了type 、metrics key 、tags、value
      当前的type 有两种 timer,counter
      metrics key 定义了metrics 的名称
      value 指定了metrics 的可以为整数或者浮点数
      tags 包含 endpoint,http_status_code, job_type, status
      参考数据:
     
    INFO METRIC: {"type": "timer", "metric": "http_request_duration", "value": 30.01, "tags": {"endpoint": "orders", "http_status_code": 500, "status": "failed"}}
    INFO METRIC: {"type": "counter", "metric": "record_count", "value": 100, "tags": {"endpoint: "orders"}}
     

    参考资料

    https://github.com/singer-io/getting-started/blob/master/docs/SYNC_MODE.md

  • 相关阅读:
    ubuntu配置实验
    初始linux系统--ubuntu
    部署WSUS服务(一)
    web站点启用https (二)
    web站点启用https (一)
    windows 域的安装方法
    链表大合集(一)
    神奇的幻方
    二叉树的存储结构 以及重建二叉树
    html列表
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/10245449.html
Copyright © 2020-2023  润新知