diff --git a/rpc-client/src/main/java/com/antgroup/tugraph/TuGraphDbRpcClient.java b/rpc-client/src/main/java/com/antgroup/tugraph/TuGraphDbRpcClient.java index 295165b..46741e9 100644 --- a/rpc-client/src/main/java/com/antgroup/tugraph/TuGraphDbRpcClient.java +++ b/rpc-client/src/main/java/com/antgroup/tugraph/TuGraphDbRpcClient.java @@ -338,6 +338,8 @@ private void refreshClientPool() { ClusterInfo clusterInfo = JSON.parseObject(JSON.parseArray(result).get(0).toString(), new TypeReference(){}); List raftStates = clusterInfo.getClusterInfo(); raftStates.forEach(x -> { + if (x.getState().equals(RaftState.StateConstant.WITNESS)) + return; TuGraphSingleRpcClient rpcClient = new TuGraphSingleRpcClient("list://" + x.getRpcAddress(), user, password); rpcClientPool.add(rpcClient); if (x.getState().equals(RaftState.StateConstant.MASTER)) { diff --git a/rpc-client/src/main/java/com/antgroup/tugraph/model/RaftState.java b/rpc-client/src/main/java/com/antgroup/tugraph/model/RaftState.java index 99dd2f6..d3640a0 100644 --- a/rpc-client/src/main/java/com/antgroup/tugraph/model/RaftState.java +++ b/rpc-client/src/main/java/com/antgroup/tugraph/model/RaftState.java @@ -28,6 +28,8 @@ public static class StateConstant { public final static String MASTER = "MASTER"; public final static String FOLLOW = "FOLLOW"; + + public final static String WITNESS = "WITNESS"; } }