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

Examples of org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppInfo


      }
      if (checkEnd
          && (rmapp.getFinishTime() < fBegin || rmapp.getFinishTime() > fEnd)) {
        continue;
      }
      AppInfo app = new AppInfo(rmapp, hasAccess(rmapp, hsr));

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


    }
    RMApp app = rm.getRMContext().getRMApps().get(id);
    if (app == null) {
      throw new NotFoundException("app with id: " + appId + " not found");
    }
    return new AppInfo(app, hasAccess(app, hsr));
  }
View Full Code Here

            .equalsIgnoreCase(finalStatusQuery)) {
          continue;
        }
      }

      AppInfo app = new AppInfo(rmapp, hasAccess(rmapp, hsr),
          WebAppUtils.getHttpSchemePrefix(conf));
      allApps.add(app);
    }
    return allApps;
  }
View Full Code Here

    }
    RMApp app = rm.getRMContext().getRMApps().get(id);
    if (app == null) {
      throw new NotFoundException("app with id: " + appId + " not found");
    }
    return new AppInfo(app, hasAccess(app, hsr), hsr.getScheme() + "://");
  }
View Full Code Here

    StringBuilder appsTableData = new StringBuilder("[\n");
    for (RMApp app : apps.values()) {
      if (reqAppStates != null && !reqAppStates.contains(app.createApplicationState())) {
        continue;
      }
      AppInfo appInfo = new AppInfo(app, true, WebAppUtils.getHttpSchemePrefix(conf));
      String percent = String.format("%.1f", appInfo.getProgress());
      ApplicationAttemptId attemptId = app.getCurrentAppAttempt().getAppAttemptId();
      int fairShare = fsinfo.getAppFairShare(attemptId);
      //AppID numerical value parsed by parseHadoopID in yarn.dt.plugins.js
      appsTableData.append("[\"<a href='")
      .append(url("app", appInfo.getAppId())).append("'>")
      .append(appInfo.getAppId()).append("</a>\",\"")
      .append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
        appInfo.getUser()))).append("\",\"")
      .append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
        appInfo.getName()))).append("\",\"")
      .append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
        appInfo.getApplicationType()))).append("\",\"")
      .append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
        appInfo.getQueue()))).append("\",\"")
      .append(fairShare).append("\",\"")
      .append(appInfo.getStartTime()).append("\",\"")
      .append(appInfo.getFinishTime()).append("\",\"")
      .append(appInfo.getState()).append("\",\"")
      .append(appInfo.getFinalStatus()).append("\",\"")
      // Progress bar
      .append("<br title='").append(percent)
      .append("'> <div class='").append(C_PROGRESSBAR).append("' title='")
      .append(join(percent, '%')).append("'> ").append("<div class='")
      .append(C_PROGRESSBAR_VALUE).append("' style='")
      .append(join("width:", percent, '%')).append("'> </div> </div>")
      .append("\",\"<a href='");

      String trackingURL =
        !appInfo.isTrackingUrlReady()? "#" : appInfo.getTrackingUrlPretty();
     
      appsTableData.append(trackingURL).append("'>")
      .append(appInfo.getTrackingUI()).append("</a>\"],\n");

    }
    if(appsTableData.charAt(appsTableData.length() - 2) == ',') {
      appsTableData.delete(appsTableData.length()-2, appsTableData.length()-1);
    }
View Full Code Here

      // TODO: handle redirect to jobhistory server
      setStatus(HttpServletResponse.SC_NOT_FOUND);
      setTitle("Application not found: "+ aid);
      return;
    }
    AppInfo app = new AppInfo(rmApp, true);

    // Check for the authorization.
    String remoteUser = request().getRemoteUser();
    UserGroupInformation callerUGI = null;
    if (remoteUser != null) {
      callerUGI = UserGroupInformation.createRemoteUser(remoteUser);
    }
    if (callerUGI != null
        && !this.aclsManager.checkAccess(callerUGI,
            ApplicationAccessType.VIEW_APP, app.getUser(), appID)) {
      setStatus(HttpServletResponse.SC_UNAUTHORIZED);
      setTitle("Unauthorized request for viewing application " + appID);
      renderText("You (User " + remoteUser
          + ") are not authorized to view the logs for application " + appID);
      return;
    }

    setTitle(join("Application ", aid));

    ResponseInfo info = info("Application Overview").
      _("User:", app.getUser()).
      _("Name:", app.getName()).
      _("State:", app.getState()).
      _("FinalStatus:", app.getFinalStatus()).
      _("Started:", Times.format(app.getStartTime())).
      _("Elapsed:", StringUtils.formatTime(
        Times.elapsed(app.getStartTime(), app.getFinishTime()))).
      _("Tracking URL:", !app.isTrackingUrlReady() ?
        "#" : app.getTrackingUrlPretty(), app.getTrackingUI()).
      _("Diagnostics:", app.getNote());
    if (app.amContainerLogsExist()) {
      info._("AM container logs:", app.getAMContainerLogs(), app.getAMContainerLogs());
    } else {
      info._("AM container logs:", "");
    }
    render(AppPage.class);
  }
