Merge pull request #4225 from drpmma/feature/grpc-develop-v2

[ISSUE #3949] Support gRPC protocol
This commit is contained in:
Qingshan Lin
2022-07-20 10:36:21 +08:00
committed by GitHub
238 changed files with 23965 additions and 403 deletions
@@ -38,9 +38,6 @@ public class NettyClientConfig {
private boolean clientPooledByteBufAllocatorEnable = false;
private boolean clientCloseSocketIfTimeout = NettySystemConfig.clientCloseSocketIfTimeout;
private boolean preferredDirectByteBuffer = false;
private boolean defaultEventExecutorGroupEnable = true;
private boolean useTLS;
private int writeBufferHighWaterMark = NettySystemConfig.writeBufferHighWaterMark;
@@ -169,4 +166,11 @@ public class NettyClientConfig {
this.disableCallbackExecutor = disableCallbackExecutor;
}
public boolean isDisableNettyWorkerGroup() {
return disableNettyWorkerGroup;
}
public void setDisableNettyWorkerGroup(boolean disableNettyWorkerGroup) {
this.disableNettyWorkerGroup = disableNettyWorkerGroup;
}
}
@@ -210,8 +210,8 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti
LOGGER.warn("Connections are insecure as SSLContext is null!");
}
}
pipeline.addLast(
defaultEventExecutorGroup,
ch.pipeline().addLast(
nettyClientConfig.isDisableNettyWorkerGroup() ? null : defaultEventExecutorGroup,
new NettyEncoder(),
new NettyDecoder(),
new IdleStateHandler(0, 0, nettyClientConfig.getClientChannelMaxIdleTimeSeconds()),
@@ -110,7 +110,7 @@ public class RemotingCommand {
return cmd;
}
private static void setCmdVersion(RemotingCommand cmd) {
protected static void setCmdVersion(RemotingCommand cmd) {
if (configVersion >= 0) {
cmd.setVersion(configVersion);
} else {