类 ClusterStateManager
java.lang.Object
com.alibaba.csp.sentinel.cluster.ClusterStateManager
Global state manager for Sentinel cluster. This enables switching between cluster token client and server mode.
- 从以下版本开始:
- 1.4.0
- 作者:
- Eric Zhao
-
字段概要
字段修饰符和类型字段说明static final intstatic final intstatic final int -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidapplyState(Integer state) Apply given state to cluster mode.static longstatic intgetMode()static booleanisClient()static booleanisServer()static voidstatic voidregisterProperty(SentinelProperty<Integer> property) static booleanSet current mode to client mode.static booleanSet current mode to server mode.
-
字段详细资料
-
构造器详细资料
-
ClusterStateManager
public ClusterStateManager()
-
-
方法详细资料
-
registerProperty
-
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
Apply given state to cluster mode.- 参数:
state- valid state to apply
-
markToServer
public static void markToServer()
-