Add JSR-352 start/restart wrapper methods to the MassIndexingJob parameters builder

Description

Currently, to launch a mass indexing job, we need to:

BatchApp.java

1 2 3 4 5 JobOperator jobOperator = BatchRuntime.getJobOperator(); Properties parameters = MassIndexingJob.parameters() .forEntities( EntityA.class, EntityB.class ) .build(); long executionId = jobOperator.start( MassIndexingJob.NAME, parameters );

There's nothing wrong to do that, but it is semantically bad. I would prefer a more fluent expression, like:

BatchAppWithoutParams.java

1 long executionId = MassIndexingJob.forEntities( EntityA.class, EntityB.class ).start();

BatchAppWithParams.java

1 2 3 4 5 long executionId = MassIndexingJob .forEntities( EntityA.class, EntityB.class ) .paramA( "foo" ) .paramB( "bar" ) .start();

Actually, the proposed expression was the initial version, we changed it at some point due to issues of retrieving JobOperator in JBeret SE environment HSEARCH-2649. Since we don't officially support JBeret SE yet, maybe it's better to turn back and use the proposed expression—it will be much easier to understand. And eventually investigate whether this is a bug in JBeret SE. Please notice that JBeret EE is not impacted, only JBeret SE seems to be impacted.

This is an important change. If we want to do it before the final release, we still have time. Otherwise, it will be too late.

Environment

None

Status

Assignee

Unassigned

Reporter

Mincong Huang

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Affects versions

5.9.0.Beta1

Priority

Major