Skip to content

Commit

Permalink
Merge pull request #61 from abes-esr/THE-943-batch-reprise-apres-erre…
Browse files Browse the repository at this point in the history
…ur-permettre-de-relancer-une-indexation-a-partir-dun-iddoc-donne

Add : ajout d'un iddocToRestart, pour reprendre le batch à un iddoc d…
  • Loading branch information
julg authored Nov 2, 2023
2 parents 9f757e5 + 92f78de commit 16eb104
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public class TheseItemReader {
@Value("${index.name}")
private String nomIndex;

@Value("${iddocToRestart}")
private Integer iddocToRestart;

@Value("${table.name}")
private String nomTable;

Expand Down Expand Up @@ -68,7 +71,7 @@ private void setWhereClause(OraclePagingQueryProvider queryProvider) {
queryProvider.setWhereClause("where nom_index = '" + nomIndex + "'");
} else {
if (config.getWhereLimite() > 0)
queryProvider.setWhereClause("where rownum < " + config.getWhereLimite());
queryProvider.setWhereClause("where rownum < " + config.getWhereLimite() + " AND iddoc >= " + iddocToRestart.toString());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,19 @@ public class InitialiserIndexESTasklet implements Tasklet {
@Value("${index.pathRecherchePersonnes}")
private String pathRecherchePersonnes;

@Value("${iddocToRestart}")
private Integer iddocToRestart;


@Override
public RepeatStatus execute(StepContribution stepContribution, ChunkContext chunkContext) throws Exception {

if (iddocToRestart > 0) {
log.warn("Index " + nomIndex.toLowerCase() + " non réinitialisé," +
" car reprise de l'indexation à partir de l'iddoc : " + iddocToRestart);
return RepeatStatus.FINISHED;
}

File f = selectIndex();

if (f != null) {
Expand Down

0 comments on commit 16eb104

Please sign in to comment.