private static List < ? extends Tag < ? > > addAdditionalMetadataTags ( Properties jobProps , List < ? extends Tag < ? > > inputTags ) { List < Tag < ? > > metadataTags = Lists . newArrayList ( inputTags ) ; String jobId ; // generate job id if not already set if ( jobProps . containsKey ( ConfigurationKeys . JOB_ID_KEY ) ) { jobId = jobProps . getProperty ( ConfigurationKeys . JOB_ID_KEY ) ; } else { jobId = JobLauncherUtils . newJobId ( JobState . getJobNameFromProps ( jobProps ) ) ; jobProps . put ( ConfigurationKeys . JOB_ID_KEY , jobId ) ; } String jobExecutionId = Long . toString ( Id . Job . parse ( jobId ) . getSequence ( ) ) ; // only inject flow tags if a flow name is defined if ( jobProps . containsKey ( ConfigurationKeys . FLOW_NAME_KEY ) ) { metadataTags . add ( new Tag <> ( TimingEvent . FlowEventConstants . FLOW_GROUP_FIELD , jobProps . getProperty ( ConfigurationKeys . FLOW_GROUP_KEY , "" ) ) ) ; metadataTags . add ( new Tag <> ( TimingEvent . FlowEventConstants . FLOW_NAME_FIELD , jobProps . getProperty ( ConfigurationKeys . FLOW_NAME_KEY ) ) ) ; // use job execution id if flow execution id is not present metadataTags . add ( new Tag <> ( TimingEvent . FlowEventConstants . FLOW_EXECUTION_ID_FIELD , jobProps . getProperty ( ConfigurationKeys . FLOW_EXECUTION_ID_KEY , jobExecutionId ) ) ) ; } metadataTags . add ( new Tag <> ( TimingEvent . FlowEventConstants . JOB_GROUP_FIELD , jobProps . getProperty ( ConfigurationKeys . JOB_GROUP_KEY , "" ) ) ) ; metadataTags . add ( new Tag <> ( TimingEvent . FlowEventConstants . JOB_NAME_FIELD , jobProps . getProperty ( ConfigurationKeys . JOB_NAME_KEY , "" ) ) ) ; metadataTags . add ( new Tag <> ( TimingEvent . FlowEventConstants . JOB_EXECUTION_ID_FIELD , jobExecutionId ) ) ; LOGGER . debug ( "GobblinHelixJobLauncher.addAdditionalMetadataTags: metadataTags {}" , metadataTags ) ; return metadataTags ; }
Inject in some additional properties