hudi的bucket.index相关配置

发布时间 2023-05-10 11:39:40作者: -见

hudi的bucket.index相关配置的源码文件为 HoodieIndexConfig.java

  • 通用配置
配置项名 默认值 说明 引入版本
hoodie.index.type 无默认值 索引类型,可取值:HBASE、INMEMORY、BLOOM、GLOBAL_BLOOM、SIMPLE、GLOBAL_SIMPLE、BUCKET、FLINK_STATE
hoodie.index.class "" 指定索引类,必须为 HoodieIndex 的子类,自带的有 SparkHoodieHBaseIndex、HoodieBloomIndex、FlinkInMemoryStateIndex、HoodieSimpleBucketIndex、HoodieSparkConsistentBucketIndex
  • BUCKET索引配置
配置项名 默认值 说明 引入版本
hoodie.index.bucket.engine SIMPLE 用于指定 BUCKET 索引类型 0.11.0,可取值 SIMPLE 或 CONSISTENT_HASHING
hoodie.bucket.index.hash.field 无默认值 用来分桶的字段名,如果没有设置则使用 hoodie.datasource.write.recordkey.field 的值
hoodie.bucket.index.num.buckets 桶的个数
hoodie.bucket.index.min.num.buckets 最小桶数,仅针对一致性哈希BUCKET索引有效 0.13.0
hoodie.bucket.index.max.num.buckets 最大桶数,仅针对一致性哈希BUCKET索引有效 0.13.0
hoodie.bucket.index.split.threshold 2.0 控制一致性哈希索引的分裂,如果一个文件大小达到 hoodie.xxxx.max.file.size * threshold 则触发分裂 0.13.0
hoodie.bucket.index.merge.threshold 0.2 控制一致性哈希索引的合并,如果一个文件大小小于 hoodie.xxxx.max.file.size * threshold 则触发合并 0.13.0

上表中的 xxxx 可取值:parquet、orc、hfile,相关定义的文件 HoodieStorageConfig.java 中。