Skip to content

Advocate for StandardOpenOption.DIRECT #190

Description

@jamesmarkchan

we currently use ExtendedOpenOption.DIRECT under com.sun.nio.file. This is essential for a disk benchmark to get real hardware throughput rather than cached reads. This mode has been around for 10years and is likely to continue being available.

open jdk's enhancement request:

https://bugs.openjdk.org/browse/JDK-8264744

to promote to standard option but no activity. we should endorese this request as we rely on it by creating an account and posting our usecase.

t's been sitting with no activity — direct I/O semantics vary significantly across OSes (Linux O_DIRECT, Windows FILE_FLAG_NO_BUFFERING, macOS F_NOCACHE) and the JDK team hasn't committed to a cross-platform contract

The com.sun.nio.file package is in a grey area — it's internal API but it's exported from the jdk.unsupported module

we can surpress with

<compilerArgs>
    <arg>--add-exports</arg>
    <arg>java.base/com.sun.nio.file=ALL-UNNAMED</arg>
</compilerArgs>

example of ci errors we get from this:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions