private List<TuningJobExecutionParamSet> getCompletedJobExecutionParamSets() {
    logger.info("Fetching completed executions whose fitness are yet to be computed");
    List<TuningJobExecutionParamSet> completedJobExecutionParamSet = new ArrayList<TuningJobExecutionParamSet>();

      List<TuningJobExecutionParamSet> tuningJobExecutionParamSets = TuningJobExecutionParamSet.find.select("*")
          .fetch(TuningJobExecutionParamSet.TABLE.jobExecution, "*")
          .fetch(TuningJobExecutionParamSet.TABLE.jobSuggestedParamSet, "*")
          .where()
          .or(Expr.or(Expr.eq(TuningJobExecutionParamSet.TABLE.jobExecution + '.' + JobExecution.TABLE.executionState,
              JobExecution.ExecutionState.SUCCEEDED),
              Expr.eq(TuningJobExecutionParamSet.TABLE.jobExecution + '.' + JobExecution.TABLE.executionState,
                  JobExecution.ExecutionState.FAILED)),
              Expr.eq(TuningJobExecutionParamSet.TABLE.jobExecution + '.' + JobExecution.TABLE.executionState,
                  JobExecution.ExecutionState.CANCELLED))
          .isNull(TuningJobExecutionParamSet.TABLE.jobExecution + '.' + JobExecution.TABLE.resourceUsage)
          .findList();

      logger.info("#completed executions whose metrics are not computed: " + tuningJobExecutionParamSets.size());

      for (TuningJobExecutionParamSet tuningJobExecutionParamSet : tuningJobExecutionParamSets) {
        JobExecution jobExecution = tuningJobExecutionParamSet.jobExecution;
        long diff = System.currentTimeMillis() - jobExecution.updatedTs.getTime();
        logger.info("Current Time in millis: " + System.currentTimeMillis() + ", Job execution last updated time "
            + jobExecution.updatedTs.getTime());
        if (diff < fitnessComputeWaitInterval) {
          logger.info("Delaying fitness compute for execution: " + jobExecution.jobExecId);
        } else {
          logger.info("Adding execution " + jobExecution.jobExecId + " to fitness computation queue");
          completedJobExecutionParamSet.add(tuningJobExecutionParamSet);
        }
      }
    logger.info(
        "Number of completed execution fetched for fitness computation: " + completedJobExecutionParamSet.size());
    return completedJobExecutionParamSet;
  }
Returns the list of completed executions whose metrics are not computed
@return List of job execution
app/com/linkedin/drelephant/tuning/FitnessComputeUtil.java