【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

相关推荐
DolphinDB14 分钟前
集成 Prometheus 与 DolphinDB 规则引擎,构建敏捷监控解决方案
数据库
IvorySQL1 小时前
PostgreSQL 技术日报 (3月10日)|IIoT 性能瓶颈与内核优化新讨论
数据库·postgresql·开源
DBA小马哥4 小时前
时序数据库是什么?能源行业国产化替换的入门必看
数据库·时序数据库
爱可生开源社区6 小时前
某马来西亚游戏公司如何从 SQL Server 迁移至 OceanBase?
数据库
武子康8 小时前
大数据-243 离线数仓 - 实战电商核心交易增量导入(DataX - HDFS - Hive 分区
大数据·后端·apache hive
小瓦码J码8 小时前
PostgreSQL表名超长踩坑记
数据库·postgresql
yhyyht8 小时前
InfluxDB入门记录(三)flux-dsl
数据库·后端
IvorySQL1 天前
PostgreSQL 技术日报 (3月9日)|EXPLAIN ANALYZE 计时优化与复制语法讨论
数据库·postgresql·开源
stark张宇1 天前
MySQL 核心内幕:从索引原理、字段选型到日志机制与外键约束,一篇打通数据库任督二脉
数据库·mysql·架构
倔强的石头_1 天前
融合数据库架构实践:关系型、JSON与全文检索的“一库多能”深度解析
数据库