类 ClusterFlowRuleManager

java.lang.Object
com.alibaba.csp.sentinel.cluster.flow.rule.ClusterFlowRuleManager

public final class ClusterFlowRuleManager extends Object
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 int
    getConnectedCount(long flowId)
    Get connected count for associated namespace of given flowId.
    static Set<Long>
    getFlowIdSet(String namespace)
     
    static com.alibaba.csp.sentinel.slots.block.flow.FlowRule
    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 String
    getNamespace(long flowId)
     
    static void
    loadRules(String namespace, List<com.alibaba.csp.sentinel.slots.block.flow.FlowRule> rules)
    Load flow rules for a specific namespace.
    static void
    Listen to the SentinelProperty for cluster FlowRules.
    static void
    Listen to the SentinelProperty for cluster FlowRules if current property for namespace is absent.
    static void
    Remove cluster flow rule property for a specific namespace.
    static void
    setPropertySupplier(com.alibaba.csp.sentinel.util.function.Function<String,com.alibaba.csp.sentinel.property.SentinelProperty<List<com.alibaba.csp.sentinel.slots.block.flow.FlowRule>>> propertySupplier)
     

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 字段详细资料

    • 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_SUPPLIER
      The default cluster flow rule property supplier that creates a new dynamic property for a specific namespace to do rule management manually.
  • 方法详细资料

    • setPropertySupplier

      public static void setPropertySupplier(com.alibaba.csp.sentinel.util.function.Function<String,com.alibaba.csp.sentinel.property.SentinelProperty<List<com.alibaba.csp.sentinel.slots.block.flow.FlowRule>>> propertySupplier)
    • register2Property

      public static void register2Property(String namespace)
      Listen to the SentinelProperty for cluster FlowRules. The property is the source of cluster FlowRules for a specific namespace.
      参数:
      namespace - namespace to register
    • registerPropertyIfAbsent

      public static void registerPropertyIfAbsent(String namespace)
      Listen to the SentinelProperty for cluster FlowRules if current property for namespace is absent. The property is the source of cluster FlowRules for a specific namespace.
      参数:
      namespace - namespace to register
    • removeProperty

      public static void removeProperty(String namespace)
      Remove cluster flow rule property for a specific namespace.
      参数:
      namespace - valid namespace
    • getFlowRuleById

      public static com.alibaba.csp.sentinel.slots.block.flow.FlowRule getFlowRuleById(Long id)
      Get flow rule by rule ID.
      参数:
      id - rule ID
      返回:
      flow rule
    • getFlowIdSet

      public static Set<Long> getFlowIdSet(String namespace)
    • getAllFlowRules

      public static List<com.alibaba.csp.sentinel.slots.block.flow.FlowRule> 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 namespace
      rules - rule list
    • getConnectedCount

      public static int getConnectedCount(long flowId)
      Get connected count for associated namespace of given flowId.
      参数:
      flowId - unique flow ID
      返回:
      connected count
    • getNamespace

      public static String getNamespace(long flowId)