I am working on partitioning my data of million records with chunk size as 1000 and grid size of 10 using async task executor in spring boot. I am getting the start and end Index for the partitioned data(from Partitioner Class) using the StepExecution in the before Step of Item Reader in order to fetch that specific partitioned data from database.
The problem is only one partition is being read and written .
for ex : Item Reader
beforeStep(StepExecution execution){
int startIndex = execution.getExecutionContext().getInt("startIndexValue")
int endIndex = execution.getExecutionContext().getInt("endIndexValue")
List testDataList = getTestDatabetween(startIndex, endIndex);
}
Item Reader Iterates through the testData List and returns testData value to writer
testData read()
{
if(!testData.isEmpty()){
testData = testDataList.get(testIndex);
testIndex++;
}
return testData;
}
TestData = Partition1, Partition2 , Partition3
Only the last partition which is Partition3 is read , processed and written .
I want all the partitions to be read concurrently.
getTestDatabetweemethod is pulling back rows for the ranges you submit? Have you tried adding logging? - Dean Clark