diff --git a/pom.xml b/pom.xml index a9e4e86a4f..41759c8ddc 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ UTF-8 - 1.5.0 + 1.53.0 2.18.0 diff --git a/src/main/java/com/actiontech/dble/cluster/general/impl/UcoreSender.java b/src/main/java/com/actiontech/dble/cluster/general/impl/UcoreSender.java index d97888c65b..f6e453e98c 100644 --- a/src/main/java/com/actiontech/dble/cluster/general/impl/UcoreSender.java +++ b/src/main/java/com/actiontech/dble/cluster/general/impl/UcoreSender.java @@ -181,7 +181,7 @@ public KvBean getKV(String path) { ManagedChannel channel = null; try { channel = ManagedChannelBuilder.forAddress(ip, - ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build(); + ClusterConfig.getInstance().getClusterPort()).usePlaintext().build(); setStubIfPossible(UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS)); output = stub.withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS).getKv(input); } catch (Exception e2) { @@ -221,7 +221,7 @@ public List getKVPath(String path) { ManagedChannel channel = null; try { channel = ManagedChannelBuilder.forAddress(ip, - ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build(); + ClusterConfig.getInstance().getClusterPort()).usePlaintext().build(); setStubIfPossible(UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS)); output = stub.withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS).getKvTree(input); } catch (Exception e2) { @@ -257,7 +257,7 @@ public void cleanPath(String path) { ManagedChannel channel = null; try { channel = ManagedChannelBuilder.forAddress(ip, - ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build(); + ClusterConfig.getInstance().getClusterPort()).usePlaintext().build(); setStubIfPossible(UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS)); stub.withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS).deleteKvTree(input); flag = true; @@ -288,7 +288,7 @@ public void cleanKV(String path) { ManagedChannel channel = null; try { channel = ManagedChannelBuilder.forAddress(ip, - ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build(); + ClusterConfig.getInstance().getClusterPort()).usePlaintext().build(); setStubIfPossible(UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS)); stub.withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS).deleteKv(input); return; @@ -321,7 +321,7 @@ public SubscribeReturnBean subscribeKvPrefix(SubscribeRequest request) throws Ex 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 void alert(ClusterAlertBean alert) { 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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS)); stub.withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS).alert(input); return; @@ -370,7 +370,7 @@ public boolean alertResolve(ClusterAlertBean alert) { 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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS)); stub.withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS).alertResolve(input); return true; @@ -421,7 +421,7 @@ public boolean renewLock(String sessionId, String path) throws Exception { ManagedChannel channel = null; try { channel = ManagedChannelBuilder.forAddress(ip, - ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build(); + ClusterConfig.getInstance().getClusterPort()).usePlaintext().build(); setStubIfPossible(UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS)); stub.withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS).renewSession(input); return true; @@ -463,7 +463,7 @@ public UcoreInterface.SubscribeNodesOutput subscribeNodes(UcoreInterface.Subscri 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 @@ private boolean rebuildStub() { 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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS)); isSuccess = true; diff --git a/src/main/java/com/actiontech/dble/cluster/general/impl/ushard/UshardSender.java b/src/main/java/com/actiontech/dble/cluster/general/impl/ushard/UshardSender.java index a96ca4f10f..2cd1dfb50b 100644 --- a/src/main/java/com/actiontech/dble/cluster/general/impl/ushard/UshardSender.java +++ b/src/main/java/com/actiontech/dble/cluster/general/impl/ushard/UshardSender.java @@ -47,7 +47,7 @@ public String getRenewThreadPrefix() { @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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS)); } @@ -56,7 +56,7 @@ public void initCluster() { 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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS)); startUpdateNodes(); ClusterToXml.loadKVtoFile(this); @@ -309,7 +309,7 @@ public void run() { } 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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS)); LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(2000)); } @@ -346,7 +346,7 @@ public void attachCluster() throws Exception { 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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS); //check connection is ready ClusterHelper.isExist(ClusterPathUtil.getOnlinePath(SystemConfig.getInstance().getInstanceName())); diff --git a/src/main/java/com/actiontech/dble/services/manager/information/ManagerTableUtil.java b/src/main/java/com/actiontech/dble/services/manager/information/ManagerTableUtil.java index ec34c2c0a7..3679a870a1 100644 --- a/src/main/java/com/actiontech/dble/services/manager/information/ManagerTableUtil.java +++ b/src/main/java/com/actiontech/dble/services/manager/information/ManagerTableUtil.java @@ -112,8 +112,8 @@ public static Set> getAffectPks(ManagerService man String value = null == row.getValue(i) ? null : new String(row.getValue(i), charset); affectPk.put(columnName, value); if (null != values) { - boolean match = values.entrySet().stream().anyMatch(valueEntry -> !StringUtil.equals(affectPk.get(valueEntry.getKey()), valueEntry.getValue())); - if (!match) { + boolean isSkipRow = values.entrySet().stream().allMatch(valueEntry -> affectPk.containsKey(valueEntry.getKey()) && StringUtil.equals(affectPk.get(valueEntry.getKey()), valueEntry.getValue())); + if (isSkipRow) { breakFlag = true; break; }