【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

相关推荐
水蓝烟雨2 小时前
Elasticsearch基本操作
大数据·elasticsearch·搜索引擎
IT云清2 小时前
Apache Seata分布式事务原理解析探秘
分布式·apache·seata·分布式事务
TiDB_PingCAP2 小时前
国产化新标杆:TiDB 助力广发银行新一代总账系统投产上线
运维·数据库·开源·tidb
乐安lan3 小时前
数据库的操作
数据库·oracle
霖烟易辞4 小时前
MySQL中的DDL语句
数据库·mysql·ddl
PY1784 小时前
Python的上下文管理器
数据库·python·oracle
阿猿收手吧!4 小时前
【MySQL】表的操作{创建/查看/修改/删除}
数据库·mysql
超维Ai编程4 小时前
mysql从入门到精通
数据库·mysql
CCI3445 小时前
Rust简明教程第三章-所有权与借用
开发语言·数据库·rust
zengson_g5 小时前
如何监控和分析 PostgreSQL 中的查询执行计划?
数据库·postgresql·oracle