类 ConfigFuzzyWatchContext

java.lang.Object
com.alibaba.nacos.client.config.impl.ConfigFuzzyWatchContext

public class ConfigFuzzyWatchContext extends Object
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

      public ConfigFuzzyWatchContext(String envName, String groupKeyPattern)
      Constructor with environment name, data ID pattern, and group.
      参数:
      envName - Environment name
      groupKeyPattern - groupKeyPattern
  • 方法详细资料

    • clearOverLimitTs

      public void clearOverLimitTs()
    • refreshOverLimitTs

      public void refreshOverLimitTs()
    • calculateListenersToNotify

      public Set<ConfigFuzzyWatcherWrapper> calculateListenersToNotify(String uuid)
      Calculate the listeners to notify based on the given UUID.
      参数:
      uuid - UUID to filter listeners
      返回:
      Set of listeners to notify
    • notifyWatcher

      public void notifyWatcher(String groupKey, String changedType, String syncType, String uuid)
      Notify the listener with the specified data ID, type, and UUID.
      参数:
      groupKey - groupKey
      uuid - 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

      public boolean addWatcher(ConfigFuzzyWatcherWrapper configFuzzyWatcherWrapper)
      Add a watcher to the context.
      参数:
      configFuzzyWatcherWrapper - watcher to be added
    • getEnvName

      public String getEnvName()
      Get the environment name.
      返回:
      Environment name
    • setEnvName

      public void setEnvName(String envName)
      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

      public String 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

      public Set<String> getReceivedGroupKeys()
      Get the set of data IDs associated with the context. zw
      返回:
      Set of data IDs
    • refreshSyncVersion

      public void refreshSyncVersion()
    • addReceivedGroupKey

      public boolean addReceivedGroupKey(String groupKey)
      add receive group key.
      参数:
      groupKey - group key.
      返回:
    • removeReceivedGroupKey

      public boolean removeReceivedGroupKey(String groupKey)
      remove receive group key.
      参数:
      groupKey - group key.
      返回:
    • getConfigFuzzyWatcherWrappers

      public Set<ConfigFuzzyWatcherWrapper> getConfigFuzzyWatcherWrappers()
      Get the set of listeners associated with the context.
      返回:
      Set of listeners
    • createNewFuture

      public Future<Set<String>> createNewFuture()
      creat a new future of this context.
      返回: