I am new to spring batch and trying to design a new application which has to read 20 million records from database and process it.
(我是Spring Batch的新手,正在尝试设计一个新应用程序,该应用程序必须从数据库中读取2000万条记录并进行处理。)
I don't think we can do this with one single JOB and Step(in sequential with one thread).
(我不认为我们可以通过一个单独的JOB和一个Step(与一个线程顺序执行)来做到这一点。)
I was thinking we can do this in Partitioning where step is divided into master and multiple workers (each worker is a thread which does its own process can run parallel).
(我在想我们可以在分区中做到这一点,在该分区中,步骤分为主工作者和多个工作者(每个工作者都是一个线程,它自己的进程可以并行运行)。)
We have to read a table(existing table) which has 20 million records and process them but in this table we do not have any auto generated sequence number and it have primary key like employer number with 10 digits.
(我们必须读取一个具有2000万条记录的表(现有表)并进行处理,但在此表中,我们没有任何自动生成的序列号,并且具有主键(如带有10位数字的雇主编号)。)
I checked few sample codes for Partitioning where we can pass the range to each worker and worker process given range like worker1 from 1 to 100 and worker2 101 to 200…but in my case which is not going work because we don't have sequence number to pass as range to each worker.
(我检查了几个用于分区的示例代码,在这里我们可以将范围传递给每个worker和worker进程,给定的范围是worker1从1到100,worker2 101到200…但是在我的情况下,这是行不通的,因为我们没有序列号作为范围传递给每个工人。)
In Partitioning can master read the data from database (like 1000 records) and pass it to each worker in place for sending range ?
(在分区中,master可以从数据库中读取数据(例如1000条记录),并将其传递给每个工人以发送范围吗?)
. (。)
Or for the above scenario do you suggest any other better approach.
(或者对于上述情况,您是否建议其他更好的方法。)
ask by Ethan Lee translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…