类 JRaftServer
java.lang.Object
com.alibaba.nacos.core.distributed.raft.JRaftServer
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
-
嵌套类概要
嵌套类 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidapplyOperation(com.alipay.sofa.jraft.Node node, com.google.protobuf.Message data, FailoverClosure closure)CompletableFuture<com.alibaba.nacos.consistency.entity.Response>commit(String group, com.google.protobuf.Message data, CompletableFuture<com.alibaba.nacos.consistency.entity.Response> future)com.alipay.sofa.jraft.NodefindNodeByGroup(String group)findTupleByGroup(String group)protected com.alipay.sofa.jraft.entity.PeerIdvoidreadFromLeader(com.alibaba.nacos.consistency.entity.ReadRequest request, CompletableFuture<com.alibaba.nacos.consistency.entity.Response> future)voidsetFailoverRetries(int failoverRetries)
-
构造器详细资料
-
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
-
applyOperation
public void applyOperation(com.alipay.sofa.jraft.Node node, com.google.protobuf.Message data, FailoverClosure closure) -
findTupleByGroup
-
findNodeByGroup
-