类 RemotePartitioningMasterStepBuilder
- java.lang.Object
- org.springframework.batch.core.step.builder.StepBuilderHelper<PartitionStepBuilder>
- org.springframework.batch.core.step.builder.PartitionStepBuilder
- org.springframework.batch.integration.partition.RemotePartitioningMasterStepBuilder
public class RemotePartitioningMasterStepBuilder extends PartitionStepBuilder
Builder for a master step in a remote partitioning setup. This builder creates and sets aMessageChannelPartitionHandler
on the master step.If no
messagingTemplate
is provided throughmessagingTemplate(MessagingTemplate)
, this builder will create one and set its default channel to theoutputChannel
provided throughoutputChannel(MessageChannel)
.If a
messagingTemplate
is provided, it is assumed that it is fully configured and that its default channel is set to an output channel on which requests to workers will be sent.- 从以下版本开始:
- 4.1
- 作者:
- Mahmoud Ben Hassine
嵌套类概要
从类继承的嵌套类/接口 org.springframework.batch.core.step.builder.StepBuilderHelper
StepBuilderHelper.CommonStepProperties
字段概要
从类继承的字段 org.springframework.batch.core.step.builder.StepBuilderHelper
logger, properties
构造器概要
构造器 构造器 说明 RemotePartitioningMasterStepBuilder(java.lang.String stepName)
Create a newRemotePartitioningMasterStepBuilder
.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 RemotePartitioningMasterStepBuilder
aggregator(StepExecutionAggregator aggregator)
Provide a step execution aggregator for aggregating partitioned step executions into a single result for thePartitionStep
itself.RemotePartitioningMasterStepBuilder
allowStartIfComplete(boolean allowStartIfComplete)
RemotePartitioningMasterStepBuilder
beanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
Set the bean factory.Step
build()
RemotePartitioningMasterStepBuilder
gridSize(int gridSize)
A hint to thePartitionStepBuilder.splitter(StepExecutionSplitter)
about how many step executions are required.RemotePartitioningMasterStepBuilder
inputChannel(org.springframework.messaging.MessageChannel inputChannel)
Set the input channel on which replies from workers will be received.RemotePartitioningMasterStepBuilder
jobExplorer(JobExplorer jobExplorer)
Set the job explorer.RemotePartitioningMasterStepBuilder
listener(java.lang.Object listener)
Registers objects using the annotation based listener configuration.RemotePartitioningMasterStepBuilder
listener(StepExecutionListener listener)
RemotePartitioningMasterStepBuilder
messagingTemplate(org.springframework.integration.core.MessagingTemplate messagingTemplate)
Set theMessagingTemplate
to use to send data to workers.RemotePartitioningMasterStepBuilder
outputChannel(org.springframework.messaging.MessageChannel outputChannel)
Set the output channel on which requests to workers will be sent.RemotePartitioningMasterStepBuilder
partitioner(java.lang.String slaveStepName, Partitioner partitioner)
Add a partitioner which can be used to create aStepExecutionSplitter
.RemotePartitioningMasterStepBuilder
partitionHandler(PartitionHandler partitionHandler)
This method will throw aUnsupportedOperationException
since the partition handler of the master step will be automatically set to an instance ofMessageChannelPartitionHandler
.RemotePartitioningMasterStepBuilder
pollInterval(long pollInterval)
How often to poll the job repository for the status of the workers.RemotePartitioningMasterStepBuilder
repository(JobRepository jobRepository)
RemotePartitioningMasterStepBuilder
splitter(StepExecutionSplitter splitter)
Provide an explicitStepExecutionSplitter
instead of having one build from thePartitionStepBuilder.partitioner(String, Partitioner)
.RemotePartitioningMasterStepBuilder
startLimit(int startLimit)
RemotePartitioningMasterStepBuilder
step(Step step)
Provide an actual step instance to execute in parallel.RemotePartitioningMasterStepBuilder
timeout(long timeout)
When using job repository polling, the time limit to wait.RemotePartitioningMasterStepBuilder
transactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
从类继承的方法 org.springframework.batch.core.step.builder.PartitionStepBuilder
getAggregator, getGridSize, getPartitioner, getPartitionHandler, getSplitter, getStep, getStepName, getTaskExecutor, taskExecutor
从类继承的方法 org.springframework.batch.core.step.builder.StepBuilderHelper
enhance, getJobRepository, getName, getTransactionManager, isAllowStartIfComplete
构造器详细资料
RemotePartitioningMasterStepBuilder
public RemotePartitioningMasterStepBuilder(java.lang.String stepName)
Create a newRemotePartitioningMasterStepBuilder
.- 参数:
stepName
- name of the master step
方法详细资料
inputChannel
public RemotePartitioningMasterStepBuilder inputChannel(org.springframework.messaging.MessageChannel inputChannel)
Set the input channel on which replies from workers will be received.- 参数:
inputChannel
- the input channel- 返回:
- this builder instance for fluent chaining
outputChannel
public RemotePartitioningMasterStepBuilder outputChannel(org.springframework.messaging.MessageChannel outputChannel)
Set the output channel on which requests to workers will be sent. By using this setter, a default messaging template will be created and the output channel will be set as its default channel.Use either this setter or
messagingTemplate(MessagingTemplate)
to provide a fully configured messaging template.- 参数:
outputChannel
- the output channel.- 返回:
- this builder instance for fluent chaining
- 另请参阅:
messagingTemplate(MessagingTemplate)
messagingTemplate
public RemotePartitioningMasterStepBuilder messagingTemplate(org.springframework.integration.core.MessagingTemplate messagingTemplate)
Set theMessagingTemplate
to use to send data to workers. The default channel of the messaging template must be set.Use either this setter to provide a fully configured messaging template or provide an output channel through
outputChannel(MessageChannel)
and a default messaging template will be created.- 参数:
messagingTemplate
- the messaging template to use- 返回:
- this builder instance for fluent chaining
- 另请参阅:
outputChannel(MessageChannel)
jobExplorer
public RemotePartitioningMasterStepBuilder jobExplorer(JobExplorer jobExplorer)
Set the job explorer.- 参数:
jobExplorer
- the job explorer to use.- 返回:
- this builder instance for fluent chaining
pollInterval
public RemotePartitioningMasterStepBuilder pollInterval(long pollInterval)
How often to poll the job repository for the status of the workers. Defaults to 10 seconds.- 参数:
pollInterval
- the poll interval value in milliseconds- 返回:
- this builder instance for fluent chaining
timeout
public RemotePartitioningMasterStepBuilder timeout(long timeout)
When using job repository polling, the time limit to wait. Defaults to -1 (no timeout).- 参数:
timeout
- the timeout value in milliseconds- 返回:
- this builder instance for fluent chaining
beanFactory
public RemotePartitioningMasterStepBuilder beanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
Set the bean factory.- 参数:
beanFactory
- the bean factory to use- 返回:
- this builder instance for fluent chaining
build
public Step build()
- 覆盖:
build
在类中PartitionStepBuilder
repository
public RemotePartitioningMasterStepBuilder repository(JobRepository jobRepository)
transactionManager
public RemotePartitioningMasterStepBuilder transactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
partitioner
public RemotePartitioningMasterStepBuilder partitioner(java.lang.String slaveStepName, Partitioner partitioner)
从类复制的说明:PartitionStepBuilder
Add a partitioner which can be used to create aStepExecutionSplitter
. Use either this or an explicitPartitionStepBuilder.splitter(StepExecutionSplitter)
but not both.- 覆盖:
partitioner
在类中PartitionStepBuilder
- 参数:
slaveStepName
- the name of the slave step (used to construct step execution names)partitioner
- a partitioner to use- 返回:
- this for fluent chaining
gridSize
public RemotePartitioningMasterStepBuilder gridSize(int gridSize)
从类复制的说明:PartitionStepBuilder
A hint to thePartitionStepBuilder.splitter(StepExecutionSplitter)
about how many step executions are required. If running locally or remotely through aPartitionStepBuilder.taskExecutor(TaskExecutor)
determines precisely the number of step executions in the first attempt at a partition step execution.- 覆盖:
gridSize
在类中PartitionStepBuilder
- 参数:
gridSize
- the grid size- 返回:
- this for fluent chaining
step
public RemotePartitioningMasterStepBuilder step(Step step)
从类复制的说明:PartitionStepBuilder
Provide an actual step instance to execute in parallel. If an explicitPartitionStepBuilder.partitionHandler(PartitionHandler)
is provided, the step is optional and is only used to extract configuration data (name and other basic properties of a step).- 覆盖:
step
在类中PartitionStepBuilder
- 参数:
step
- a step to execute in parallel- 返回:
- this for fluent chaining
splitter
public RemotePartitioningMasterStepBuilder splitter(StepExecutionSplitter splitter)
从类复制的说明:PartitionStepBuilder
Provide an explicitStepExecutionSplitter
instead of having one build from thePartitionStepBuilder.partitioner(String, Partitioner)
. Useful if you need more control over the splitting.- 覆盖:
splitter
在类中PartitionStepBuilder
- 参数:
splitter
- a step execution splitter- 返回:
- this for fluent chaining
aggregator
public RemotePartitioningMasterStepBuilder aggregator(StepExecutionAggregator aggregator)
从类复制的说明:PartitionStepBuilder
Provide a step execution aggregator for aggregating partitioned step executions into a single result for thePartitionStep
itself. Default is a simple implementation that works in most cases.- 覆盖:
aggregator
在类中PartitionStepBuilder
- 参数:
aggregator
- a step execution aggregator- 返回:
- this for fluent chaining
startLimit
public RemotePartitioningMasterStepBuilder startLimit(int startLimit)
listener
public RemotePartitioningMasterStepBuilder listener(java.lang.Object listener)
从类复制的说明:StepBuilderHelper
Registers objects using the annotation based listener configuration.- 覆盖:
listener
在类中StepBuilderHelper<PartitionStepBuilder>
- 参数:
listener
- the object that has a method configured with listener annotation- 返回:
- this for fluent chaining
listener
public RemotePartitioningMasterStepBuilder listener(StepExecutionListener listener)
allowStartIfComplete
public RemotePartitioningMasterStepBuilder allowStartIfComplete(boolean allowStartIfComplete)
partitionHandler
public RemotePartitioningMasterStepBuilder partitionHandler(PartitionHandler partitionHandler) throws java.lang.UnsupportedOperationException
This method will throw aUnsupportedOperationException
since the partition handler of the master step will be automatically set to an instance ofMessageChannelPartitionHandler
. When building a master step for remote partitioning using this builder, no partition handler must be provided.- 覆盖:
partitionHandler
在类中PartitionStepBuilder
- 参数:
partitionHandler
- a partition handler- 返回:
- this builder instance for fluent chaining
- 抛出:
java.lang.UnsupportedOperationException
- if a partition handler is provided- 另请参阅:
for setting up a default handler that works with a local or remote Step