slfan1989 commented on code in PR #5722:
URL: https://github.com/apache/hadoop/pull/5722#discussion_r1223299403
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/RMProxy.java:
##########
@@ -116,6 +116,28 @@ protected static <T> T createRMProxy(final Configuration
configuration,
return newProxyInstance(conf, protocol, instance, retryPolicy);
}
+ /**
+ * Currently, used by NodeManagers only.
+ *
+ * @param configuration configuration.
+ * @param protocol protocol.
+ * @param instance RMProxy instance.
+ * @return RMProxy.
+ * @param <T> Generic T.
+ * @throws IOException io error occur.
+ */
+ protected static <T> T createRMProxyFederation(final Configuration
configuration,
+ final Class<T> protocol, RMProxy<T> instance) throws IOException {
+ YarnConfiguration yarnConf =
+ (configuration instanceof YarnConfiguration) ? (YarnConfiguration)
configuration :
+ new YarnConfiguration(configuration);
+ if(isFederationNonHAEnabled(yarnConf)){
+ RetryPolicy retryPolicy = createRetryPolicy(yarnConf, true);
+ return newProxyInstance(yarnConf, protocol, instance, retryPolicy);
+ }
+ return createRMProxy(configuration, protocol, instance);
Review Comment:
I will add unit tests as soon as possible.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]