From afbfed295488048df1759d5e7c366ba5c0735500 Mon Sep 17 00:00:00 2001 From: Daydreamer-ia <2296032269@qq.com> Date: Thu, 8 Sep 2022 18:34:03 +0800 Subject: [PATCH] Remove the unused filed. --- .../api/remote/request/ConnectionSetupRequest.java | 13 ------------- .../nacos/common/remote/client/grpc/GrpcClient.java | 9 --------- .../remote/client/grpc/GrpcClusterClient.java | 5 ----- .../common/remote/client/grpc/GrpcSdkClient.java | 5 ----- .../common/remote/client/grpc/GrpcClientTest.java | 5 ----- 5 files changed, 37 deletions(-) diff --git a/api/src/main/java/com/alibaba/nacos/api/remote/request/ConnectionSetupRequest.java b/api/src/main/java/com/alibaba/nacos/api/remote/request/ConnectionSetupRequest.java index 15b3c35d5..046a897a4 100644 --- a/api/src/main/java/com/alibaba/nacos/api/remote/request/ConnectionSetupRequest.java +++ b/api/src/main/java/com/alibaba/nacos/api/remote/request/ConnectionSetupRequest.java @@ -35,19 +35,6 @@ public class ConnectionSetupRequest extends InternalRequest { private byte[] abilityTable; - /**. - * server will resolve {@link ConnectionSetupRequest#abilityTable} to server abilities, or to client abilities - */ - private boolean isServer; - - public boolean isServer() { - return isServer; - } - - public void setServer(boolean server) { - isServer = server; - } - public ConnectionSetupRequest() { } diff --git a/common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClient.java b/common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClient.java index 0fe29f41c..401254059 100644 --- a/common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClient.java +++ b/common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClient.java @@ -382,7 +382,6 @@ public abstract class GrpcClient extends RpcClient { byte[] bitTable = AbilityTableUtils.getAbilityBiTableBy(AbilityKey.values(), NacosAbilityManagerHolder.getInstance().getCurrentRunningAbility()); conSetupRequest.setAbilityTable(bitTable); - conSetupRequest.setServer(isServer()); conSetupRequest.setTenant(super.getTenant()); grpcConn.sendRequest(conSetupRequest); // wait for response @@ -419,14 +418,6 @@ public abstract class GrpcClient extends RpcClient { } } - /** - * Return whether server environment - * The same offset may refer to different functions in the client capability table and the server capability table. - * - * @return whether server environment - */ - protected abstract boolean isServer(); - } diff --git a/common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClusterClient.java b/common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClusterClient.java index 74919ba07..7b63653b6 100644 --- a/common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClusterClient.java +++ b/common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClusterClient.java @@ -35,11 +35,6 @@ public class GrpcClusterClient extends GrpcClient { super(name); } - @Override - protected boolean isServer() { - return true; - } - @Override public int rpcPortOffset() { return Integer.parseInt(System.getProperty(NACOS_SERVER_GRPC_PORT_OFFSET_KEY, diff --git a/common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcSdkClient.java b/common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcSdkClient.java index 46cd691f6..34cf40824 100644 --- a/common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcSdkClient.java +++ b/common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcSdkClient.java @@ -35,11 +35,6 @@ public class GrpcSdkClient extends GrpcClient { super(name); } - @Override - protected boolean isServer() { - return false; - } - @Override public int rpcPortOffset() { return Integer.parseInt(System.getProperty(NACOS_SERVER_GRPC_PORT_OFFSET_KEY, diff --git a/common/src/test/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClientTest.java b/common/src/test/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClientTest.java index af7104d13..9e3c17f7f 100644 --- a/common/src/test/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClientTest.java +++ b/common/src/test/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClientTest.java @@ -48,11 +48,6 @@ public class GrpcClientTest { public void setUp() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { grpcClient = spy(new GrpcClient("testClient") { - @Override - protected boolean isServer() { - return false; - } - @Override public int rpcPortOffset() { return 1000;