Add all the mappings from the JobExecutionContext to the JobContext

@param jobExecutionContext
170828
public void addQuartzContext(JobExecutionContext jobExecutionContext) {

    for (Object mapKey : jobExecutionContext.getMergedJobDataMap().keySet()) {
      // logger.debug("added key: " + (String) mapKey);
      // logger.debug("added value: " + (String)
      // jobExecutionContext.getMergedJobDataMap().get(mapKey));
      map.put((String) mapKey, jobExecutionContext.getMergedJobDataMap().get(mapKey));
    }
    map.put(KEY_JOB_NAME, jobExecutionContext.getJobDetail().getName());
    map.put(KEY_TRIGGER_NAME, (jobExecutionContext.getTrigger().getName()));
    if (jobExecutionContext.getTrigger() instanceof CronTrigger) {
      map.put(
          KEY_TRIGGER_CRON_EXPRESSION,
          ((CronTrigger) jobExecutionContext.getTrigger()).getCronExpression());
    }
  }
300009
private List<JobExecutionInfo> executeQuery(JobExecutionQuery query) throws RemoteInvocationException {
    JobExecutionQueryResult result = this.client.get(query);

    if (result != null && result.hasJobExecutions()) {
      return result.getJobExecutions();
    }
    return Collections.emptyList();
  }
20540
public static void addInputContext(Job job, String inputName, String key, String value, int inputId) {
    // Check that this named output has been configured before
    Configuration conf = job.getConfiguration();
    // Add specific configuration
    conf.set(MI_PREFIX + inputName + "." + inputId + CONF + "." + key, value);
  }
608689
public void addProperty(JobProperty<? super JobT> jobProp) throws IOException {
        ((JobProperty)jobProp).setOwner(this);
        properties.add(jobProp);
        save();
    }
1049109
protected void removeExecutionLink(TimerJobEntity jobEntity) {
        if (jobEntity.getExecutionId() != null) {
            ExecutionEntity execution = getExecutionEntityManager().findById(jobEntity.getExecutionId());
            if (execution != null) {
                execution.getTimerJobs().remove(jobEntity);
            }
        }
    }
29032
private void addExecutionGoals(MavenPluginExecutionDescriptor executionDescriptor, PluginExecution pluginExecution, Store store) {
        List<String> goals = pluginExecution.getGoals();
        for (String goal : goals) {
            MavenExecutionGoalDescriptor goalDescriptor = store.create(MavenExecutionGoalDescriptor.class);
            goalDescriptor.setName(goal);
            executionDescriptor.getGoals().add(goalDescriptor);
        }

    }
1266162
@Override
  public Map<WorkerInfo, ArrayList<MigrateCommand>> selectExecutors(MigrateConfig config,
      List<WorkerInfo> jobWorkerInfoList, SelectExecutorsContext context) throws Exception {
    AlluxioURI source = new AlluxioURI(config.getSource());
    AlluxioURI destination = new AlluxioURI(config.getDestination());
    if (source.equals(destination)) {
      return new HashMap<>();
    }
    checkMigrateValid(config, context.getFileSystem());
    Preconditions.checkState(!jobWorkerInfoList.isEmpty(), "No workers are available");

    List<URIStatus> allPathStatuses = getPathStatuses(source, context.getFileSystem());
    ConcurrentMap<WorkerInfo, ArrayList<MigrateCommand>> assignments = Maps.newConcurrentMap();
    ConcurrentMap<String, WorkerInfo> hostnameToWorker = Maps.newConcurrentMap();
    for (WorkerInfo workerInfo : jobWorkerInfoList) {
      hostnameToWorker.put(workerInfo.getAddress().getHost(), workerInfo);
    }
    List<BlockWorkerInfo> alluxioWorkerInfoList =
        AlluxioBlockStore.create(context.getFsContext()).getAllWorkers();
    // Assign each file to the worker with the most block locality.
    for (URIStatus status : allPathStatuses) {
      if (status.isFolder()) {
        migrateDirectory(status.getPath(), source.getPath(), destination.getPath(),
            context.getFileSystem());
      } else {
        WorkerInfo bestJobWorker =
            getBestJobWorker(status, alluxioWorkerInfoList, jobWorkerInfoList, hostnameToWorker);
        String destinationPath =
            computeTargetPath(status.getPath(), source.getPath(), destination.getPath());
        assignments.putIfAbsent(bestJobWorker, Lists.newArrayList());
        assignments.get(bestJobWorker).add(new MigrateCommand(status.getPath(), destinationPath));
      }
    }
    return assignments;
  }
