You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Xiaoyu Yao (Jira)" <ji...@apache.org> on 2020/05/12 23:33:00 UTC
[jira] [Resolved] (HDDS-3560) HDDS-3560 OMFailoverProxyProvider
throws IllegalAccessError when assigning proxy with Hadoop version < 3.2
[ https://issues.apache.org/jira/browse/HDDS-3560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Xiaoyu Yao resolved HDDS-3560.
------------------------------
Fix Version/s: 0.6.0
Resolution: Fixed
Thanks [~maobaolong] for the contribution. I've merged the PR.
> HDDS-3560 OMFailoverProxyProvider throws IllegalAccessError when assigning proxy with Hadoop version < 3.2
> -----------------------------------------------------------------------------------------------------------
>
> Key: HDDS-3560
> URL: https://issues.apache.org/jira/browse/HDDS-3560
> Project: Hadoop Distributed Data Store
> Issue Type: Bug
> Components: om, Ozone Client
> Affects Versions: 0.6.0
> Reporter: maobaolong
> Assignee: maobaolong
> Priority: Major
> Labels: pull-request-available
> Fix For: 0.6.0
>
>
> 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`.
> {code:java}
> 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);
> }
> }
> }
> {code}
> But, hadoop lower than 3.2, the field proxy of proxyInfo is marked as final.
> {code:java}
> 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;
> ...
> }
> {code}
> So, if we want to work around, we should catch the exception and new a ProxyInfo instance instead.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org