From 89689d137591e289ebfc2490be96bd3c9f5d92b3 Mon Sep 17 00:00:00 2001 From: Linary Date: Wed, 30 Dec 2020 14:45:13 +0800 Subject: [PATCH] Adapt jraft 1.3.5 (#1313) NOTE: In fact, it still cann't fully adapt to the community version of jraft, because it's different from the rocksdb version that hugegraph relies on Change-Id: I83079e799df4d332e968694c7aea0ff11bbcdb81 --- hugegraph-core/pom.xml | 2 +- .../backend/store/raft/RaftSharedContext.java | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hugegraph-core/pom.xml b/hugegraph-core/pom.xml index 1aa6354f47..a7b7db29b5 100644 --- a/hugegraph-core/pom.xml +++ b/hugegraph-core/pom.xml @@ -54,7 +54,7 @@ com.alipay.sofa jraft-core - 1.3.3 + 1.3.5 org.slf4j diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftSharedContext.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftSharedContext.java index d76cb41c97..8df14051ff 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftSharedContext.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftSharedContext.java @@ -40,7 +40,6 @@ import com.alipay.sofa.jraft.option.RaftOptions; import com.alipay.sofa.jraft.rpc.RaftRpcServerFactory; import com.alipay.sofa.jraft.rpc.RpcServer; -import com.alipay.sofa.jraft.rpc.impl.BoltRaftRpcFactory; import com.alipay.sofa.jraft.util.NamedThreadFactory; import com.alipay.sofa.jraft.util.ThreadPoolUtil; import com.baidu.hugegraph.HugeException; @@ -55,7 +54,6 @@ import com.baidu.hugegraph.config.CoreOptions; import com.baidu.hugegraph.config.HugeConfig; import com.baidu.hugegraph.event.EventHub; -import com.baidu.hugegraph.testutil.Whitebox; import com.baidu.hugegraph.type.HugeType; import com.baidu.hugegraph.type.define.GraphMode; import com.baidu.hugegraph.util.E; @@ -314,12 +312,14 @@ private HugeConfig config() { } private RpcServer initAndStartRpcServer() { - Whitebox.setInternalState( - BoltRaftRpcFactory.class, "CHANNEL_WRITE_BUF_LOW_WATER_MARK", - this.config().get(CoreOptions.RAFT_RPC_BUF_LOW_WATER_MARK)); - Whitebox.setInternalState( - BoltRaftRpcFactory.class, "CHANNEL_WRITE_BUF_HIGH_WATER_MARK", - this.config().get(CoreOptions.RAFT_RPC_BUF_HIGH_WATER_MARK)); + Integer lowWaterMark = this.config().get( + CoreOptions.RAFT_RPC_BUF_LOW_WATER_MARK); + System.setProperty("bolt.channel_write_buf_low_water_mark", + String.valueOf(lowWaterMark)); + Integer highWaterMark = this.config().get( + CoreOptions.RAFT_RPC_BUF_HIGH_WATER_MARK); + System.setProperty("bolt.channel_write_buf_high_water_mark", + String.valueOf(highWaterMark)); PeerId serverId = new PeerId(); serverId.parse(this.config().get(CoreOptions.RAFT_ENDPOINT));