904198
private void checkConfiguration(JobExecutorXml jobExecutorXml) {
    Map<String, String> properties = jobExecutorXml.getProperties();
    for (Entry<String, String> entry : properties.entrySet()) {
      LOGGER.warning("Property " + entry.getKey() + " with value " + entry.getValue() + " from bpm-platform.xml will be ignored for JobExecutor.");
    }
  }
1090566
public void addInvolvedExecution(ExecutionEntity executionEntity) {
        if (executionEntity.getId() != null) {
            involvedExecutions.put(executionEntity.getId(),
                                   executionEntity);
        }
    }
45613
@Override
    public <E extends Exception> void add(Iteration<? extends Statement, E> statements, Resource... contexts) throws RepositoryException, E {
        while(statements.hasNext()){
            Statement st = statements.next();
            add(st.getSubject(), st.getPredicate(), st.getObject(), mergeResource(st.getContext(), contexts));
        }
    }
801258
@Override
  public void commitJob(JobContext context) throws IOException {
    super.commitJob(context);

    // Get the destination configuration information.
    Configuration conf = context.getConfiguration();
    TableReference destTable = BigQueryOutputConfiguration.getTableReference(conf);
    String destProjectId = BigQueryOutputConfiguration.getProjectId(conf);
    String writeDisposition = BigQueryOutputConfiguration.getWriteDisposition(conf);
    Optional<BigQueryTableSchema> destSchema = BigQueryOutputConfiguration.getTableSchema(conf);
    String kmsKeyName = BigQueryOutputConfiguration.getKmsKeyName(conf);
    BigQueryFileFormat outputFileFormat = BigQueryOutputConfiguration.getFileFormat(conf);
    List<String> sourceUris = getOutputFileURIs();

    try {
      getBigQueryHelper()
          .importFromGcs(
              destProjectId,
              destTable,
              destSchema.isPresent() ? destSchema.get().get() : null,
              kmsKeyName,
              outputFileFormat,
              writeDisposition,
              sourceUris,
              true);
    } catch (InterruptedException e) {
      throw new IOException("Failed to import GCS into BigQuery", e);
    }

    cleanup(context);
  }
974036
public static void init(String jobId) {
        JobContext parent = current_.get();
        JobContext ctx = new JobContext(parent);
        current_.set(ctx);
        // don't call setJobId(String)
        // as it will trigger listeners -- TODO fix me
        ctx.jobId = jobId;
        if (null == parent) {
            Act.eventBus().trigger(new JobContextInitialized(ctx));
        }
    }
220963
public JobExecutionInfo toJobExecutionInfo() {
    JobExecutionInfo jobExecutionInfo = new JobExecutionInfo();

    jobExecutionInfo.setJobName(this.jobName);
    jobExecutionInfo.setJobId(this.jobId);
    if (this.startTime > 0) {
      jobExecutionInfo.setStartTime(this.startTime);
    }
    if (this.endTime > 0) {
      jobExecutionInfo.setEndTime(this.endTime);
    }
    jobExecutionInfo.setDuration(this.duration);
    jobExecutionInfo.setState(JobStateEnum.valueOf(this.state.name()));
    jobExecutionInfo.setLaunchedTasks(this.taskCount);
    jobExecutionInfo.setCompletedTasks(this.getCompletedTasks());
    jobExecutionInfo.setLauncherType(getLauncherType());
    if (getTrackingURL().isPresent()) {
      jobExecutionInfo.setTrackingUrl(getTrackingURL().get());
    }

    // Add task execution information
    TaskExecutionInfoArray taskExecutionInfos = new TaskExecutionInfoArray();
    for (TaskState taskState : this.getTaskStates()) {
      taskExecutionInfos.add(taskState.toTaskExecutionInfo());
    }
    jobExecutionInfo.setTaskExecutions(taskExecutionInfos);

    // Add job metrics
    JobMetrics jobMetrics = JobMetrics.get(this);
    MetricArray metricArray = new MetricArray();

    for (Map.Entry<String, ? extends com.codahale.metrics.Metric> entry : jobMetrics.getMetricContext().getCounters()
        .entrySet()) {
      Metric counter = new Metric();
      counter.setGroup(MetricGroup.JOB.name());
      counter.setName(entry.getKey());
      counter.setType(MetricTypeEnum.valueOf(GobblinMetrics.MetricType.COUNTER.name()));
      counter.setValue(Long.toString(((Counter) entry.getValue()).getCount()));
      metricArray.add(counter);
    }

    for (Map.Entry<String, ? extends com.codahale.metrics.Metric> entry : jobMetrics.getMetricContext().getMeters()
        .entrySet()) {
      Metric meter = new Metric();
      meter.setGroup(MetricGroup.JOB.name());
      meter.setName(entry.getKey());
      meter.setType(MetricTypeEnum.valueOf(GobblinMetrics.MetricType.METER.name()));
      meter.setValue(Double.toString(((Meter) entry.getValue()).getMeanRate()));
      metricArray.add(meter);
    }

    for (Map.Entry<String, ? extends com.codahale.metrics.Metric> entry : jobMetrics.getMetricContext().getGauges()
        .entrySet()) {
      Metric gauge = new Metric();
      gauge.setGroup(MetricGroup.JOB.name());
      gauge.setName(entry.getKey());
      gauge.setType(MetricTypeEnum.valueOf(GobblinMetrics.MetricType.GAUGE.name()));
      gauge.setValue(((Gauge<?>) entry.getValue()).getValue().toString());
      metricArray.add(gauge);
    }

    jobExecutionInfo.setMetrics(metricArray);

    // Add job properties
    Map<String, String> jobProperties = Maps.newHashMap();
    for (String name : this.getPropertyNames()) {
      String value = this.getProp(name);
      if (!Strings.isNullOrEmpty(value)) {
        jobProperties.put(name, value);
      }
    }
    jobExecutionInfo.setJobProperties(new StringMap(jobProperties));

    return jobExecutionInfo;
  }
111708
public void addPluginClass(final String jobTypeName,
      final Class<? extends Job> jobTypeClass) {
    this.jobToClass.put(jobTypeName, jobTypeClass);
  }
962775
public void setKeyPhrasesDetectionJobPropertiesList(java.util.Collection<KeyPhrasesDetectionJobProperties> keyPhrasesDetectionJobPropertiesList) {
        if (keyPhrasesDetectionJobPropertiesList == null) {
            this.keyPhrasesDetectionJobPropertiesList = null;
            return;
        }

        this.keyPhrasesDetectionJobPropertiesList = new java.util.ArrayList<KeyPhrasesDetectionJobProperties>(keyPhrasesDetectionJobPropertiesList);
    }
979494
@Override
	public RuntimeJobExecution createJobExecution(JobInstance jobInstance, Properties jobParameters, BatchStatus batchStatus) {
		Timestamp now = new Timestamp(System.currentTimeMillis());
		long newExecutionId = createRuntimeJobExecutionEntry(jobInstance, jobParameters, batchStatus, now);
		RuntimeJobExecution jobExecution = new RuntimeJobExecution(jobInstance, newExecutionId);
		jobExecution.setBatchStatus(batchStatus.name());
		jobExecution.setCreateTime(now);
		jobExecution.setLastUpdateTime(now);
		return jobExecution;
	}
554784
@Override
    public WSJobExecution updateJobExecutionAndInstanceNotSetToServerYet(
                                                                         long jobExecutionId, Date date) throws ExecutionAssignedToServerException {
        return updateJobExecutionAndInstanceOnStopBeforeServerAssigned(jobExecutionId, date);
    }