public static JobContextImpl fromConfigWithDefaults(Config config, JobModel jobModel) {
    JobConfig jobConfig = new JobConfig(config);
    String jobName = jobConfig.getName()
        .orElseThrow(() -> new IllegalArgumentException(String.format("Config %s is missing", JobConfig.JOB_NAME)));
    String jobId = jobConfig.getJobId();
    return new JobContextImpl(config, jobName, jobId, jobModel);
  }
Build a {@link JobContextImpl} from a {@link Config} object.
This extracts some information like job name and job id.

@param config used to extract job information
@param jobModel job model
@return {@link JobContextImpl} corresponding to the {@code config}
@throws IllegalArgumentException if job name is not defined in the {@code config}
samza-core/src/main/java/org/apache/samza/context/JobContextImpl.java