类 MultiResourcePartitioner
- java.lang.Object
- org.springframework.batch.core.partition.support.MultiResourcePartitioner
- 所有已实现的接口:
Partitioner
public class MultiResourcePartitioner extends java.lang.Object implements Partitioner
Implementation ofPartitioner
that locates multiple resources and associates their file names with execution context keys. Creates anExecutionContext
per resource, and labels them as{partition0, partition1, ..., partitionN}
. The grid size is ignored.- 从以下版本开始:
- 2.0
- 作者:
- Dave Syer
构造器概要
构造器 构造器 说明 MultiResourcePartitioner()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 java.util.Map<java.lang.String,ExecutionContext>
partition(int gridSize)
Assign the filename of each of the injected resources to anExecutionContext
.void
setKeyName(java.lang.String keyName)
The name of the key for the file name in eachExecutionContext
.void
setResources(org.springframework.core.io.Resource[] resources)
The resources to assign to each partition.
构造器详细资料
MultiResourcePartitioner
public MultiResourcePartitioner()
方法详细资料
setResources
public void setResources(org.springframework.core.io.Resource[] resources)
The resources to assign to each partition. In Spring configuration you can use a pattern to select multiple resources.- 参数:
resources
- the resources to use
setKeyName
public void setKeyName(java.lang.String keyName)
The name of the key for the file name in eachExecutionContext
. Defaults to "fileName".- 参数:
keyName
- the value of the key
partition
public java.util.Map<java.lang.String,ExecutionContext> partition(int gridSize)
Assign the filename of each of the injected resources to anExecutionContext
.- 指定者:
partition
在接口中Partitioner
- 参数:
gridSize
- the size of the map to return- 返回:
- a map from identifier to input parameters
- 另请参阅:
Partitioner.partition(int)