Package org.apache.hadoop.yarn.server.webapp.dao

Examples of org.apache.hadoop.yarn.server.webapp.dao.AppsInfo


    Set<String> appStates = parseQueries(statesQuery, true);
    if (!appStates.isEmpty()) {
      checkAppStates = true;
    }

    AppsInfo allApps = new AppsInfo();
    Collection<ApplicationReport> appReports = null;
    try {
      appReports = appContext.getAllApplications().values();
    } catch (IOException e) {
      throw new WebApplicationException(e);
    }
    for (ApplicationReport appReport : appReports) {

      if (checkCount && num == countNum) {
        break;
      }

      if (checkAppStates
          && !appStates.contains(appReport.getYarnApplicationState().toString()
            .toLowerCase())) {
        continue;
      }
      if (finalStatusQuery != null && !finalStatusQuery.isEmpty()) {
        FinalApplicationStatus.valueOf(finalStatusQuery);
        if (!appReport.getFinalApplicationStatus().toString()
          .equalsIgnoreCase(finalStatusQuery)) {
          continue;
        }
      }
      if (userQuery != null && !userQuery.isEmpty()) {
        if (!appReport.getUser().equals(userQuery)) {
          continue;
        }
      }
      if (queueQuery != null && !queueQuery.isEmpty()) {
        if (!appReport.getQueue().equals(queueQuery)) {
          continue;
        }
      }
      if (checkAppTypes
          && !appTypes.contains(appReport.getApplicationType().trim()
            .toLowerCase())) {
        continue;
      }

      if (checkStart
          && (appReport.getStartTime() < sBegin || appReport.getStartTime() > sEnd)) {
        continue;
      }
      if (checkEnd
          && (appReport.getFinishTime() < fBegin || appReport.getFinishTime() > fEnd)) {
        continue;
      }
      AppInfo app = new AppInfo(appReport);

      allApps.add(app);
      num++;
    }
    return allApps;
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.server.webapp.dao.AppsInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.