[
https://issues.apache.org/jira/browse/HADOOP-19583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17956384#comment-17956384
]
ASF GitHub Bot commented on HADOOP-19583:
-----------------------------------------
zeekling commented on code in PR #7725:
URL: https://github.com/apache/hadoop/pull/7725#discussion_r2129126382
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/RawLocalFileSystem.java:
##########
@@ -425,7 +426,7 @@ public void completed(Integer result, Integer rangeIndex) {
channel.read(buffer, range.getOffset() + buffer.position(),
rangeIndex, this);
} else {
// Flip the buffer and declare success.
- buffer.flip();
+ ((Buffer)(buffer)).flip();
Review Comment:
Do you use jdk17 build hadoop, and run on jdk8?
If so, you need check in all project like this, I think it has so many.
> JDK8: RawLocalFileSystem calls ByteBuffer.flip
> ----------------------------------------------
>
> Key: HADOOP-19583
> URL: https://issues.apache.org/jira/browse/HADOOP-19583
> Project: Hadoop Common
> Issue Type: Bug
> Components: common
> Affects Versions: 3.4.2
> Reporter: Steve Loughran
> Assignee: Steve Loughran
> Priority: Major
> Labels: pull-request-available
>
> running 3.4.2 rc1 on older JDK 8 runtimes can fail
> {code}
> [INFO] -------------------------------------------------------
> [INFO] Running org.apache.parquet.hadoop.TestParquetReader
> Exception in thread "Thread-8" java.lang.NoSuchMethodError:
> java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;
> at
> org.apache.hadoop.fs.RawLocalFileSystem$AsyncHandler.completed(RawLocalFileSystem.java:428)
> at
> org.apache.hadoop.fs.RawLocalFileSystem$AsyncHandler.completed(RawLocalFileSystem.java:362)
> at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
> at
> sun.nio.ch.SimpleAsynchronousFileChannelImpl$2.run(SimpleAsynchronousFileChannelImpl.java:335)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:750)
> {code}
> this can be fixed trivially, casting to java.io.Buffer first:
> ((Byffer)buff).flip())
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]