Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.0.0
Description
The method createOMProxyIfNeeded of OMFailoverProxyProvider will throw IllegalAccessError when work with hadoop version lower than 3.2.
The following is the problem code, it want assign a proxy to `proxyInfo.proxy`.
private void createOMProxyIfNeeded(ProxyInfo proxyInfo, String nodeId) { if (proxyInfo.proxy == null) { InetSocketAddress address = omProxyInfos.get(nodeId).getAddress(); try { proxyInfo.proxy = createOMProxy(address); } catch (IOException ioe) { LOG.error("{} Failed to create RPC proxy to OM at {}", this.getClass().getSimpleName(), address, ioe); throw new RuntimeException(ioe); } } }
But, hadoop lower than 3.2, the field proxy of proxyInfo is marked as final.
public static final class ProxyInfo<T> { public final T proxy; /* * The information (e.g., the IP address) of the current proxy object. It * provides information for debugging purposes. */ public final String proxyInfo; ... }
So, if we want to work around, we should catch the exception and new a ProxyInfo instance instead.
Attachments
Issue Links
- links to