[ https://issues.apache.org/jira/browse/YARN-11515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17736645#comment-17736645 ]
ASF GitHub Bot commented on YARN-11515: --------------------------------------- goiri commented on code in PR #5752: URL: https://github.com/apache/hadoop/pull/5752#discussion_r1240548197 ########## hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/DefaultClientRequestInterceptor.java: ########## @@ -107,25 +109,25 @@ */ public class DefaultClientRequestInterceptor extends AbstractClientRequestInterceptor { + private static final Logger LOG = + LoggerFactory.getLogger(DefaultClientRequestInterceptor.class); private ApplicationClientProtocol clientRMProxy; @Override public void init(String userName) { super.init(userName); - - final Configuration conf = this.getConf(); try { - clientRMProxy = - user.doAs(new PrivilegedExceptionAction<ApplicationClientProtocol>() { - @Override - public ApplicationClientProtocol run() throws Exception { - return ClientRMProxy.createRMProxy(conf, - ApplicationClientProtocol.class); - } - }); + final Configuration conf = this.getConf(); + clientRMProxy = user.doAs( + (PrivilegedExceptionAction<ApplicationClientProtocol>) () -> + ClientRMProxy.createRMProxy(conf, ApplicationClientProtocol.class)); } catch (Exception e) { - throw new YarnRuntimeException( - "Unable to create the interface to reach the YarnRM", e); + String message = "Error while creating Router RMClient Service"; Review Comment: StringBuilder? > [Federation] Improve DefaultRequestInterceptor#init Code > -------------------------------------------------------- > > Key: YARN-11515 > URL: https://issues.apache.org/jira/browse/YARN-11515 > Project: Hadoop YARN > Issue Type: Improvement > Components: federation, router > Affects Versions: 3.4.0 > Reporter: Shilun Fan > Assignee: Shilun Fan > Priority: Minor > Labels: pull-request-available > > If we do not enable Federation mode, the YARN Router can also act as a proxy > for the YARN ResourceManager. In this case, we can achieve this functionality > by configuring the DefaultRequestInterceptor. While reading the code, I > found that the Init code could be improved. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org