类 BasePersistentServiceProcessor
- java.lang.Object
-
- com.alibaba.nacos.consistency.RequestProcessor
-
- com.alibaba.nacos.consistency.cp.RequestProcessor4CP
-
- com.alibaba.nacos.naming.consistency.persistent.impl.BasePersistentServiceProcessor
-
- 所有已实现的接口:
ConsistencyService,PersistentConsistencyService
public abstract class BasePersistentServiceProcessor extends com.alibaba.nacos.consistency.cp.RequestProcessor4CP implements PersistentConsistencyService
New service data persistence handler.- 作者:
- liaochuntao
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 (专用程序包) static classBasePersistentServiceProcessor.Op
-
字段概要
字段 修饰符和类型 字段 说明 protected booleanhasErrorWhether an unrecoverable error occurred.protected java.lang.StringjRaftErrorMsgprotected com.alibaba.nacos.core.storage.kv.KvStoragekvStorageprotected java.util.concurrent.locks.ReentrantReadWriteLocklockDuring snapshot processing, the processing of other requests needs to be paused.protected PersistentNotifiernotifierprotected intpriorityprotected intqueueMaxSizeprotected java.util.concurrent.locks.ReentrantReadWriteLock.ReadLockreadLockprotected com.alibaba.nacos.consistency.Serializerserializerprotected booleanstartNotifyIf use old raft, should not notify listener even new listener add.
-
构造器概要
构造器 构造器 说明 BasePersistentServiceProcessor()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidafterConstruct()protected java.lang.Class<? extends Record>getClassOfRecordFromKey(java.lang.String key)protected java.lang.reflect.TypegetDatumTypeFromKey(java.lang.String key)java.lang.Stringgroup()java.util.List<com.alibaba.nacos.consistency.snapshot.SnapshotOperation>loadSnapshotOperate()private voidnotifierAllServiceMeta(RecordListener listener)This notify should only notify once during startup.private voidnotifierDatum(java.lang.String key, Datum datum, RecordListener listener)protected voidnotifierDatumIfAbsent(java.lang.String key, RecordListener listener)com.alibaba.nacos.consistency.entity.ResponseonApply(com.alibaba.nacos.consistency.entity.WriteRequest request)voidonError(java.lang.Throwable error)com.alibaba.nacos.consistency.entity.ResponseonRequest(com.alibaba.nacos.consistency.entity.ReadRequest request)private voidpublishValueChangeEvent(BasePersistentServiceProcessor.Op op, BatchWriteRequest request)-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 com.alibaba.nacos.naming.consistency.ConsistencyService
get, getErrorMsg, isAvailable, listen, put, remove, unListen
-
-
-
-
字段详细资料
-
kvStorage
protected final com.alibaba.nacos.core.storage.kv.KvStorage kvStorage
-
serializer
protected final com.alibaba.nacos.consistency.Serializer serializer
-
hasError
protected volatile boolean hasError
Whether an unrecoverable error occurred.
-
jRaftErrorMsg
protected volatile java.lang.String jRaftErrorMsg
-
startNotify
protected volatile boolean startNotify
If use old raft, should not notify listener even new listener add.
-
lock
protected final java.util.concurrent.locks.ReentrantReadWriteLock lock
During snapshot processing, the processing of other requests needs to be paused.
-
readLock
protected final java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock readLock
-
notifier
protected final PersistentNotifier notifier
-
queueMaxSize
protected final int queueMaxSize
- 另请参阅:
- 常量字段值
-
priority
protected final int priority
- 另请参阅:
- 常量字段值
-
-
方法详细资料
-
afterConstruct
public void afterConstruct()
-
onRequest
public com.alibaba.nacos.consistency.entity.Response onRequest(com.alibaba.nacos.consistency.entity.ReadRequest request)
- 指定者:
onRequest在类中com.alibaba.nacos.consistency.RequestProcessor
-
onApply
public com.alibaba.nacos.consistency.entity.Response onApply(com.alibaba.nacos.consistency.entity.WriteRequest request)
- 指定者:
onApply在类中com.alibaba.nacos.consistency.RequestProcessor
-
publishValueChangeEvent
private void publishValueChangeEvent(BasePersistentServiceProcessor.Op op, BatchWriteRequest request)
-
group
public java.lang.String group()
- 指定者:
group在类中com.alibaba.nacos.consistency.RequestProcessor
-
loadSnapshotOperate
public java.util.List<com.alibaba.nacos.consistency.snapshot.SnapshotOperation> loadSnapshotOperate()
- 覆盖:
loadSnapshotOperate在类中com.alibaba.nacos.consistency.cp.RequestProcessor4CP
-
onError
public void onError(java.lang.Throwable error)
- 覆盖:
onError在类中com.alibaba.nacos.consistency.RequestProcessor
-
getDatumTypeFromKey
protected java.lang.reflect.Type getDatumTypeFromKey(java.lang.String key)
-
getClassOfRecordFromKey
protected java.lang.Class<? extends Record> getClassOfRecordFromKey(java.lang.String key)
-
notifierDatumIfAbsent
protected void notifierDatumIfAbsent(java.lang.String key, RecordListener listener) throws com.alibaba.nacos.api.exception.NacosException- 抛出:
com.alibaba.nacos.api.exception.NacosException
-
notifierAllServiceMeta
private void notifierAllServiceMeta(RecordListener listener) throws com.alibaba.nacos.api.exception.NacosException
This notify should only notify once during startup.- 抛出:
com.alibaba.nacos.api.exception.NacosException
-
notifierDatum
private void notifierDatum(java.lang.String key, Datum datum, RecordListener listener)
-
-