private List<JobTuningInfo> getJobsTuningInfo(List<TuningJobDefinition> tuningJobs) {

    List<JobTuningInfo> jobTuningInfoList = new ArrayList<JobTuningInfo>();
    for (TuningJobDefinition tuningJobDefinition : tuningJobs) {
      JobDefinition job = tuningJobDefinition.job;
      logger.info("Getting tuning information for job: " + job.jobDefId);
      List<TuningParameter> tuningParameterList = TuningParameter.find.where()
          .eq(TuningParameter.TABLE.tuningAlgorithm + "." + TuningAlgorithm.TABLE.id,
              tuningJobDefinition.tuningAlgorithm.id)
          .eq(TuningParameter.TABLE.isDerived, 0)
          .findList();

        logger.info("Fetching default parameter values for job " + tuningJobDefinition.job.jobDefId);
        JobSuggestedParamSet defaultJobParamSet = JobSuggestedParamSet.find.where()
            .eq(JobSuggestedParamSet.TABLE.jobDefinition + "." + JobDefinition.TABLE.id, tuningJobDefinition.job.id)
            .eq(JobSuggestedParamSet.TABLE.isParamSetDefault, 1)
            .order()
            .desc(JobSuggestedParamSet.TABLE.id)
            .setMaxRows(1)
            .findUnique();

        if (defaultJobParamSet != null) {
          List<JobSuggestedParamValue> jobSuggestedParamValueList = JobSuggestedParamValue.find.where()
              .eq(JobSuggestedParamValue.TABLE.jobSuggestedParamSet + "." + JobExecution.TABLE.id,
                  defaultJobParamSet.id)
              .findList();

          if (jobSuggestedParamValueList.size() > 0) {
            Map<Integer, Double> defaultExecutionParamMap = new HashMap<Integer, Double>();

            for (JobSuggestedParamValue jobSuggestedParamValue : jobSuggestedParamValueList) {
              defaultExecutionParamMap.put(jobSuggestedParamValue.tuningParameter.id,
                  jobSuggestedParamValue.paramValue);
            }

            for (TuningParameter tuningParameter : tuningParameterList) {
              Integer paramId = tuningParameter.id;
              if (defaultExecutionParamMap.containsKey(paramId)) {
                logger.info(
                    "Updating value of param " + tuningParameter.paramName + " to " + defaultExecutionParamMap.get(
                        paramId));
                tuningParameter.defaultValue = defaultExecutionParamMap.get(paramId);
              }
            }
          }
        }

      JobTuningInfo jobTuningInfo = new JobTuningInfo();
      jobTuningInfo.setTuningJob(job);
      jobTuningInfo.setJobType(tuningJobDefinition.tuningAlgorithm.jobType);
      jobTuningInfo.setParametersToTune(tuningParameterList);
      JobSavedState jobSavedState = JobSavedState.find.byId(job.id);

      boolean validSavedState = true;
      if (jobSavedState != null && jobSavedState.isValid()) {
        String savedState = new String(jobSavedState.savedState, Charset.forName("UTF-8"));
        ObjectNode jsonSavedState = (ObjectNode) Json.parse(savedState);
        JsonNode jsonCurrentPopulation = jsonSavedState.get(JSON_CURRENT_POPULATION_KEY);
        List<Particle> currentPopulation = jsonToParticleList(jsonCurrentPopulation);
        for (Particle particle : currentPopulation) {
          Long paramSetId = particle.getParamSetId();

          logger.info("Param set id: " + paramSetId.toString());
          JobSuggestedParamSet jobSuggestedParamSet =
              JobSuggestedParamSet.find.select("*").where().eq(JobSuggestedParamSet.TABLE.id, paramSetId).findUnique();

          if (jobSuggestedParamSet.paramSetState.equals(JobSuggestedParamSet.ParamSetStatus.FITNESS_COMPUTED)
              && jobSuggestedParamSet.fitness != null) {
            particle.setFitness(jobSuggestedParamSet.fitness);
          } else {
            validSavedState = false;
            logger.error("Invalid saved state: Fitness of previous execution not computed.");
            break;
          }
        }

        if (validSavedState) {
          JsonNode updatedJsonCurrentPopulation = particleListToJson(currentPopulation);
          jsonSavedState.set(JSON_CURRENT_POPULATION_KEY, updatedJsonCurrentPopulation);
          savedState = Json.stringify(jsonSavedState);
          jobTuningInfo.setTunerState(savedState);
        }
      } else {
        logger.info("Saved state empty for job: " + job.jobDefId);
        validSavedState = false;
      }

      if (!validSavedState) {
        jobTuningInfo.setTunerState("{}");
      }

      logger.info("Adding JobTuningInfo " + Json.toJson(jobTuningInfo));
      jobTuningInfoList.add(jobTuningInfo);
    }
    return jobTuningInfoList;
  }
Returns the tuning information for the jobs
@param tuningJobs Job List
@return Tuning information list
app/com/linkedin/drelephant/tuning/ParamGenerator.java