|
@@ -20,6 +20,8 @@ package org.apache.hadoop.yarn.server.webapp;
|
|
|
|
|
|
import static org.apache.hadoop.yarn.util.StringHelper.join;
|
|
|
import static org.apache.hadoop.yarn.webapp.YarnWebParams.APP_STATE;
|
|
|
+import static org.apache.hadoop.yarn.webapp.YarnWebParams.APP_START_TIME_BEGIN;
|
|
|
+import static org.apache.hadoop.yarn.webapp.YarnWebParams.APP_START_TIME_END;
|
|
|
import static org.apache.hadoop.yarn.webapp.YarnWebParams.APPS_NUM;
|
|
|
import static org.apache.hadoop.yarn.webapp.view.JQueryUI.C_PROGRESSBAR;
|
|
|
import static org.apache.hadoop.yarn.webapp.view.JQueryUI.C_PROGRESSBAR_VALUE;
|
|
@@ -30,6 +32,7 @@ import java.util.Collection;
|
|
|
import java.util.EnumSet;
|
|
|
|
|
|
import org.apache.commons.lang.StringEscapeUtils;
|
|
|
+import org.apache.commons.lang.math.LongRange;
|
|
|
import org.apache.commons.logging.Log;
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
import org.apache.hadoop.security.UserGroupInformation;
|
|
@@ -40,6 +43,7 @@ import org.apache.hadoop.yarn.api.records.ApplicationReport;
|
|
|
import org.apache.hadoop.yarn.api.records.YarnApplicationState;
|
|
|
import org.apache.hadoop.yarn.exceptions.YarnException;
|
|
|
import org.apache.hadoop.yarn.server.webapp.dao.AppInfo;
|
|
|
+import org.apache.hadoop.yarn.webapp.BadRequestException;
|
|
|
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet;
|
|
|
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE;
|
|
|
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TBODY;
|
|
@@ -79,6 +83,32 @@ public class AppsBlock extends HtmlBlock {
|
|
|
long appsNum = Long.parseLong(appsNumStr);
|
|
|
request.setLimit(appsNum);
|
|
|
}
|
|
|
+
|
|
|
+ String appStartedTimeBegainStr = $(APP_START_TIME_BEGIN);
|
|
|
+ long appStartedTimeBegain = 0;
|
|
|
+ if (appStartedTimeBegainStr != null && !appStartedTimeBegainStr.isEmpty()) {
|
|
|
+ appStartedTimeBegain = Long.parseLong(appStartedTimeBegainStr);
|
|
|
+ if (appStartedTimeBegain < 0) {
|
|
|
+ throw new BadRequestException(
|
|
|
+ "app.started-time.begin must be greater than 0");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String appStartedTimeEndStr = $(APP_START_TIME_END);
|
|
|
+ long appStartedTimeEnd = Long.MAX_VALUE;
|
|
|
+ if (appStartedTimeEndStr != null && !appStartedTimeEndStr.isEmpty()) {
|
|
|
+ appStartedTimeEnd = Long.parseLong(appStartedTimeEndStr);
|
|
|
+ if (appStartedTimeEnd < 0) {
|
|
|
+ throw new BadRequestException(
|
|
|
+ "app.started-time.end must be greater than 0");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (appStartedTimeBegain > appStartedTimeEnd) {
|
|
|
+ throw new BadRequestException(
|
|
|
+ "app.started-time.end must be greater than app.started-time.begin");
|
|
|
+ }
|
|
|
+ request.setStartRange(
|
|
|
+ new LongRange(appStartedTimeBegain, appStartedTimeEnd));
|
|
|
+
|
|
|
if (callerUGI == null) {
|
|
|
appReports = appBaseProt.getApplications(request).getApplicationList();
|
|
|
} else {
|