public class FlowRule extends AbstractRule
Each flow rule is mainly composed of three factors: grade, strategy and controlBehavior.
grade represents the threshold type of flow control (by QPS or thread count).strategy represents the strategy based on invocation relation.controlBehavior represents the QPS shaping behavior (actions on incoming request when QPS
exceeds the threshold).| Modifier and Type | Field and Description |
|---|---|
static String |
LIMIT_APP_DEFAULT |
static String |
LIMIT_APP_OTHER |
| Constructor and Description |
|---|
FlowRule() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
int |
getControlBehavior() |
double |
getCount() |
int |
getGrade() |
int |
getMaxQueueingTimeMs() |
String |
getRefResource() |
int |
getStrategy() |
int |
getWarmUpPeriodSec() |
int |
hashCode() |
boolean |
passCheck(Context context,
DefaultNode node,
int acquireCount,
Object... args)
Check whether current statistical indicators meet this rule, which means not exceeding any threshold.
|
FlowRule |
setControlBehavior(int controlBehavior) |
FlowRule |
setCount(double count) |
FlowRule |
setGrade(int grade) |
FlowRule |
setMaxQueueingTimeMs(int maxQueueingTimeMs) |
FlowRule |
setRater(Controller rater) |
FlowRule |
setRefResource(String refResource) |
FlowRule |
setStrategy(int strategy) |
FlowRule |
setWarmUpPeriodSec(int warmUpPeriodSec) |
String |
toString() |
as, getLimitApp, getResource, setLimitApp, setResourcepublic static final String LIMIT_APP_DEFAULT
public static final String LIMIT_APP_OTHER
public int getControlBehavior()
public FlowRule setControlBehavior(int controlBehavior)
public int getMaxQueueingTimeMs()
public FlowRule setMaxQueueingTimeMs(int maxQueueingTimeMs)
public FlowRule setRater(Controller rater)
public int getWarmUpPeriodSec()
public FlowRule setWarmUpPeriodSec(int warmUpPeriodSec)
public int getGrade()
public FlowRule setGrade(int grade)
public double getCount()
public FlowRule setCount(double count)
public int getStrategy()
public FlowRule setStrategy(int strategy)
public String getRefResource()
public boolean passCheck(Context context, DefaultNode node, int acquireCount, Object... args)
Rulepublic boolean equals(Object o)
equals in class AbstractRulepublic int hashCode()
hashCode in class AbstractRuleCopyright © 2018 Alibaba Group. All rights reserved.