Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inner 2389 rollback update jar #3883

Merged
merged 2 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<grpc.version>1.53.0</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.4.0</grpc.version><!-- CURRENT_GRPC_VERSION -->
<log4j2.version>2.18.0</log4j2.version>
</properties>
<repositories>
Expand Down Expand Up @@ -76,7 +76,7 @@
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.21.7</version>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>org.iq80.leveldb</groupId>
Expand All @@ -89,10 +89,9 @@
<version>0.7</version>
</dependency>
<dependency>
<!-- version match grpc-->
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.1-jre</version>
<version>19.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
Expand Down Expand Up @@ -196,6 +195,11 @@
<version>${grpc.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.5.0</version>
</dependency>
<!--DOM4J FOR XML -->
<dependency>
<groupId>dom4j</groupId>
Expand Down
26 changes: 13 additions & 13 deletions src/main/java/com/actiontech/dble/cluster/impl/UcoreSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void initConInfo(Properties ucoreProperties) {
LOGGER.error("error:", e);
}
Channel channel = ManagedChannelBuilder.forAddress(getIpList().get(0),
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext().build();
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
stub = UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS);
}

Expand All @@ -80,7 +80,7 @@ public void initCluster(Properties ucoreProperties) {
LOGGER.error("error:", e);
}
Channel channel = ManagedChannelBuilder.forAddress(getIpList().get(0),
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext().build();
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
stub = UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS);
startUpdateNodes();
}
Expand Down Expand Up @@ -139,7 +139,7 @@ private void log(String message, Exception e) {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip,
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext().build();
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
stub = UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS);
output = stub.withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS).lockOnSession(input);
return output.getSessionId();
Expand Down Expand Up @@ -178,7 +178,7 @@ public void setKV(String path, String value) throws Exception {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip,
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext().build();
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
stub = UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS);
stub.withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS).putKv(input);
return;
Expand All @@ -205,7 +205,7 @@ public KvBean getKV(String path) {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip,
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext().build();
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
stub = UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS);
output = stub.withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS).getKv(input);
} catch (Exception e2) {
Expand Down Expand Up @@ -240,7 +240,7 @@ public List<KvBean> getKVPath(String path) {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip,
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext().build();
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
stub = UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS);
output = stub.withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS).getKvTree(input);
} catch (Exception e2) {
Expand Down Expand Up @@ -275,7 +275,7 @@ public void cleanPath(String path) {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip,
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext().build();
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
stub = UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS);
stub.withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS).deleteKvTree(input);
flag = true;
Expand All @@ -302,7 +302,7 @@ public void cleanKV(String path) {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip,
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext().build();
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
stub = UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS);
stub.withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS).deleteKv(input);
return;
Expand Down Expand Up @@ -330,7 +330,7 @@ public SubscribeReturnBean subscribeKvPrefix(SubscribeRequest request) throws Ex
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip,
Integer.parseInt(ClusterGeneralConfig.getInstance().getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext().build();
Integer.parseInt(ClusterGeneralConfig.getInstance().getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
stub = UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GRPC_SUBTIMEOUT, TimeUnit.SECONDS);
UcoreInterface.SubscribeKvPrefixOutput output = stub.withDeadlineAfter(GRPC_SUBTIMEOUT, TimeUnit.SECONDS).subscribeKvPrefix(input);
return groupSubscribeResult(output);
Expand All @@ -355,7 +355,7 @@ public void alert(ClusterAlertBean alert) {
for (String ip : getIpList()) {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip, Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext().build();
channel = ManagedChannelBuilder.forAddress(ip, Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
stub = UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS);
stub.withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS).alert(input);
return;
Expand All @@ -379,7 +379,7 @@ public boolean alertResolve(ClusterAlertBean alert) {
for (String ip : getIpList()) {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip, Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext().build();
channel = ManagedChannelBuilder.forAddress(ip, Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
stub = UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS);
stub.withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS).alertResolve(input);
return true;
Expand Down Expand Up @@ -432,7 +432,7 @@ public boolean renewLock(String sessionId) throws Exception {
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip,
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext().build();
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
stub = UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS);
stub.withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS).renewSession(input);
return true;
Expand Down Expand Up @@ -469,7 +469,7 @@ public UcoreInterface.SubscribeNodesOutput subscribeNodes(UcoreInterface.Subscri
ManagedChannel channel = null;
try {
channel = ManagedChannelBuilder.forAddress(ip,
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext().build();
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
stub = UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GRPC_SUBTIMEOUT, TimeUnit.SECONDS);
return stub.withDeadlineAfter(GRPC_SUBTIMEOUT, TimeUnit.SECONDS).subscribeNodes(subscribeNodesInput);
} catch (Exception e2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void initConInfo(Properties properties) {
serverId = getValue(ClusterParamCfg.CLUSTER_CFG_SERVER_ID);
sourceComponentId = getValue(ClusterParamCfg.CLUSTER_CFG_MYID);
Channel channel = ManagedChannelBuilder.forAddress("127.0.0.1",
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext().build();
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
stub = DbleClusterGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS);
}

Expand All @@ -51,7 +51,7 @@ public void initCluster(Properties properties) {
serverId = getValue(ClusterParamCfg.CLUSTER_CFG_SERVER_ID);
sourceComponentId = getValue(ClusterParamCfg.CLUSTER_CFG_MYID);
Channel channel = ManagedChannelBuilder.forAddress("127.0.0.1",
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext().build();
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
stub = DbleClusterGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS);
startUpdateNodes();
}
Expand Down Expand Up @@ -302,7 +302,7 @@ public void run() {
} catch (Exception e) {
LOGGER.warn("error in ucore nodes watch,try for another time", e);
Channel channel = ManagedChannelBuilder.forAddress("127.0.0.1",
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext().build();
Integer.parseInt(getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
stub = DbleClusterGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS);
}
}
Expand Down
Loading