类 ClusterFlowRuleManager
java.lang.Object
com.alibaba.csp.sentinel.cluster.flow.rule.ClusterFlowRuleManager
Manager for cluster 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.FlowRule>>> The default cluster flow rule property supplier that creates a new dynamic property for a specific namespace to do rule management manually. -
方法概要
修饰符和类型方法说明static List<com.alibaba.csp.sentinel.slots.block.flow.FlowRule>static intgetConnectedCount(long flowId) Get connected count for associated namespace of givenflowId.getFlowIdSet(String namespace) static com.alibaba.csp.sentinel.slots.block.flow.FlowRulegetFlowRuleById(Long id) Get flow rule by rule ID.static List<com.alibaba.csp.sentinel.slots.block.flow.FlowRule>getFlowRules(String namespace) Get all cluster flow rules within a specific namespace.static StringgetNamespace(long flowId) static voidLoad flow rules for a specific namespace.static voidregister2Property(String namespace) Listen to theSentinelPropertyfor clusterFlowRules.static voidregisterPropertyIfAbsent(String namespace) Listen to theSentinelPropertyfor clusterFlowRules if current property for namespace is absent.static voidremoveProperty(String namespace) Remove cluster flow rule property for a specific 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.FlowRule>>> 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.FlowRule>>> DEFAULT_PROPERTY_SUPPLIERThe default cluster flow rule property supplier that creates a new dynamic property for a specific namespace to do rule management manually.
-
-
方法详细资料
-
setPropertySupplier
-
register2Property
Listen to theSentinelPropertyfor clusterFlowRules. The property is the source of clusterFlowRules for a specific namespace.- 参数:
namespace- namespace to register
-
registerPropertyIfAbsent
Listen to theSentinelPropertyfor clusterFlowRules if current property for namespace is absent. The property is the source of clusterFlowRules for a specific namespace.- 参数:
namespace- namespace to register
-
removeProperty
Remove cluster flow rule property for a specific namespace.- 参数:
namespace- valid namespace
-
getFlowRuleById
Get flow rule by rule ID.- 参数:
id- rule ID- 返回:
- flow rule
-
getFlowIdSet
-
getAllFlowRules
-
getFlowRules
public static List<com.alibaba.csp.sentinel.slots.block.flow.FlowRule> getFlowRules(String namespace) Get all cluster flow rules within a specific namespace.- 参数:
namespace- valid namespace- 返回:
- cluster flow rules within the provided namespace
-
loadRules
public static void loadRules(String namespace, List<com.alibaba.csp.sentinel.slots.block.flow.FlowRule> rules) Load 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- unique flow ID- 返回:
- connected count
-
getNamespace
-