View Full Code Here

    reqState = (reqState == null ? "" : reqState);
    for (RMApp app : list.apps.values()) {
      if (!reqState.isEmpty() && app.getState() != RMAppState.valueOf(reqState)) {
        continue;
      }
      AppInfo appInfo = new AppInfo(app, true);
      String percent = String.format("%.1f", appInfo.getProgress());
      String startTime = Times.format(appInfo.getStartTime());
      String finishTime = Times.format(appInfo.getFinishTime());
      tbody.
        tr().
          td().
            br().$title(appInfo.getAppIdNum())._(). // for sorting
            a(url("app", appInfo.getAppId()), appInfo.getAppId())._().
          td(appInfo.getUser()).
          td(appInfo.getName()).
          td(appInfo.getQueue()).
          td().
            br().$title(startTime)._()._(startTime)._().
          td().
          br().$title(finishTime)._()._(finishTime)._().
          td(appInfo.getState()).
          td(appInfo.getFinalStatus()).
          td().
            br().$title(percent)._(). // for sorting
            div(_PROGRESSBAR).
              $title(join(percent, '%')). // tooltip
              div(_PROGRESSBAR_VALUE).
                $style(join("width:", percent, '%'))._()._()._().
          td().
            a(!appInfo.isTrackingUrlReady()?
              "#" : appInfo.getTrackingUrlPretty(), appInfo.getTrackingUI())._()._();
      if (list.rendering != Render.HTML && ++i >= 20) break;
    }
    tbody._()._();

    if (list.rendering == Render.JS_ARRAY) {
View Full Code Here

    AppsInfo allApps = new AppsInfo();
    for (RMApp rmapp : apps.values()) {
      if (checkCount && num == countNum) {
        break;
      }
      AppInfo app = new AppInfo(rmapp, hasAccess(rmapp, hsr));

      if (stateQuery != null && !stateQuery.isEmpty()) {
        RMAppState.valueOf(stateQuery);
        if (!app.getState().equalsIgnoreCase(stateQuery)) {
          continue;
        }
      }
      if (userQuery != null && !userQuery.isEmpty()) {
        if (!app.getUser().equals(userQuery)) {
          continue;
        }
      }
      if (queueQuery != null && !queueQuery.isEmpty()) {
        ResourceScheduler rs = rm.getResourceScheduler();
        if (rs instanceof CapacityScheduler) {
          CapacityScheduler cs = (CapacityScheduler) rs;
          // validate queue exists
          try {
            cs.getQueueInfo(queueQuery, false, false);
          } catch (IOException e) {
            throw new BadRequestException(e.getMessage());
          }
        }
        if (!app.getQueue().equals(queueQuery)) {
          continue;
        }
      }

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

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

    }
    RMApp app = rm.getRMContext().getRMApps().get(id);
    if (app == null) {
      throw new NotFoundException("app with id: " + appId + " not found");
    }
    return new AppInfo(app, hasAccess(app, hsr));
  }
View Full Code Here

    for (RMApp app : apps.values()) {
      if (requiredAppState != null && !requiredAppState.isEmpty()
          && app.getState() != RMAppState.valueOf(requiredAppState)) {
        continue;
      }
      AppInfo appInfo = new AppInfo(app, true);
      String startTime = Times.format(appInfo.getStartTime());
      String finishTime = Times.format(appInfo.getFinishTime());
      if (first) {
        first = false;
      } else {
        out.append(",\n");
      }
      out.append("[\"");
      appendSortable(out, appInfo.getAppIdNum());
      appendLink(out, appInfo.getAppId(), rc.prefix(), "app",
          appInfo.getAppId()).append(_SEP).
          append(escapeHtml(appInfo.getUser())).append(_SEP).
          append(escapeJavaScript(escapeHtml(appInfo.getName()))).append(_SEP).
          append(escapeHtml(appInfo.getQueue())).append(_SEP);
      appendSortable(out, startTime).append(startTime).append(_SEP);
      appendSortable(out, finishTime).append(finishTime).append(_SEP).
          append(appInfo.getState()).append(_SEP).
          append(appInfo.getFinalStatus()).append(_SEP);
      appendProgressBar(out, appInfo.getProgress()).append(_SEP);
      appendLink(out, appInfo.getTrackingUI(), rc.prefix(),
          !appInfo.isTrackingUrlReady() ?
            "#" : appInfo.getTrackingUrlPretty()).
          append("\"]");
    }
    out.append(']');
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppInfo

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.