【Apache Pinot】Data upload jobtype 粗略分析

背景

目前我司大部分实时数据和离线数据都存储在 pinot 数据库中,离线数据需要通过脚本去生成对应的数据上传到数据库里面,但是其中 config 中有个 jobtype 让人有点迷惑,本文简单的做一个概念的整理

用处

先说一下流程,目前我以 hdfs 举例,我们的脚本会先把数据通过 hdfs 的 client 上传到 hadoop 集群里面,接下来通过 pinot-admin 的语法把数据上传给 pinot controller,这里脚本会用到一个文件,这个文件配置job的各种参数,其中 jobtype 是数据上传里面的一个参数,分别是 tar,URI和 metadata。配置文件如下:

jsx 复制代码
executionFrameworkSpec:
  name: 'standalone'
  segmentGenerationJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentGenerationJobRunner'
  segmentTarPushJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentTarPushJobRunner'
  segmentUriPushJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentUriPushJobRunner'
jobType: SegmentCreationAndTarPush
inputDirURI: 'hdfs://${data_dir}'
includeFileNamePattern: 'glob:**/*.csv'
outputDirURI: 'hdfs:///pinot/controller/${table_name}/${segment_partition}/${segment_suffix}'
overwriteOutput: true
pinotFSSpecs:
  - scheme: file
    className: org.apache.pinot.spi.filesystem.LocalPinotFS
  - scheme: hdfs
    className: org.apache.pinot.plugin.filesystem.HadoopPinotFS
    configs:
      hadoop.conf.path: '/opt/hdfs'
recordReaderSpec:
  dataFormat: 'csv'
  className: 'org.apache.pinot.plugin.inputformat.csv.CSVRecordReader'
  configClassName: 'org.apache.pinot.plugin.inputformat.csv.CSVRecordReaderConfig'
  configs:
    fileFormat: 'default'
    delimiter: '^'
    multiValueDelimiter: ''
tableSpec:
  tableName: '${table_name}'
  schemaURI: '${controller_uri}/tables/${table_name}/schema'
  tableConfigURI: '${controller_uri}/tables/${table_name}'
pinotClusterSpecs:
  - controllerURI: '${controller_uri}'
segmentNameGeneratorSpec:
  type: fixed
  configs:
    segment.name: '${table_name}-${segment_partition}-${segment_suffix}'
pushJobSpec:
  pushParallelism: 2
  pushAttempts: 2
  pushRetryIntervalMillis: 1000
  segmentUriPrefix : 'hdfs://'
  segmentUriSuffix : ''

JobType

TAR

tar type 会把 segment 文件存储到本地,然后通过 stream 的方式把数据发送给 controller,controller 会把 segment 保存下来,然后解析 segment 里面的 metadata,接下来会把 segment 加到表中

URI

URI type 会把 segment 的 tar 文件存储到 deepstorage 中,并且有个可以全局访问的 tar 的 URI,这个 job 会把 URI 发送给 Pinot 的 Controller,controller 会把 segment 保存下来,然后解析 segment 里面的 metadata,接下来会把 segment 加到表中

metadata

metadata type 会把 segment 的 tar 文件存储到 deepstorage 中,并且有个可以全局访问的 tar 的 URI,job 会解析 segment 里面的 metadata,接下来会把 metadata 传给 controller,controller 会根据 metadata 把 segment 下载到 table 里面

总结

整体来看,Tar 的方式比较重,会把数据先给 controller,在给到 server。其他两种方式,client 都不需要传数据,只需要传 uri 等相关轻量的数据给到 controller,后面两者更适合生产使用。接下来就是 metadata 的方式会让 controller 做更少的事情,job 侧做的事情偏多。

引用

https://docs.pinot.apache.org/basics/data-import/batch-ingestion

相关推荐
飞飞传输4 小时前
飞驰云联文件交换建设方法论:从单点传输到持续治理
大数据·运维·安全
得帆低代码PaaS4 小时前
企业级 Agent 架构:MCP、Integration、数据与治理能力
大数据·人工智能·架构·ai agent·企业数字化·mcp
叼烟扛炮4 小时前
Linux 学习笔记(五十六):IO 多路复用初探——select 的“三宗罪”
linux·服务器·数据库·笔记·学习·php
.痞老板.6 小时前
mysql初阶--数据库基础
数据库·mysql
城北徐宫7 小时前
MySQL约束条件一览
数据库·mysql
ClouGence10 小时前
数据库变更审批困局,被这个开源工具解决了
数据库·开源
TDengine (老段)10 小时前
TDengine IDMP 十大实用功能(9)
大数据·数据库·人工智能·物联网·时序数据库·tdengine·idmp
starrocks_stella11 小时前
EMR Serverless StarRocks Object Table:用 SQL 连接 OSS 文件与多模态 AI
数据库
播播资源11 小时前
同账户实测 11 个多模态模型:图像 0.03 元起、竖屏视频 8 元一条,最贵和最便宜差 267 倍
大数据·人工智能·深度学习
这个DBA有点耶11 小时前
以为自增ID只是有空洞?聊聊双主架构下无声的“数据覆盖”
数据库·mysql·dba