goiri commented on a change in pull request #1399: HADOOP-16543: Cached DNS
name resolution error
URL: https://github.com/apache/hadoop/pull/1399#discussion_r323564912
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/RMProxy.java
##########
@@ -154,19 +151,44 @@ public T run() {
});
}
+
+ /**
+ * Helper method to create non-HA RMFailoverProxyProvider.
+ */
+ private <T> RMFailoverProxyProvider<T> createNonHaRMFailoverProxyProvider(
+ Configuration conf, Class<T> protocol) {
+ String defaultProviderClassName =
+ YarnConfiguration.DEFAULT_CLIENT_FAILOVER_NO_HA_PROXY_PROVIDER;
+ Class<? extends RMFailoverProxyProvider<T>> defaultProviderClass;
+ try {
+ defaultProviderClass = (Class<? extends RMFailoverProxyProvider<T>>)
+ Class.forName(defaultProviderClassName);
+ } catch (Exception e) {
+ throw new YarnRuntimeException("Invalid default failover provider class"
+
+ defaultProviderClassName, e);
+ }
+
+ RMFailoverProxyProvider<T> provider = ReflectionUtils.newInstance(
+ conf.getClass(YarnConfiguration.CLIENT_FAILOVER_NO_HA_PROXY_PROVIDER,
+ defaultProviderClass, RMFailoverProxyProvider.class), conf);
+ provider.init(conf, (RMProxy<T>) this, protocol);
+ return provider;
+ }
+
/**
* Helper method to create FailoverProxyProvider.
*/
private <T> RMFailoverProxyProvider<T> createRMFailoverProxyProvider(
Configuration conf, Class<T> protocol) {
+ String defaultProviderClassName =
Review comment:
Not sure is worth doing this change.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]