Hi all,
How is the partioning taking place(in Spring Batch 2.1) using the grid size ?
For example:
I have 10,000 records and If the grid size is 10 , so each threads take 1000 records and executes them in parallell.
1. How the records are splitted across the 10 different threads ? . On what basis the splitting of records takes place ?
2. If each thread reads records from the same database, will there be any object level locking taking place while partitioning ?
3. If one thread fails, how to assign the un-processed records of the failed thread to the remaining threads ?
<code>
<job id="Prices_LoadJob" restartable="true"
xmlns="http://www.springframework.org/schema/batch">
<step id="Prices_Load_ManagerStep">
<partition step="Prices_LoadStep" partitioner="partitioner">
<handler grid-size="10" task-executor="taskExecutor" />
</partition>
</step>
</job>
<bean id="partitioner"
class="org.springframework.batch.core.partition.su pport.SimplePartitioner" />
<bean id="taskExecutor" class="org.springframework.core.task.SimpleAsyncTa skExecutor" />
<step id="Prices_LoadStep" xmlns="http://www.springframework.org/schema/batch">
<tasklet transaction-manager="transactionManager">
<chunk reader="pricesLoadReader" processor="pricesLoadProcessor"
writer="pricesLoadWriter" commit-interval="8">
</chunk>
<listeners>
<listener ref="partitiontepListener" />
</listeners>
</tasklet>
</step>
<bean id="partitiontepListener"
class="batch.core.partition.PartitionStepListener" ></bean>
</code>
Kindly reply at the earliest .


Reply With Quote
