Merge pull request #3760 from actiontech/3.22.07.99/lts_grpc

upgrade grpc from 1.5.0 to 1.53.0
This commit is contained in:
wenyh
2023-07-06 13:41:34 +08:00
committed by GitHub
3 changed files with 15 additions and 15 deletions

View File

@@ -25,7 +25,7 @@
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<grpc.version>1.5.0</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.53.0</grpc.version><!-- CURRENT_GRPC_VERSION -->
<log4j2.version>2.18.0</log4j2.version>
</properties>
<repositories>

View File

@@ -181,7 +181,7 @@ public final class UcoreSender extends AbstractConsulSender {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip,
ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build();
ClusterConfig.getInstance().getClusterPort()).usePlaintext().build();
setStubIfPossible(UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS));
output = stub.withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS).getKv(input);
} catch (Exception e2) {
@@ -221,7 +221,7 @@ public final class UcoreSender extends AbstractConsulSender {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip,
ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build();
ClusterConfig.getInstance().getClusterPort()).usePlaintext().build();
setStubIfPossible(UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS));
output = stub.withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS).getKvTree(input);
} catch (Exception e2) {
@@ -257,7 +257,7 @@ public final class UcoreSender extends AbstractConsulSender {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip,
ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build();
ClusterConfig.getInstance().getClusterPort()).usePlaintext().build();
setStubIfPossible(UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS));
stub.withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS).deleteKvTree(input);
flag = true;
@@ -288,7 +288,7 @@ public final class UcoreSender extends AbstractConsulSender {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip,
ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build();
ClusterConfig.getInstance().getClusterPort()).usePlaintext().build();
setStubIfPossible(UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS));
stub.withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS).deleteKv(input);
return;
@@ -321,7 +321,7 @@ public final class UcoreSender extends AbstractConsulSender {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip,
ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build();
ClusterConfig.getInstance().getClusterPort()).usePlaintext().build();
setStubIfPossible(UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GRPC_SUBTIMEOUT, TimeUnit.SECONDS));
UcoreInterface.SubscribeKvPrefixOutput output = stub.withDeadlineAfter(GRPC_SUBTIMEOUT, TimeUnit.SECONDS).subscribeKvPrefix(input);
return groupSubscribeResult(output);
@@ -346,7 +346,7 @@ public final class UcoreSender extends AbstractConsulSender {
for (String ip : getAvailableIpList()) {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip, ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build();
channel = ManagedChannelBuilder.forAddress(ip, ClusterConfig.getInstance().getClusterPort()).usePlaintext().build();
setStubIfPossible(UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS));
stub.withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS).alert(input);
return;
@@ -370,7 +370,7 @@ public final class UcoreSender extends AbstractConsulSender {
for (String ip : getAvailableIpList()) {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip, ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build();
channel = ManagedChannelBuilder.forAddress(ip, ClusterConfig.getInstance().getClusterPort()).usePlaintext().build();
setStubIfPossible(UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS));
stub.withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS).alertResolve(input);
return true;
@@ -421,7 +421,7 @@ public final class UcoreSender extends AbstractConsulSender {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip,
ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build();
ClusterConfig.getInstance().getClusterPort()).usePlaintext().build();
setStubIfPossible(UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS));
stub.withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS).renewSession(input);
return true;
@@ -463,7 +463,7 @@ public final class UcoreSender extends AbstractConsulSender {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip,
ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build();
ClusterConfig.getInstance().getClusterPort()).usePlaintext().build();
setStubIfPossible(UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GRPC_SUBTIMEOUT, TimeUnit.SECONDS));
return stub.withDeadlineAfter(GRPC_SUBTIMEOUT, TimeUnit.SECONDS).subscribeNodes(subscribeNodesInput);
} catch (Exception e2) {
@@ -595,7 +595,7 @@ public final class UcoreSender extends AbstractConsulSender {
Channel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip,
ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build();
ClusterConfig.getInstance().getClusterPort()).usePlaintext().build();
channel = ClientInterceptors.intercept(channel, new MetaDataClientInterceptor());
setStubIfPossible(UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS));
isSuccess = true;

View File

@@ -48,7 +48,7 @@ public class UshardSender extends AbstractConsulSender {
@Override
public void initConInfo() {
Channel channel = ManagedChannelBuilder.forAddress("127.0.0.1",
ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build();
ClusterConfig.getInstance().getClusterPort()).usePlaintext().build();
setStubIfPossible(DbleClusterGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS));
}
@@ -57,7 +57,7 @@ public class UshardSender extends AbstractConsulSender {
serverId = SystemConfig.getInstance().getServerId();
sourceComponentId = SystemConfig.getInstance().getInstanceName();
Channel channel = ManagedChannelBuilder.forAddress("127.0.0.1",
ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build();
ClusterConfig.getInstance().getClusterPort()).usePlaintext().build();
setStubIfPossible(DbleClusterGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS));
startUpdateNodes();
ClusterToXml.loadKVtoFile(this);
@@ -310,7 +310,7 @@ public class UshardSender extends AbstractConsulSender {
}
LOGGER.warn("error in ucore nodes watch,try for another time", e);
Channel channel = ManagedChannelBuilder.forAddress("127.0.0.1",
ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build();
ClusterConfig.getInstance().getClusterPort()).usePlaintext().build();
UshardSender.this.setStubIfPossible(DbleClusterGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS));
LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(2000));
}
@@ -347,7 +347,7 @@ public class UshardSender extends AbstractConsulSender {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress("127.0.0.1",
ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build();
ClusterConfig.getInstance().getClusterPort()).usePlaintext().build();
stub = DbleClusterGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS);
//check connection is ready
ClusterHelper.isExist(ClusterPathUtil.getOnlinePath(SystemConfig.getInstance().getInstanceName()));