public static Builder builder ( URI catalogURI , Properties jobProps ) { String name = JobState . getJobNameFromProps ( jobProps ) ; String group = JobState . getJobGroupFromProps ( jobProps ) ; if ( null == group ) { group = "default" ; } try { URI jobURI = new URI ( catalogURI . getScheme ( ) , catalogURI . getAuthority ( ) , "/" + group + "/" + name , null ) ; Builder builder = new Builder ( jobURI ) . withConfigAsProperties ( jobProps ) ; String descr = JobState . getJobDescriptionFromProps ( jobProps ) ; if ( null != descr ) { builder . withDescription ( descr ) ; } return builder ; } catch ( URISyntaxException e ) { throw new RuntimeException ( "Unable to create a JobSpec URI: " + e , e ) ; } }
Creates a builder for the JobSpec based on values in a job properties config .