类 ClusterParamFlowRuleManager
java.lang.Object
com.alibaba.csp.sentinel.cluster.flow.rule.ClusterParamFlowRuleManager
Manager for cluster parameter flow rules.
- 从以下版本开始:
- 1.4.0
- 作者:
- Eric Zhao
-
字段概要
字段修饰符和类型字段说明static final com.alibaba.csp.sentinel.util.function.Function<String,com.alibaba.csp.sentinel.property.SentinelProperty<List<com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule>>> The default cluster parameter flow rule property supplier that creates a new dynamic property for a specific namespace to manually do rule management. -
方法概要
修饰符和类型方法说明static List<com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule>static intgetConnectedCount(long flowId) Get connected count for associated namespace of givenflowId.getFlowIdSet(String namespace) static StringgetNamespace(long flowId) static com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRulegetParamRuleById(Long id) static List<com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule>getParamRules(String namespace) Get all cluster parameter flow rules within a specific namespace.static voidloadRules(String namespace, List<com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule> rules) Load parameter flow rules for a specific namespace.static voidregister2Property(String namespace) Listen to theSentinelPropertyfor clusterParamFlowRules.static voidregisterPropertyIfAbsent(String namespace) static voidremoveProperty(String namespace) static voidsetPropertySupplier(com.alibaba.csp.sentinel.util.function.Function<String, com.alibaba.csp.sentinel.property.SentinelProperty<List<com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule>>> propertySupplier)
-
字段详细资料
-
DEFAULT_PROPERTY_SUPPLIER
public static final com.alibaba.csp.sentinel.util.function.Function<String,com.alibaba.csp.sentinel.property.SentinelProperty<List<com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule>>> DEFAULT_PROPERTY_SUPPLIERThe default cluster parameter flow rule property supplier that creates a new dynamic property for a specific namespace to manually do rule management.
-
-
方法详细资料
-
setPropertySupplier
-
getNamespace
-
register2Property
Listen to theSentinelPropertyfor clusterParamFlowRules. The property is the source of clusterParamFlowRules for a specific namespace.- 参数:
namespace- namespace to register
-
registerPropertyIfAbsent
-
removeProperty
-
getParamRuleById
public static com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule getParamRuleById(Long id) -
getFlowIdSet
-
getAllParamRules
public static List<com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule> getAllParamRules() -
getParamRules
public static List<com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule> getParamRules(String namespace) Get all cluster parameter flow rules within a specific namespace.- 参数:
namespace- a valid namespace- 返回:
- cluster parameter flow rules within the provided namespace
-
loadRules
public static void loadRules(String namespace, List<com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule> rules) Load parameter flow rules for a specific namespace. The former rules of the namespace will be replaced.- 参数:
namespace- a valid namespacerules- rule list
-
getConnectedCount
public static int getConnectedCount(long flowId) Get connected count for associated namespace of givenflowId.- 参数:
flowId- existing rule ID- 返回:
- connected count
-