类 ClusterStateManager

java.lang.Object
com.alibaba.csp.sentinel.cluster.ClusterStateManager

public final class ClusterStateManager extends Object

Global state manager for Sentinel cluster. This enables switching between cluster token client and server mode.

从以下版本开始:
1.4.0
作者:
Eric Zhao
  • 字段详细资料

    • CLUSTER_CLIENT

      public static final int CLUSTER_CLIENT
      另请参阅:
    • CLUSTER_SERVER

      public static final int CLUSTER_SERVER
      另请参阅:
    • CLUSTER_NOT_STARTED

      public static final int CLUSTER_NOT_STARTED
      另请参阅:
  • 构造器详细资料

    • ClusterStateManager

      public ClusterStateManager()
  • 方法详细资料

    • registerProperty

      public static void registerProperty(SentinelProperty<Integer> property)
    • getMode

      public static int getMode()
    • isClient

      public static boolean isClient()
    • isServer

      public static boolean isServer()
    • setToClient

      public static boolean setToClient()

      Set current mode to client mode. If Sentinel currently works in server mode, it will be turned off. Then the cluster client will be started.

    • setToServer

      public static boolean setToServer()

      Set current mode to server mode. If Sentinel currently works in client mode, it will be turned off. Then the cluster server will be started.

    • getLastModified

      public static long getLastModified()
    • applyState

      public static void applyState(Integer state)
      Apply given state to cluster mode.
      参数:
      state - valid state to apply
    • markToServer

      public static void markToServer()