class ApplicationHistoryManagerOnTimelineStore extends AbstractService implements
    ApplicationHistoryManager {

  @Override
  public Map<ApplicationId, ApplicationReport> getApplications(long appsNum)
      throws YarnException, IOException {
    TimelineEntities entities = timelineDataManager.getEntities(
        ApplicationMetricsConstants.ENTITY_TYPE, null, null, null, null, null,
        null, appsNum == Long.MAX_VALUE ? this.maxLoadedApplications : appsNum,
        EnumSet.allOf(Field.class), UserGroupInformation.getLoginUser());
    Map<ApplicationId, ApplicationReport> apps =
        new LinkedHashMap<ApplicationId, ApplicationReport>();
    if (entities != null && entities.getEntities() != null) {
      for (TimelineEntity entity : entities.getEntities()) {
        try {
          ApplicationReportExt app =
              generateApplicationReport(entity, ApplicationReportField.ALL);
          apps.put(app.appReport.getApplicationId(), app.appReport);
        } catch (Exception e) {
          LOG.error("Error on generating application report for " +
              entity.getEntityId(), e);
        }
      }
    }
    return apps;
  }

  public  ApplicationHistoryManagerOnTimelineStore(
      TimelineDataManager timelineDataManager,
      ApplicationACLsManager aclsManager);

}