@@ -305,6 +305,7 @@ int start(String jobPath, String jobIdentifier, Properties parameters, OptionSet
305305 String jobName = jobIdentifier ;
306306
307307 JobParameters jobParameters = jobParametersConverter .getJobParameters (parameters );
308+
308309 Assert .isTrue (parameters == null || parameters .size () == 0 || !jobParameters .isEmpty (),
309310 "Invalid JobParameters " + Arrays .asList (parameters )
310311 + ". If parameters are provided they should be in the form name=value (no whitespace)." );
@@ -548,6 +549,8 @@ protected void execute(String[] args) throws IOException {
548549 String jobIdentifier = options .valueOf (JOB_ID ).toString ();
549550
550551 Properties props = new Properties ();
552+ props .setProperty (CHUNK_SIZE , options .valueOf (CHUNK_SIZE ).toString ());
553+ props .setProperty (THREAD_COUNT , options .valueOf (THREAD_COUNT ).toString ());
551554 List <?> nonOptionArgs = options .nonOptionArguments ();
552555 int size = nonOptionArgs .size ();
553556 for (int i = 0 ; i < size ; i ++) {
@@ -579,6 +582,7 @@ protected void execute(String[] args) throws IOException {
579582 protected String NEXT = "next" ;
580583 protected String JOB_ID = "job_id" ;
581584 protected String CHUNK_SIZE = "chunk_size" ;
585+ protected String THREAD_COUNT = "thread_count" ;
582586
583587 protected OptionParser buildOptionParser () {
584588 OptionParser parser = new OptionParser ();
@@ -589,7 +593,8 @@ protected OptionParser buildOptionParser() {
589593 parser .accepts (NEXT , "(optional) Start the next in a sequence according to the JobParametersIncrementer in the Job" );
590594 parser .accepts (RESTART , "(optional) to restart the last failed execution" );
591595 parser .accepts (STOP , " (optional) to stop a running execution" );
592- parser .accepts (CHUNK_SIZE , "The chunk size of the job" ).withRequiredArg ().defaultsTo ("10" );
596+ parser .accepts (CHUNK_SIZE , "The chunk size of the job" ).withOptionalArg ().defaultsTo ("100" );
597+ parser .accepts (THREAD_COUNT , "The number of threads for the job" ).withOptionalArg ().defaultsTo ("4" );
593598 parser .allowsUnrecognizedOptions ();
594599 return parser ;
595600 }
0 commit comments