[
https://issues.apache.org/jira/browse/YARN-11217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17675672#comment-17675672
]
ASF GitHub Bot commented on YARN-11217:
---------------------------------------
goiri commented on code in PR #5272:
URL: https://github.com/apache/hadoop/pull/5272#discussion_r1067322003
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/webapp/FederationInterceptorREST.java:
##########
@@ -1145,10 +1147,59 @@ public SchedulerTypeInfo getSchedulerInfo() {
throw new NotImplementedException("Code is not implemented");
}
+ /**
+ * This method dumps the scheduler logs for the time got in input, and it is
+ * reachable by using {@link RMWSConsts#SCHEDULER_LOGS}.
+ *
+ * @param time the period of time. It is a FormParam.
+ * @param hsr the servlet request
+ * @return the result of the operation
+ * @throws IOException when it cannot create dump log file
+ */
@Override
public String dumpSchedulerLogs(String time, HttpServletRequest hsr)
throws IOException {
- throw new NotImplementedException("Code is not implemented");
+
+ if (StringUtils.isBlank(time)) {
+ routerMetrics.incrDumpSchedulerLogsFailedRetrieved();
+ throw new IllegalArgumentException("Parameter error, the time is empty
or null.");
+ }
+
+ int period = Integer.parseInt(time);
Review Comment:
I was thinking we could just capture the exception for the parseInt, no?
> [Federation] Add dumpSchedulerLogs REST APIs for Router
> -------------------------------------------------------
>
> Key: YARN-11217
> URL: https://issues.apache.org/jira/browse/YARN-11217
> Project: Hadoop YARN
> Issue Type: Sub-task
> Affects Versions: 3.4.0, 3.3.4
> Reporter: Shilun Fan
> Assignee: Shilun Fan
> Priority: Major
> Labels: pull-request-available
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]