Skip to content

Commit

Permalink
Adapt jraft 1.3.5 (#1313)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Linary authored Dec 30, 2020
1 parent 717d93e commit 89689d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion hugegraph-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>jraft-core</artifactId>
<version>1.3.3</version>
<version>1.3.5</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 89689d1

Please sign in to comment.