LuciferYang opened a new pull request, #56806: URL: https://github.com/apache/spark/pull/56806
### What changes were proposed in this pull request? `NettyUtils.createEventLoop`, `getClientChannelClass`, and `getServerChannelClass` each contained an identical copy of the `IOMode.AUTO` resolution (EPOLL on Linux, KQUEUE on macOS, NIO otherwise). This PR extracts that logic into a single private `resolveMode` helper, and each method now switches on the resolved concrete mode. The `AUTO` switch arm becomes unreachable, so it is kept as an explicit arm that throws, which preserves the exhaustiveness check over `IOMode`. ### Why are the changes needed? The resolution logic was duplicated three times, so the methods could easily drift apart when one is updated and the others are not. Keeping it in one place removes that risk. Because every switch still lists all `IOMode` constants explicitly, adding a future transport (for example io_uring) will fail to compile at all three call sites and force each to be handled deliberately. ### Does this PR introduce _any_ user-facing change? No. This is a behavior-preserving refactor: non-AUTO modes pass through unchanged, and AUTO resolves to the same transport as before. ### How was this patch tested? No new tests. The change has no functional difference, and the affected code paths are exercised by the existing `common/network-common` transport suites that run in CI. Built locally with `build/sbt network-common/compile`. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 4.8) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
