From 41a3f02bf109f5da43dc67035d6435be084512eb Mon Sep 17 00:00:00 2001 From: SteNicholas Date: Mon, 30 Dec 2019 16:39:32 +0800 Subject: [PATCH] (feat) Upgrade sofabolt version (#382) * upgrade sofabolt version * upgrade sofabolt version * upgrade sofabolt version * upgrade sofabolt version --- .../main/java/com/alipay/sofa/jraft/RaftGroupService.java | 4 ++-- .../java/com/alipay/sofa/jraft/rpc/RaftRpcServerFactory.java | 4 ++-- .../sofa/jraft/rpc/impl/AbstractBoltClientService.java | 2 +- .../main/java/com/alipay/sofa/jraft/rhea/StoreEngine.java | 5 +++-- pom.xml | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/jraft-core/src/main/java/com/alipay/sofa/jraft/RaftGroupService.java b/jraft-core/src/main/java/com/alipay/sofa/jraft/RaftGroupService.java index f08beb9d7..2d3e09b8a 100644 --- a/jraft-core/src/main/java/com/alipay/sofa/jraft/RaftGroupService.java +++ b/jraft-core/src/main/java/com/alipay/sofa/jraft/RaftGroupService.java @@ -128,7 +128,7 @@ public synchronized Node start(final boolean startRpcServer) { this.node = RaftServiceFactory.createAndInitRaftNode(this.groupId, this.serverId, this.nodeOptions); if (startRpcServer) { - this.rpcServer.start(); + this.rpcServer.startup(); } else { LOG.warn("RPC server is not started in RaftGroupService."); } @@ -157,7 +157,7 @@ public synchronized void shutdown() { if (this.rpcServer != null) { try { if (!this.sharedRpcServer) { - this.rpcServer.stop(); + this.rpcServer.shutdown(); } } catch (final Exception ignored) { // ignore diff --git a/jraft-core/src/main/java/com/alipay/sofa/jraft/rpc/RaftRpcServerFactory.java b/jraft-core/src/main/java/com/alipay/sofa/jraft/rpc/RaftRpcServerFactory.java index 83fdefea5..c6ab480c4 100644 --- a/jraft-core/src/main/java/com/alipay/sofa/jraft/rpc/RaftRpcServerFactory.java +++ b/jraft-core/src/main/java/com/alipay/sofa/jraft/rpc/RaftRpcServerFactory.java @@ -89,7 +89,7 @@ public static void addRaftRequestProcessors(final RpcServer rpcServer) { } /** - * Adds RAFT and CLI service request processors + * Adds RAFT and CLI service request processors. * * @param rpcServer rpc server instance * @param raftExecutor executor to handle RAFT requests. @@ -143,7 +143,7 @@ public static RpcServer createAndStartRaftRpcServer(final Endpoint endpoint) { public static RpcServer createAndStartRaftRpcServer(final Endpoint endpoint, final Executor raftExecutor, final Executor cliExecutor) { final RpcServer server = createRaftRpcServer(endpoint, raftExecutor, cliExecutor); - server.start(); + server.startup(); return server; } } diff --git a/jraft-core/src/main/java/com/alipay/sofa/jraft/rpc/impl/AbstractBoltClientService.java b/jraft-core/src/main/java/com/alipay/sofa/jraft/rpc/impl/AbstractBoltClientService.java index 5037b9bb2..1626359b3 100644 --- a/jraft-core/src/main/java/com/alipay/sofa/jraft/rpc/impl/AbstractBoltClientService.java +++ b/jraft-core/src/main/java/com/alipay/sofa/jraft/rpc/impl/AbstractBoltClientService.java @@ -100,7 +100,7 @@ protected void configRpcClient(final RpcClient rpcClient) { protected boolean initRpcClient(final int rpcProcessorThreadPoolSize) { this.rpcClient = new RpcClient(); configRpcClient(this.rpcClient); - this.rpcClient.init(); + this.rpcClient.startup(); this.rpcExecutor = ThreadPoolUtil.newBuilder() // .poolName("JRaft-RPC-Processor") // .enableMetric(true) // diff --git a/jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/StoreEngine.java b/jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/StoreEngine.java index 681b7fcc1..f144fd66a 100644 --- a/jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/StoreEngine.java +++ b/jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/StoreEngine.java @@ -202,7 +202,8 @@ public synchronized boolean init(final StoreEngineOptions opts) { this.rpcServer = new RpcServer(port, true, false); RaftRpcServerFactory.addRaftRequestProcessors(this.rpcServer, this.raftRpcExecutor, this.cliRpcExecutor); StoreEngineHelper.addKvStoreRequestProcessor(this.rpcServer, this); - if (!this.rpcServer.start()) { + this.rpcServer.startup(); + if (!this.rpcServer.isStarted()) { LOG.error("Fail to init [RpcServer]."); return false; } @@ -241,7 +242,7 @@ public synchronized void shutdown() { return; } if (this.rpcServer != null) { - this.rpcServer.stop(); + this.rpcServer.shutdown(); } if (!this.regionEngineTable.isEmpty()) { for (final RegionEngine engine : this.regionEngineTable.values()) { diff --git a/pom.xml b/pom.xml index f54513fb7..245c72c8f 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,7 @@ 3.1.7 6.0 - 1.5.3 + 1.6.1 2.4 2.6 3.3.7