类 CtSph
java.lang.Object
com.alibaba.csp.sentinel.CtSph
- 所有已实现的接口:
Sph,SphResourceTypeSupport
- 作者:
- jialiang.linjl, leyou(lihao), Eric Zhao
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明asyncEntry(String name, EntryType type, int count, Object... args) Create a protected asynchronous resource.asyncEntryWithType(String name, int resourceType, EntryType entryType, int count, boolean prioritized, Object[] args) Record statistics and perform rule checking for the given resource that indicates an async invocation.entry(ResourceWrapper resourceWrapper, int count, Object... args) Do allRules checking about the resource.Record statistics and perform rule checking for the given method.Record statistics and perform rule checking for the given method.Record statistics and perform rule checking for the given method.Record statistics and perform rule checking for the given method.Record statistics and perform rule checking for the given resource.Record statistics and perform rule checking for the given resource.Record statistics and perform rule checking for the given resource.Record statistics and perform rule checking for the given resource.Record statistics and perform rule checking for the given resource.Record statistics and perform rule checking for the given resource.static intGet current size of created slot chains.entryWithPriority(String name, EntryType type, int count, boolean prioritized) Create a protected resource with priority.entryWithPriority(String name, EntryType type, int count, boolean prioritized, Object... args) Create a protected resource with priority.entryWithType(String name, int resourceType, EntryType entryType, int count, boolean prioritized, Object[] args) Record statistics and perform rule checking for the given resource with the provided classification.entryWithType(String name, int resourceType, EntryType entryType, int count, Object[] args) Record statistics and perform rule checking for the given resource with provided classification.
-
构造器详细资料
-
CtSph
public CtSph()
-
-
方法详细资料
-
entry
public Entry entry(ResourceWrapper resourceWrapper, int count, Object... args) throws BlockException Do allRules checking about the resource.Each distinct resource will use a
ProcessorSlotto do rules checking. Same resource will use sameProcessorSlotglobally.Note that total
ProcessorSlotcount must not exceedConstants.MAX_SLOT_CHAIN_SIZE, otherwise no rules checking will do. In this condition, all requests will pass directly, with no checking or exception.- 参数:
resourceWrapper- resource namecount- tokens neededargs- arguments of user method call- 返回:
Entryrepresents this call- 抛出:
BlockException- if any rule's threshold is exceeded
-
entrySize
public static int entrySize()Get current size of created slot chains.- 返回:
- size of created slot chains
- 从以下版本开始:
- 0.2.0
-
entry
从接口复制的说明:SphRecord statistics and perform rule checking for the given resource.- 指定者:
entry在接口中Sph- 参数:
name- the unique name of the protected resource- 返回:
- the
Entryof this invocation (used for mark the invocation complete and get context data). - 抛出:
BlockException- if the block criteria is met
-
entry
从接口复制的说明:SphRecord statistics and perform rule checking for the given method.- 指定者:
entry在接口中Sph- 参数:
method- the protected method- 返回:
- the
Entryof this invocation (used for mark the invocation complete and get context data). - 抛出:
BlockException- if the block criteria is met
-
entry
从接口复制的说明:SphRecord statistics and perform rule checking for the given method.- 指定者:
entry在接口中Sph- 参数:
method- the protected methodtype- the traffic type (inbound, outbound or internal). This is used to mark whether it can be blocked when the system is unstable, only inbound traffic could be blocked bySystemRule- 返回:
- the
Entryof this invocation (used for mark the invocation complete and get context data). - 抛出:
BlockException- if the block criteria is met
-
entry
从接口复制的说明:SphRecord statistics and perform rule checking for the given resource.- 指定者:
entry在接口中Sph- 参数:
name- the unique name for the protected resourcetype- the traffic type (inbound, outbound or internal). This is used to mark whether it can be blocked when the system is unstable, only inbound traffic could be blocked bySystemRule- 返回:
- the
Entryof this invocation (used for mark the invocation complete and get context data). - 抛出:
BlockException- if the block criteria is met
-
entry
从接口复制的说明:SphRecord statistics and perform rule checking for the given method.- 指定者:
entry在接口中Sph- 参数:
method- the protected methodtype- the traffic type (inbound, outbound or internal). This is used to mark whether it can be blocked when the system is unstable, only inbound traffic could be blocked bySystemRulecount- the amount of calls within the invocation (e.g. batchCount=2 means request for 2 tokens)- 返回:
- the
Entryof this invocation (used for mark the invocation complete and get context data). - 抛出:
BlockException- if the block criteria is met
-
entry
从接口复制的说明:SphRecord statistics and perform rule checking for the given resource.- 指定者:
entry在接口中Sph- 参数:
name- the unique name for the protected resourcetype- the traffic type (inbound, outbound or internal). This is used to mark whether it can be blocked when the system is unstable, only inbound traffic could be blocked bySystemRulecount- the amount of calls within the invocation (e.g. batchCount=2 means request for 2 tokens)- 返回:
- the
Entryof this invocation (used for mark the invocation complete and get context data). - 抛出:
BlockException- if the block criteria is met
-
entry
从接口复制的说明:SphRecord statistics and perform rule checking for the given method.- 指定者:
entry在接口中Sph- 参数:
method- the protected methodcount- the amount of calls within the invocation (e.g. batchCount=2 means request for 2 tokens)- 返回:
- the
Entryof this invocation (used for mark the invocation complete and get context data). - 抛出:
BlockException- if the block criteria is met
-
entry
从接口复制的说明:SphRecord statistics and perform rule checking for the given resource.- 指定者:
entry在接口中Sph- 参数:
name- the unique string for the resourcecount- the amount of calls within the invocation (e.g. batchCount=2 means request for 2 tokens)- 返回:
- the
Entryof this invocation (used for mark the invocation complete and get context data). - 抛出:
BlockException- if the block criteria is met
-
entry
从接口复制的说明:SphRecord statistics and perform rule checking for the given resource.- 指定者:
entry在接口中Sph- 参数:
method- the protected methodtype- the traffic type (inbound, outbound or internal). This is used to mark whether it can be blocked when the system is unstable, only inbound traffic could be blocked bySystemRulecount- the amount of calls within the invocation (e.g. batchCount=2 means request for 2 tokens)args- parameters of the method for flow control or customized slots- 返回:
- the
Entryof this invocation (used for mark the invocation complete and get context data). - 抛出:
BlockException- if the block criteria is met
-
entry
从接口复制的说明:SphRecord statistics and perform rule checking for the given resource.- 指定者:
entry在接口中Sph- 参数:
name- the unique name for the protected resourcetype- the traffic type (inbound, outbound or internal). This is used to mark whether it can be blocked when the system is unstable, only inbound traffic could be blocked bySystemRulecount- the amount of calls within the invocation (e.g. batchCount=2 means request for 2 tokens)args- args for parameter flow control or customized slots- 返回:
- the
Entryof this invocation (used for mark the invocation complete and get context data) - 抛出:
BlockException- if the block criteria is met
-
asyncEntry
public AsyncEntry asyncEntry(String name, EntryType type, int count, Object... args) throws BlockException 从接口复制的说明:SphCreate a protected asynchronous resource.- 指定者:
asyncEntry在接口中Sph- 参数:
name- the unique name for the protected resourcetype- the traffic type (inbound, outbound or internal). This is used to mark whether it can be blocked when the system is unstable, only inbound traffic could be blocked bySystemRulecount- the amount of calls within the invocation (e.g. batchCount=2 means request for 2 tokens)args- args for parameter flow control or customized slots- 返回:
- created asynchronous entry
- 抛出:
BlockException- if the block criteria is met
-
entryWithPriority
public Entry entryWithPriority(String name, EntryType type, int count, boolean prioritized) throws BlockException 从接口复制的说明:SphCreate a protected resource with priority.- 指定者:
entryWithPriority在接口中Sph- 参数:
name- the unique name for the protected resourcetype- the traffic type (inbound, outbound or internal). This is used to mark whether it can be blocked when the system is unstable, only inbound traffic could be blocked bySystemRulecount- the amount of calls within the invocation (e.g. batchCount=2 means request for 2 tokens)prioritized- whether the entry is prioritized- 返回:
- the
Entryof this invocation (used for mark the invocation complete and get context data) - 抛出:
BlockException- if the block criteria is met
-
entryWithPriority
public Entry entryWithPriority(String name, EntryType type, int count, boolean prioritized, Object... args) throws BlockException 从接口复制的说明:SphCreate a protected resource with priority.- 指定者:
entryWithPriority在接口中Sph- 参数:
name- the unique name for the protected resourcetype- the traffic type (inbound, outbound or internal). This is used to mark whether it can be blocked when the system is unstable, only inbound traffic could be blocked bySystemRulecount- the amount of calls within the invocation (e.g. batchCount=2 means request for 2 tokens)prioritized- whether the entry is prioritizedargs- args for parameter flow control or customized slots- 返回:
- the
Entryof this invocation (used for mark the invocation complete and get context data) - 抛出:
BlockException- if the block criteria is met
-
entryWithType
public Entry entryWithType(String name, int resourceType, EntryType entryType, int count, Object[] args) throws BlockException 从接口复制的说明:SphResourceTypeSupportRecord statistics and perform rule checking for the given resource with provided classification.- 指定者:
entryWithType在接口中SphResourceTypeSupport- 参数:
name- the unique name of the protected resourceresourceType- the classification of the resourceentryType- the traffic type (inbound, outbound or internal). This is used to mark whether it can be blocked when the system is unstable, only inbound traffic could be blocked bySystemRulecount- the amount of calls within the invocation (e.g. batchCount=2 means request for 2 tokens)args- args for parameter flow control or customized slots- 返回:
- the
Entryof this invocation (used for mark the invocation complete and get context data) - 抛出:
BlockException- if the block criteria is met
-
entryWithType
public Entry entryWithType(String name, int resourceType, EntryType entryType, int count, boolean prioritized, Object[] args) throws BlockException 从接口复制的说明:SphResourceTypeSupportRecord statistics and perform rule checking for the given resource with the provided classification.- 指定者:
entryWithType在接口中SphResourceTypeSupport- 参数:
name- the unique name of the protected resourceresourceType- classification of the resource (e.g. Web or RPC)entryType- the traffic type (inbound, outbound or internal). This is used to mark whether it can be blocked when the system is unstable, only inbound traffic could be blocked bySystemRulecount- the amount of calls within the invocation (e.g. batchCount=2 means request for 2 tokens)prioritized- whether the entry is prioritizedargs- args for parameter flow control or customized slots- 返回:
- the
Entryof this invocation (used for mark the invocation complete and get context data) - 抛出:
BlockException- if the block criteria is met
-
asyncEntryWithType
public AsyncEntry asyncEntryWithType(String name, int resourceType, EntryType entryType, int count, boolean prioritized, Object[] args) throws BlockException 从接口复制的说明:SphResourceTypeSupportRecord statistics and perform rule checking for the given resource that indicates an async invocation.- 指定者:
asyncEntryWithType在接口中SphResourceTypeSupport- 参数:
name- the unique name for the protected resourceresourceType- classification of the resource (e.g. Web or RPC)entryType- the traffic type (inbound, outbound or internal). This is used to mark whether it can be blocked when the system is unstable, only inbound traffic could be blocked bySystemRulecount- the amount of calls within the invocation (e.g. batchCount=2 means request for 2 tokens)prioritized- whether the entry is prioritizedargs- args for parameter flow control or customized slots- 返回:
- the
Entryof this invocation (used for mark the invocation complete and get context data) - 抛出:
BlockException- if the block criteria is met
-