【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

相关推荐
DemonAvenger8 分钟前
NoSQL与MySQL混合架构设计:从入门到实战的最佳实践
数据库·mysql·性能优化
AAA修煤气灶刘哥12 小时前
后端人速藏!数据库PD建模避坑指南
数据库·后端·mysql
阿里云大数据AI技术15 小时前
大数据公有云市场第一,阿里云占比47%!
大数据
RestCloud16 小时前
揭秘 CDC 技术:让数据库同步快人一步
数据库·api
得物技术19 小时前
MySQL单表为何别超2000万行?揭秘B+树与16KB页的生死博弈|得物技术
数据库·后端·mysql
Lx35220 小时前
Hadoop容错机制深度解析:保障作业稳定运行
大数据·hadoop
可涵不会debug1 天前
【IoTDB】时序数据库选型指南:工业大数据场景下的技术突围
数据库·时序数据库
ByteBlossom1 天前
MySQL 面试场景题之如何处理 BLOB 和CLOB 数据类型?
数据库·mysql·面试
麦兜*1 天前
MongoDB Atlas 云数据库实战:从零搭建全球多节点集群
java·数据库·spring boot·mongodb·spring·spring cloud
Slaughter信仰1 天前
深入理解Java虚拟机:JVM高级特性与最佳实践(第3版)第十章知识点问答(10题)
java·jvm·数据库