mirror of
https://github.com/actiontech/dble.git
synced 2026-01-05 20:30:40 -06:00
Merge branch 'master' into inner-2276
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -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>
|
||||
|
||||
@@ -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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS));
|
||||
output = stub.withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), 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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS));
|
||||
output = stub.withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), 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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS));
|
||||
stub.withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), 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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS));
|
||||
stub.withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), 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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS));
|
||||
stub.withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), 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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS));
|
||||
stub.withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), 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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS));
|
||||
stub.withDeadlineAfter(ClusterConfig.getInstance().getGrpcTimeout(), 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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS));
|
||||
isSuccess = true;
|
||||
|
||||
@@ -47,7 +47,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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS));
|
||||
}
|
||||
|
||||
@@ -56,7 +56,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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS));
|
||||
startUpdateNodes();
|
||||
ClusterToXml.loadKVtoFile(this);
|
||||
@@ -309,7 +309,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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS));
|
||||
LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(2000));
|
||||
}
|
||||
@@ -346,7 +346,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(ClusterConfig.getInstance().getGrpcTimeout(), TimeUnit.SECONDS);
|
||||
//check connection is ready
|
||||
ClusterHelper.isExist(ClusterPathUtil.getOnlinePath(SystemConfig.getInstance().getInstanceName()));
|
||||
|
||||
@@ -112,8 +112,8 @@ public final class ManagerTableUtil {
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user