Github user jerryshao commented on a diff in the pull request:
https://github.com/apache/spark/pull/18684#discussion_r128572437
--- Diff:
common/network-common/src/main/java/org/apache/spark/network/buffer/FileSegmentManagedBuffer.java
---
@@ -132,7 +134,8 @@ public Object convertToNetty() throws IOException {
if (conf.lazyFileDescriptor()) {
return new DefaultFileRegion(file, offset, length);
} else {
- FileChannel fileChannel = new FileInputStream(file).getChannel();
+ FileChannel fileChannel = FileChannel.open(file.toPath(),
+ ImmutableSet.of(StandardOpenOption.READ));
--- End diff --
They're actually the same, the one you mentioned is just a simple wrapper
of the former one. I will change to yours for the simplicity.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]