long result = Long.MIN_VALUE;
JobParameter clusterNameParameter =
param.getParameters().get(JobConstants.CLUSTER_NAME_JOB_PARAM);
String clusterName = (String) clusterNameParameter.getValue();
Job preparingJob = jobRegistry.getJob(jobName);
JobExecution preparingJobExecution = jobLauncher.run(preparingJob, param);
int subJobNumber = 0;
waitJobExecution(preparingJobExecution.getId(), Long.MAX_VALUE);
if (preparingJobExecution.getStatus() == BatchStatus.COMPLETED) {
subJobNumber =
preparingJobExecution.getExecutionContext().getInt(
(JobConstants.SUB_JOB_NUMBER));
if (subJobNumber > 0) {
logger.debug("sub job number: " + subJobNumber);
List<JobParameters> subJobParametersList =
new ArrayList<JobParameters>();
for (int i = 0; i < subJobNumber; i++) {
JobParameters subJobParameters =
(JobParameters) preparingJobExecution
.getExecutionContext()
.get(JobConstants.SUB_JOB_PARAMETERS_KEY_PREFIX + i);
subJobParametersList.add(subJobParameters);
}
result =