Skip to content

Commit

Permalink
update epool to epoll.
Browse files Browse the repository at this point in the history
  • Loading branch information
andaren committed Jan 10, 2019
1 parent 48295f9 commit 023757e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public AbstractRpcRemotingServer(final NettyServerConfig nettyServerConfig,
this.nettyServerConfig = nettyServerConfig;
this.eventLoopGroupBoss = new NioEventLoopGroup(nettyServerConfig.getBossThreadSize(),
new NamedThreadFactory(nettyServerConfig.getBossThreadPrefix(), nettyServerConfig.getBossThreadSize()));
if (NettyServerConfig.enableEpool()) {
if (NettyServerConfig.enableEpoll()) {
this.eventLoopGroupWorker = new EpollEventLoopGroup(nettyServerConfig.getServerWorkerThreads(),
new NamedThreadFactory(nettyServerConfig.getWorkerThreadPrefix(),
nettyServerConfig.getServerWorkerThreads()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class NettyServerConfig extends NettyBaseConfig {
private int serverChannelMaxIdleTimeSeconds = 30;
private static final Configuration CONFIG = new FileConfiguration();
private static final String DEFAULT_BOSS_THREAD_PREFIX = "NettyBoss";
private static final String EPOOL_WORKER_THREAD_PREFIX = "NettyServerEPoolWorker";
private static final String EPOLL_WORKER_THREAD_PREFIX = "NettyServerEPollWorker";
private static final String NIO_WORKER_THREAD_PREFIX = "NettyServerNIOWorker";
private static final String DEFAULT_EXECUTOR_THREAD_PREFIX = "NettyServerBizHandler";
private static final int DEFAULT_BOSS_THREAD_SIZE = 1;
Expand Down Expand Up @@ -93,11 +93,11 @@ public void setServerSelectorThreads(int serverSelectorThreads) {
}

/**
* Enable epool boolean.
* Enable epoll boolean.
*
* @return the boolean
*/
public static boolean enableEpool() {
public static boolean enableEpoll() {
return NettyBaseConfig.SERVER_CHANNEL_CLAZZ.equals(EpollServerSocketChannel.class)
&& Epoll.isAvailable();

Expand Down Expand Up @@ -281,7 +281,7 @@ public String getBossThreadPrefix() {
*/
public String getWorkerThreadPrefix() {
return CONFIG.getConfig("transport.thread-factory.worker-thread-prefix",
enableEpool() ? EPOOL_WORKER_THREAD_PREFIX : NIO_WORKER_THREAD_PREFIX);
enableEpoll() ? EPOLL_WORKER_THREAD_PREFIX : NIO_WORKER_THREAD_PREFIX);
}

/**
Expand Down

0 comments on commit 023757e

Please sign in to comment.