一文彻底掌握Apache Hudi异步Clustering部署

4.1 HoodieClusteringJob

随着Hudi版本0.9.0的发布,我们可以在同一步骤中调度和执行Clustering。我们只需要指定-mode-m选项。有如下三种模式:

  • schedule(调度):制定一个Clustering计划。这提供了一个可以在执行模式下传递的instant

  • execute(执行):在给定的instant执行Clustering计划,这意味着这里需要instant

  • scheduleAndExecute(调度并执行):首先制定Clustering计划并立即执行该计划。

请注意要在原始写入程序仍在运行时运行作业请启用多写入:

hoodie.write.concurrency.mode=optimistic_concurrency_control

hoodie.write.lock.provider=org.apache.hudi.client.transaction.lock.ZookeeperBasedLockProvider

使用spark submit命令提交HoodieClusteringJob示例如下:

spark-submit \

–class org.apache.hudi.utilities.HoodieClusteringJob \

/path/to/hudi-utilities-bundle/target/hudi-utilities-bundle_2.12-0.9.0-SNAPSHOT.jar \

–props /path/to/config/clusteringjob.properties \

–mode scheduleAndExecute \

–base-path /path/to/hudi_table/basePath \

–table-name hudi_table_schedule_clustering \

–spark-memory 1g

clusteringjob.properties配置文件示例如下

hoodie.clustering.async.enabled=true

hoodie.clustering.async.max.commits=4

hoodie.clustering.plan.strategy.target.file.max.bytes=1073741824

hoodie.clustering.plan.strategy.small.file.limit=629145600

hoodie.clustering.execution.str

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值