}
Map<String, JobGroup> jobKeyToGroup = new HashMap<String, JobGroup>();
for (ReconEntry entry : _entries) {
ReconJob job = _reconConfig.createJob(
_project,
entry.rowIndex,
_project.rows.get(entry.rowIndex),
_columnName,
entry.cell
);
String key = job.getStringKey();
JobGroup group = jobKeyToGroup.get(key);
if (group == null) {
group = new JobGroup(job);
jobKeyToGroup.put(key, group);
}
group.entries.add(entry);
}
int batchSize = _reconConfig.getBatchSize();
int done = 0;
List<CellChange> cellChanges = new ArrayList<CellChange>(_entries.size());
List<JobGroup> groups = new ArrayList<JobGroup>(jobKeyToGroup.values());
List<ReconJob> jobs = new ArrayList<ReconJob>(batchSize);
Map<ReconJob, JobGroup> jobToGroup = new HashMap<ReconJob, ReconOperation.JobGroup>();
for (int i = 0; i < groups.size(); /* don't increment here */) {
while (jobs.size() < batchSize && i < groups.size()) {
JobGroup group = groups.get(i++);
jobs.add(group.job);
jobToGroup.put(group.job, group);
}
List<Recon> recons = _reconConfig.batchRecon(jobs, _historyEntryID);
for (int j = jobs.size() - 1; j >= 0; j--) {
ReconJob job = jobs.get(j);
Recon recon = j < recons.size() ? recons.get(j) : null;
JobGroup group = jobToGroup.get(job);
List<ReconEntry> entries = group.entries;
if (recon == null) {