类 ConfigFuzzyWatchContext
java.lang.Object
com.alibaba.nacos.client.config.impl.ConfigFuzzyWatchContext
fuzzy watcher context for a single group key pattern.
This class manages the context information for fuzzy listening, including environment name, task ID, data ID pattern, group, tenant, listener set, and other related information.
- 作者:
- stone-98
-
构造器概要
构造器构造器说明ConfigFuzzyWatchContext(String envName, String groupKeyPattern) Constructor with environment name, data ID pattern, and group. -
方法概要
修饰符和类型方法说明booleanaddReceivedGroupKey(String groupKey) add receive group key.booleanaddWatcher(ConfigFuzzyWatcherWrapper configFuzzyWatcherWrapper) Add a watcher to the context.Calculate the listeners to notify based on the given UUID.voidcreat a new future of this context.Get the set of listeners associated with the context.Get the environment name.Get the set of data IDs associated with the context. zwintintGet the task ID.booleanGet the flag indicating whether the context is consistent with the server.booleanCheck if the context is discarded.booleanCheck if the context is initializing.voidMark initialization as complete and notify waiting threads.voidnotifyLoaderWatcher(int code) notify loader watcher.voidnotifyWatcher(String groupKey, String changedType, String syncType, String uuid) Notify the listener with the specified data ID, type, and UUID.voidvoidbooleanremoveReceivedGroupKey(String groupKey) remove receive group key.voidremoveWatcher(com.alibaba.nacos.api.config.listener.FuzzyWatchEventWatcher watcher) Remove a watcher from the context.voidsetConsistentWithServer(boolean isConsistentWithServer) voidsetDiscard(boolean discard) Set the flag indicating whether the context is discarded.voidsetEnvName(String envName) Set the environment name.voidsetTaskId(int taskId) Set the task ID.
-
构造器详细资料
-
ConfigFuzzyWatchContext
Constructor with environment name, data ID pattern, and group.- 参数:
envName- Environment namegroupKeyPattern- groupKeyPattern
-
-
方法详细资料
-
clearOverLimitTs
public void clearOverLimitTs() -
refreshOverLimitTs
public void refreshOverLimitTs() -
calculateListenersToNotify
Calculate the listeners to notify based on the given UUID.- 参数:
uuid- UUID to filter listeners- 返回:
- Set of listeners to notify
-
notifyWatcher
Notify the listener with the specified data ID, type, and UUID.- 参数:
groupKey- groupKeyuuid- UUID to filter listeners
-
notifyLoaderWatcher
public void notifyLoaderWatcher(int code) notify loader watcher.- 参数:
code- over limit code,FUZZY_WATCH_PATTERN_MATCH_COUNT_OVER_LIMIT or FUZZY_WATCH_PATTERN_OVER_LIMIT.
-
markInitializationComplete
public void markInitializationComplete()Mark initialization as complete and notify waiting threads. -
removeWatcher
public void removeWatcher(com.alibaba.nacos.api.config.listener.FuzzyWatchEventWatcher watcher) Remove a watcher from the context.- 参数:
watcher- watcher to be removed
-
addWatcher
Add a watcher to the context.- 参数:
configFuzzyWatcherWrapper- watcher to be added
-
getEnvName
Get the environment name.- 返回:
- Environment name
-
setEnvName
Set the environment name.- 参数:
envName- Environment name to be set
-
getTaskId
public int getTaskId()Get the task ID.- 返回:
- Task ID
-
setTaskId
public void setTaskId(int taskId) Set the task ID.- 参数:
taskId- Task ID to be set
-
getGroupKeyPattern
-
isConsistentWithServer
public boolean isConsistentWithServer()Get the flag indicating whether the context is consistent with the server.- 返回:
- AtomicBoolean indicating whether the context is consistent with the server
-
setConsistentWithServer
public void setConsistentWithServer(boolean isConsistentWithServer) -
isDiscard
public boolean isDiscard()Check if the context is discarded.- 返回:
- True if the context is discarded, otherwise false
-
setDiscard
public void setDiscard(boolean discard) Set the flag indicating whether the context is discarded.- 参数:
discard- True to mark the context as discarded, otherwise false
-
isInitializing
public boolean isInitializing()Check if the context is initializing.- 返回:
- True if the context is initializing, otherwise false
-
getReceivedGroupKeysCount
public int getReceivedGroupKeysCount() -
getReceivedGroupKeys
Get the set of data IDs associated with the context. zw- 返回:
- Set of data IDs
-
refreshSyncVersion
public void refreshSyncVersion() -
addReceivedGroupKey
add receive group key.- 参数:
groupKey- group key.- 返回:
-
removeReceivedGroupKey
remove receive group key.- 参数:
groupKey- group key.- 返回:
-
getConfigFuzzyWatcherWrappers
Get the set of listeners associated with the context.- 返回:
- Set of listeners
-
createNewFuture
creat a new future of this context.- 返回:
-