[Java] Provide default setting of io.netty.tryReflectionSetAccessible=true
- 主要语言
- Java
- 星标
- 94
- 派生
- 152
- 平均合并
- 3 天 16 小时
- 30 天内合并 PR
- 11
描述
After ARROW-3191, consumers of Arrow Java with a JDK 9 and above are required to set the JVM property "io.netty.tryReflectionSetAccessible=true" at startup, each time Arrow code is run, as documented at https://github.com/apache/arrow/tree/master/java#java-properties. Not doing this will result in the error "java.lang.UnsupportedOperationException: sun.misc.Unsafe or java.nio.DirectByteBuffer.(long, int) not available", making Arrow unusable out-of-the-box.
This proposes to automatically set the property if not already set in the following steps:
1) check to see if the property io.netty.tryReflectionSetAccessible has been set
2) if not set, automatically set to "true"
3) else if set to "false", catch the Netty error and prepend the error message with the suggested setting of "true"
**Reporter**: [Bryan Cutler](https://issues.apache.org/jira/browse/ARROW-7223) / @BryanCutler
#### Related issues:
- [Document Arrow requirement in JDK9+](https://issues.apache.org/jira/browse/SPARK-29924) (relates to)
**Note**: *This issue was originally created as [ARROW-7223](https://issues.apache.org/jira/browse/ARROW-7223). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*
贡献指南
调研方向
首先跟踪 Arrow Java 在 JDK 9 及更高版本上触发 Netty reflection-access 失败的位置;该 issue 没有指出源文件或测试。查看已记录的 io.netty.tryReflectionSetAccessible 属性行为,然后验证未设置、设置为 true 和设置为 false 的情况,并确认产生的错误能够解释所建议的设置。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- backend
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100