类 JRaftServer

java.lang.Object
com.alibaba.nacos.core.distributed.raft.JRaftServer

public class JRaftServer extends Object
JRaft server instance, away from Spring IOC management.

Why do we need to create a raft group based on the value of LogProcessor group (), that is, each function module has its own state machine. Because each LogProcessor corresponds to a different functional module, such as Nacos's naming module and config module, these two modules are independent of each other and do not affect each other. If we have only one state machine, it is equal to the log of all functional modules The processing is loaded together. Any module that has an exception during the log processing and a long block operation will affect the normal operation of other functional modules.

作者:
liaochuntao
  • 构造器详细资料

    • JRaftServer

      public JRaftServer()
  • 方法详细资料

    • setFailoverRetries

      public void setFailoverRetries(int failoverRetries)
    • readFromLeader

      public void readFromLeader(com.alibaba.nacos.consistency.entity.ReadRequest request, CompletableFuture<com.alibaba.nacos.consistency.entity.Response> future)
    • commit

      public CompletableFuture<com.alibaba.nacos.consistency.entity.Response> commit(String group, com.google.protobuf.Message data, CompletableFuture<com.alibaba.nacos.consistency.entity.Response> future)
    • getLeader

      protected com.alipay.sofa.jraft.entity.PeerId getLeader(String raftGroupId)
    • applyOperation

      public void applyOperation(com.alipay.sofa.jraft.Node node, com.google.protobuf.Message data, FailoverClosure closure)
    • findTupleByGroup

      public JRaftServer.RaftGroupTuple findTupleByGroup(String group)
    • findNodeByGroup

      public com.alipay.sofa.jraft.Node findNodeByGroup(String group)