Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
WTScada
DolphinScheduler
提交
417de132
DolphinScheduler
项目概览
WTScada
/
DolphinScheduler
与 Fork 源项目一致
Fork自
apache / DolphinScheduler
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
DolphinScheduler
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
417de132
编写于
9月 04, 2020
作者:
C
CalvinKirs
提交者:
GitHub
9月 04, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[improvement][remote]use EpollServerSocketChannel when system is linux (#3657)
上级
feec6295
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
4 deletion
+22
-4
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/NettyRemotingClient.java
...g/apache/dolphinscheduler/remote/NettyRemotingClient.java
+1
-2
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/NettyRemotingServer.java
...g/apache/dolphinscheduler/remote/NettyRemotingServer.java
+1
-2
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/utils/NettyUtils.java
.../org/apache/dolphinscheduler/remote/utils/NettyUtils.java
+20
-0
未找到文件。
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/NettyRemotingClient.java
浏览文件 @
417de132
...
...
@@ -27,7 +27,6 @@ import io.netty.channel.EventLoopGroup;
import
io.netty.channel.epoll.EpollEventLoopGroup
;
import
io.netty.channel.nio.NioEventLoopGroup
;
import
io.netty.channel.socket.SocketChannel
;
import
io.netty.channel.socket.nio.NioSocketChannel
;
import
org.apache.dolphinscheduler.remote.codec.NettyDecoder
;
import
org.apache.dolphinscheduler.remote.codec.NettyEncoder
;
...
...
@@ -155,7 +154,7 @@ public class NettyRemotingClient {
this
.
bootstrap
.
group
(
this
.
workerGroup
)
.
channel
(
N
ioSocketChannel
.
class
)
.
channel
(
N
ettyUtils
.
getSocketChannelClass
()
)
.
option
(
ChannelOption
.
SO_KEEPALIVE
,
clientConfig
.
isSoKeepalive
())
.
option
(
ChannelOption
.
TCP_NODELAY
,
clientConfig
.
isTcpNoDelay
())
.
option
(
ChannelOption
.
SO_SNDBUF
,
clientConfig
.
getSendBufferSize
())
...
...
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/NettyRemotingServer.java
浏览文件 @
417de132
...
...
@@ -25,7 +25,6 @@ import io.netty.channel.ChannelPipeline;
import
io.netty.channel.EventLoopGroup
;
import
io.netty.channel.epoll.EpollEventLoopGroup
;
import
io.netty.channel.nio.NioEventLoopGroup
;
import
io.netty.channel.socket.nio.NioServerSocketChannel
;
import
io.netty.channel.socket.nio.NioSocketChannel
;
import
org.apache.dolphinscheduler.remote.codec.NettyDecoder
;
...
...
@@ -146,7 +145,7 @@ public class NettyRemotingServer {
if
(
isStarted
.
compareAndSet
(
false
,
true
))
{
this
.
serverBootstrap
.
group
(
this
.
bossGroup
,
this
.
workGroup
)
.
channel
(
N
ioServerSocketChannel
.
class
)
.
channel
(
N
ettyUtils
.
getServerSocketChannelClass
()
)
.
option
(
ChannelOption
.
SO_REUSEADDR
,
true
)
.
option
(
ChannelOption
.
SO_BACKLOG
,
serverConfig
.
getSoBacklog
())
.
childOption
(
ChannelOption
.
SO_KEEPALIVE
,
serverConfig
.
isSoKeepalive
())
...
...
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/utils/NettyUtils.java
浏览文件 @
417de132
...
...
@@ -18,6 +18,12 @@
package
org.apache.dolphinscheduler.remote.utils
;
import
io.netty.channel.epoll.Epoll
;
import
io.netty.channel.epoll.EpollServerSocketChannel
;
import
io.netty.channel.epoll.EpollSocketChannel
;
import
io.netty.channel.socket.ServerSocketChannel
;
import
io.netty.channel.socket.SocketChannel
;
import
io.netty.channel.socket.nio.NioServerSocketChannel
;
import
io.netty.channel.socket.nio.NioSocketChannel
;
/**
* NettyUtils
...
...
@@ -39,4 +45,18 @@ public class NettyUtils {
return
Boolean
.
parseBoolean
(
enableNettyEpoll
);
}
public
static
Class
<?
extends
ServerSocketChannel
>
getServerSocketChannelClass
()
{
if
(
useEpoll
())
{
return
EpollServerSocketChannel
.
class
;
}
return
NioServerSocketChannel
.
class
;
}
public
static
Class
<?
extends
SocketChannel
>
getSocketChannelClass
()
{
if
(
useEpoll
())
{
return
EpollSocketChannel
.
class
;
}
return
NioSocketChannel
.
class
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录