本文整理汇总了Java中org.springframework.batch.core.partition.PartitionHandler类的典型用法代码示例。如果您正苦于以下问题:Java PartitionHandler类的具体用法?Java PartitionHandler怎么用?Java PartitionHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PartitionHandler类属于org.springframework.batch.core.partition包,在下文中一共展示了PartitionHandler类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: step1
import org.springframework.batch.core.partition.PartitionHandler; //导入依赖的package包/类
@Bean
public Step step1(PartitionHandler partitionHandler) throws Exception {
return stepBuilderFactory.get("step1")
.partitioner(workerStep().getName(), partitioner())
.step(workerStep())
.partitionHandler(partitionHandler)
.build();
}
示例2: partitionedJob
import org.springframework.batch.core.partition.PartitionHandler; //导入依赖的package包/类
@Bean
@Profile("!worker")
public Job partitionedJob(PartitionHandler partitionHandler) throws Exception {
Random random = new Random();
return jobBuilderFactory.get("partitionedJob"+random.nextInt())
.start(step1(partitionHandler))
.build();
}
示例3: taxCalculationPartitionHandler
import org.springframework.batch.core.partition.PartitionHandler; //导入依赖的package包/类
@Bean
@StepScope
public PartitionHandler taxCalculationPartitionHandler() {
MessageChannelPartitionHandler messageChannelPartitionHandler = new MessageChannelPartitionHandler();
messageChannelPartitionHandler.setGridSize(clusterConfig.getClusterSize() - MASTER_WITHOUT_TAX_CALCULATION_STEP);
messageChannelPartitionHandler.setReplyChannel(replyChannel());
messageChannelPartitionHandler.setStepName(EmployeeJobConfigSlave.TAX_CALCULATION_STEP);
MessagingTemplate messagingGateway = new MessagingTemplate();
messagingGateway.setReceiveTimeout(RECEIVE_TIMEOUT);
messagingGateway.setDefaultChannel(outboundRequests());
messageChannelPartitionHandler.setMessagingOperations(messagingGateway);
return messageChannelPartitionHandler;
}