类 PersistentServiceProcessor
- java.lang.Object
-
- com.alibaba.nacos.consistency.RequestProcessor
-
- com.alibaba.nacos.consistency.cp.RequestProcessor4CP
-
- com.alibaba.nacos.naming.consistency.persistent.impl.BasePersistentServiceProcessor
-
- com.alibaba.nacos.naming.consistency.persistent.impl.PersistentServiceProcessor
-
- 所有已实现的接口:
ConsistencyService,PersistentConsistencyService
public class PersistentServiceProcessor extends BasePersistentServiceProcessor
In cluster mode, start the Raft protocol.- 作者:
- liaochuntao
-
-
嵌套类概要
-
从类继承的嵌套类/接口 com.alibaba.nacos.naming.consistency.persistent.impl.BasePersistentServiceProcessor
BasePersistentServiceProcessor.Op
-
-
字段概要
字段 修饰符和类型 字段 说明 private booleanhasLeaderIs there a leader node currently.private com.alibaba.nacos.consistency.cp.CPProtocolprotocol-
从类继承的字段 com.alibaba.nacos.naming.consistency.persistent.impl.BasePersistentServiceProcessor
hasError, jRaftErrorMsg, kvStorage, lock, notifier, priority, queueMaxSize, readLock, serializer, startNotify
-
-
构造器概要
构造器 构造器 说明 PersistentServiceProcessor(com.alibaba.nacos.core.distributed.ProtocolManager protocolManager)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidafterConstruct()Datumget(java.lang.String key)Get a data from Nacos cluster.java.util.Optional<java.lang.String>getErrorMsg()Get the error message of the consistency protocol.booleanisAvailable()Tell the status of this consistency service.voidlisten(java.lang.String key, RecordListener listener)Listen for changes of a data.voidput(java.lang.String key, Record value)Put a data related to a key to Nacos cluster.voidremove(java.lang.String key)Remove a data from Nacos cluster.voidunListen(java.lang.String key, RecordListener listener)Cancel listening of a data.private voidwaitLeader()-
从类继承的方法 com.alibaba.nacos.naming.consistency.persistent.impl.BasePersistentServiceProcessor
getClassOfRecordFromKey, getDatumTypeFromKey, group, loadSnapshotOperate, notifierDatumIfAbsent, onApply, onError, onRequest
-
-
-
-
方法详细资料
-
afterConstruct
public void afterConstruct()
-
waitLeader
private void waitLeader()
-
put
public void put(java.lang.String key, Record value) throws com.alibaba.nacos.api.exception.NacosException从接口复制的说明:ConsistencyServicePut a data related to a key to Nacos cluster.- 参数:
key- key of data, this key should be globally uniquevalue- value of data- 抛出:
com.alibaba.nacos.api.exception.NacosException- nacos exception
-
remove
public void remove(java.lang.String key) throws com.alibaba.nacos.api.exception.NacosException从接口复制的说明:ConsistencyServiceRemove a data from Nacos cluster.- 参数:
key- key of data- 抛出:
com.alibaba.nacos.api.exception.NacosException- nacos exception
-
get
public Datum get(java.lang.String key) throws com.alibaba.nacos.api.exception.NacosException
从接口复制的说明:ConsistencyServiceGet a data from Nacos cluster.- 参数:
key- key of data- 返回:
- data related to the key
- 抛出:
com.alibaba.nacos.api.exception.NacosException- nacos exception
-
listen
public void listen(java.lang.String key, RecordListener listener) throws com.alibaba.nacos.api.exception.NacosException从接口复制的说明:ConsistencyServiceListen for changes of a data.- 参数:
key- key of datalistener- callback of data change- 抛出:
com.alibaba.nacos.api.exception.NacosException- nacos exception
-
unListen
public void unListen(java.lang.String key, RecordListener listener) throws com.alibaba.nacos.api.exception.NacosException从接口复制的说明:ConsistencyServiceCancel listening of a data.- 参数:
key- key of datalistener- callback of data change- 抛出:
com.alibaba.nacos.api.exception.NacosException- nacos exception
-
isAvailable
public boolean isAvailable()
从接口复制的说明:ConsistencyServiceTell the status of this consistency service.- 返回:
- true if available
-
getErrorMsg
public java.util.Optional<java.lang.String> getErrorMsg()
从接口复制的说明:ConsistencyServiceGet the error message of the consistency protocol.- 返回:
- the consistency protocol error message.
-
-