YARN-6932. Fix TestFederationRMFailoverProxyProvider test case failure.
(cherry picked from commit 0542e6f86e
)
This commit is contained in:
parent
bb6a1aa5fa
commit
8746a65e78
|
@ -72,8 +72,7 @@ public class FederationRMFailoverProxyProvider<T>
|
|||
this.rmProxy = proxy;
|
||||
this.protocol = proto;
|
||||
this.rmProxy.checkAllowedProtocols(this.protocol);
|
||||
String clusterId =
|
||||
configuration.get(YarnConfiguration.RM_CLUSTER_ID);
|
||||
String clusterId = configuration.get(YarnConfiguration.RM_CLUSTER_ID);
|
||||
Preconditions.checkNotNull(clusterId, "Missing RM ClusterId");
|
||||
this.subClusterId = SubClusterId.newInstance(clusterId);
|
||||
this.facade = facade.getInstance();
|
||||
|
@ -197,7 +196,8 @@ public class FederationRMFailoverProxyProvider<T>
|
|||
}
|
||||
|
||||
private void closeInternal(T currentProxy) {
|
||||
if ((currentProxy != null) && (currentProxy instanceof Closeable)) {
|
||||
if (currentProxy != null) {
|
||||
if (currentProxy instanceof Closeable) {
|
||||
try {
|
||||
((Closeable) currentProxy).close();
|
||||
} catch (IOException e) {
|
||||
|
@ -206,7 +206,7 @@ public class FederationRMFailoverProxyProvider<T>
|
|||
} else {
|
||||
RPC.stopProxy(currentProxy);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue