@VisibleForTesting
  void fetchJobsFromSecondRetryQueue(List<AnalyticJob> appList) {
    synchronized (_secondRetryQueue) {
      Iterator iteratorSecondRetry = _secondRetryQueue.iterator();
      while (iteratorSecondRetry.hasNext()) {
        AnalyticJob job = (AnalyticJob) iteratorSecondRetry.next();
        if (job.readyForSecondRetry()) {
          appList.add(job);
          iteratorSecondRetry.remove();
        }
      }
    }
  }
Fetch all the succeeded and failed applications/analytic jobs from the resource manager.

@return a list of {@link AnalyticJob} objects based on applications fetched from RM.
@throws IOException
@throws AuthenticationException
app/com/linkedin/drelephant/analysis/AnalyticJobGeneratorHadoop2.java