类 ClusterServerConfigManager
java.lang.Object
com.alibaba.csp.sentinel.cluster.server.config.ClusterServerConfigManager
- 从以下版本开始:
- 1.4.0
- 作者:
- Eric Zhao
-
方法概要
修饰符和类型方法说明static voidAdd a transport config observer.static doublestatic doublegetExceedCount(String namespace) static intstatic intstatic intgetIntervalMs(String namespace) static doublestatic doublegetMaxAllowedQps(String namespace) static doublestatic doublegetMaxOccupyRatio(String namespace) static intgetPort()static intstatic intgetSampleCount(String namespace) Get sample count of provided namespace.static booleanstatic booleanisValidFlowConfig(ServerFlowConfig config) static booleanstatic voidloadFlowConfig(String namespace, ServerFlowConfig config) Load server flow config for a specific namespace.static voidloadGlobalFlowConfig(ServerFlowConfig config) Load provided server global statistic (flow) configuration to property in memory.static voidLoad provided server transport configuration to property in memory.static voidloadServerNamespaceSet(Set<String> namespaceSet) Load provided server namespace set to property in memory.static voidregisterGlobalServerFlowProperty(com.alibaba.csp.sentinel.property.SentinelProperty<ServerFlowConfig> property) Register cluster server global statistic (flow) configuration dynamic property.static voidregisterNamespaceSetProperty(com.alibaba.csp.sentinel.property.SentinelProperty<Set<String>> property) Register cluster server namespace set dynamic property.static voidregisterServerTransportProperty(com.alibaba.csp.sentinel.property.SentinelProperty<ServerTransportConfig> property) Register cluster server transport configuration dynamic property.static voidsetEmbedded(boolean embedded) Set the embedded mode flag for the token server.static voidsetMaxAllowedQps(double maxAllowedQps) static voidsetNamespaceSet(Set<String> namespaceSet)
-
方法详细资料
-
registerNamespaceSetProperty
public static void registerNamespaceSetProperty(com.alibaba.csp.sentinel.property.SentinelProperty<Set<String>> property) Register cluster server namespace set dynamic property.- 参数:
property- server namespace set dynamic property
-
registerServerTransportProperty
public static void registerServerTransportProperty(com.alibaba.csp.sentinel.property.SentinelProperty<ServerTransportConfig> property) Register cluster server transport configuration dynamic property.- 参数:
property- server transport configuration dynamic property
-
registerGlobalServerFlowProperty
public static void registerGlobalServerFlowProperty(com.alibaba.csp.sentinel.property.SentinelProperty<ServerFlowConfig> property) Register cluster server global statistic (flow) configuration dynamic property.- 参数:
property- server flow configuration dynamic property
-
loadServerNamespaceSet
Load provided server namespace set to property in memory.- 参数:
namespaceSet- valid namespace set
-
loadGlobalTransportConfig
Load provided server transport configuration to property in memory.- 参数:
config- valid cluster server transport configuration
-
loadGlobalFlowConfig
Load provided server global statistic (flow) configuration to property in memory.- 参数:
config- valid cluster server flow configuration for global
-
loadFlowConfig
Load server flow config for a specific namespace.- 参数:
namespace- a valid namespaceconfig- valid flow config for the namespace
-
addTransportConfigChangeObserver
Add a transport config observer. The observers will be called as soon as there are some changes in transport config (e.g. token server port).- 参数:
observer- a valid transport config observer
-
isValidTransportConfig
-
isValidFlowConfig
-
getExceedCount
-
getMaxOccupyRatio
-
getIntervalMs
-
getSampleCount
Get sample count of provided namespace.- 参数:
namespace- valid namespace- 返回:
- the sample count of namespace; if the namespace does not have customized value, use the global value
-
getMaxAllowedQps
public static double getMaxAllowedQps() -
getMaxAllowedQps
-
getExceedCount
public static double getExceedCount() -
getMaxOccupyRatio
public static double getMaxOccupyRatio() -
getNamespaceSet
-
getPort
public static int getPort() -
getIdleSeconds
public static int getIdleSeconds() -
getIntervalMs
public static int getIntervalMs() -
getSampleCount
public static int getSampleCount() -
setNamespaceSet
-
isEmbedded
public static boolean isEmbedded() -
setEmbedded
public static void setEmbedded(boolean embedded) Set the embedded mode flag for the token server.
NOTE: developers SHOULD NOT manually invoke this method. The embedded flag should be initialized by Sentinel when starting token server.
- 参数:
embedded- whether the token server is currently running in embedded mode
-
setMaxAllowedQps
public static void setMaxAllowedQps(double maxAllowedQps)
-