我的工作定义如下:
<step id="file-transfer">
<chunk checkpoint-policy="item" item-count="10" retry-limit="10">
<reader ref="allTrusteeCustomerFilesReader">
<properties>
<property name="part-page-first-offset" value="#{partitionPlan['part-page-first-offset']}"/>
<property name="part-page-last-offset" value="#{partitionPlan['part-page-last-offset']}"/>
<property name="part-page-length" value="#{partitionPlan['part-page-length']}"/>
<property name="part-sort-field" value="#{partitionPlan['part-sort-field']}"/>
<property name="part-sort-ascending" value="#{partitionPlan['part-sort-ascending']}"/>
</properties>
</reader>
<processor ref="customerFileLocalToGoogleStorageProcessor"/>
<writer ref="customerFileWriter">
<properties>
<property name="set-google-cloud-migrated" value="true"/>
</properties>
</writer>
<skippable-exception-classes>
<include class="be.valuya.gestemps.server.file.batch.error.NoLocalStorageDataException"/>
<include class="be.valuya.gestemps.server.file.batch.error.TargetAlreadyPresentException"/>
<include class="be.valuya.gestemps.server.file.batch.error.CustomerFileAlreadyMigratedException"/>
</skippable-exception-classes>
<retryable-exception-classes>
<include class="be.valuya.gestemps.server.file.batch.error.TransferToGoogleFailedException"/>
</retryable-exception-classes>
</chunk>
<partition>
<mapper ref="customerFilePartitionMapper"/>
</partition>
<end on="COMPLETED"/>
</step>
引用的映射器创建一个具有定义值的属性数组,并返回它:
PartitionPlanImpl partitionPlan = new PartitionPlanImpl();
partitionPlan.setPartitions(partitionCount);
partitionPlan.setPartitionProperties(partitionProperties);
return partitionPlan;
它在步骤开始时被正确调用,并返回定义了正确键的属性。
但是,我无法从我的阅读器步骤中获取分区计划属性。作业上下文属性和步骤上下文属性都不包含任何内容。我在控制台中没有看到错误。作业实例参数只包含运行时设置的参数。没有任何参数/属性名称冲突。尝试使用 @BatchProperty 注入它们,将字段保留为空。
批处理开始如下:
Properties properties = new Properties();
// Fill parameters...
long executionId = jobOperator.start(jobName, properties);
我错过了什么?