类 ColumnRangePartitioner
- java.lang.Object
- org.springframework.batch.sample.common.ColumnRangePartitioner
- 所有已实现的接口:
Partitioner
public class ColumnRangePartitioner extends java.lang.Object implements Partitioner
Simple minded partitioner for a range of values of a column in a database table. Works best if the values are uniformly distributed (e.g. auto-generated primary key values).- 作者:
- Dave Syer
构造器概要
构造器 构造器 说明 ColumnRangePartitioner()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 java.util.Map<java.lang.String,ExecutionContext>
partition(int gridSize)
Partition a database table assuming that the data in the column specified are uniformly distributed.void
setColumn(java.lang.String column)
The name of the column to partition.void
setDataSource(javax.sql.DataSource dataSource)
The data source for connecting to the database.void
setTable(java.lang.String table)
The name of the SQL table the data are in.
构造器详细资料
ColumnRangePartitioner
public ColumnRangePartitioner()
方法详细资料
setTable
public void setTable(java.lang.String table)
The name of the SQL table the data are in.- 参数:
table
- the name of the table
setColumn
public void setColumn(java.lang.String column)
The name of the column to partition.- 参数:
column
- the column name.
setDataSource
public void setDataSource(javax.sql.DataSource dataSource)
The data source for connecting to the database.- 参数:
dataSource
- aDataSource
partition
public java.util.Map<java.lang.String,ExecutionContext> partition(int gridSize)
Partition a database table assuming that the data in the column specified are uniformly distributed. The execution context values will have keysminValue
andmaxValue
specifying the range of values to consider in each partition.- 指定者:
partition
在接口中Partitioner
- 参数:
gridSize
- the size of the map to return- 返回:
- a map from identifier to input parameters
- 另请参阅:
Partitioner.partition(int)