LuciferYang commented on code in PR #43349:
URL: https://github.com/apache/spark/pull/43349#discussion_r1357874149
##########
common/network-common/src/main/java/org/apache/spark/network/util/NettyUtils.java:
##########
@@ -65,38 +65,26 @@ public static ThreadFactory createThreadFactory(String
threadPoolPrefix) {
public static EventLoopGroup createEventLoop(IOMode mode, int numThreads,
String threadPrefix) {
ThreadFactory threadFactory = createThreadFactory(threadPrefix);
- switch (mode) {
- case NIO:
- return new NioEventLoopGroup(numThreads, threadFactory);
- case EPOLL:
- return new EpollEventLoopGroup(numThreads, threadFactory);
- default:
- throw new IllegalArgumentException("Unknown io mode: " + mode);
- }
+ return switch (mode) {
+ case NIO -> new NioEventLoopGroup(numThreads, threadFactory);
+ case EPOLL -> new EpollEventLoopGroup(numThreads, threadFactory);
Review Comment:
<img width="854" alt="image"
src="https://github.com/apache/spark/assets/1475305/fc3510f8-30fd-4674-949c-f10de8e8ba1d">
--
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]