public final class FlowRuleUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static Map<String,List<FlowRule>> |
buildFlowRuleMap(List<FlowRule> list)
Build the flow rule map from raw list of flow rules, grouping by resource name.
|
static <K> Map<K,List<FlowRule>> |
buildFlowRuleMap(List<FlowRule> list,
Function<FlowRule,K> groupFunction,
Predicate<FlowRule> filter,
boolean shouldSort)
Build the flow rule map from raw list of flow rules, grouping by provided group function.
|
static Map<String,List<FlowRule>> |
buildFlowRuleMap(List<FlowRule> list,
Predicate<FlowRule> filter)
Build the flow rule map from raw list of flow rules, grouping by resource name.
|
static Map<String,List<FlowRule>> |
buildFlowRuleMap(List<FlowRule> list,
Predicate<FlowRule> filter,
boolean shouldSort)
Build the flow rule map from raw list of flow rules, grouping by resource name.
|
static boolean |
checkClusterConcurrentField(FlowRule rule) |
static boolean |
isValidRule(FlowRule rule)
Check whether provided flow rule is valid.
|
static boolean |
isWindowConfigValid(int sampleCount,
int windowIntervalMs) |
static boolean |
validClusterRuleId(Long id)
Check whether provided ID can be a valid cluster flow ID.
|
public static Map<String,List<FlowRule>> buildFlowRuleMap(List<FlowRule> list)
list - raw list of flow rulespublic static Map<String,List<FlowRule>> buildFlowRuleMap(List<FlowRule> list, Predicate<FlowRule> filter)
list - raw list of flow rulesfilter - rule filterpublic static Map<String,List<FlowRule>> buildFlowRuleMap(List<FlowRule> list, Predicate<FlowRule> filter, boolean shouldSort)
list - raw list of flow rulesfilter - rule filtershouldSort - whether the rules should be sortedpublic static <K> Map<K,List<FlowRule>> buildFlowRuleMap(List<FlowRule> list, Function<FlowRule,K> groupFunction, Predicate<FlowRule> filter, boolean shouldSort)
K - type of keylist - raw list of flow rulesgroupFunction - grouping function of the map (by key)filter - rule filtershouldSort - whether the rules should be sortedpublic static boolean validClusterRuleId(Long id)
id - flow ID to checkpublic static boolean isValidRule(FlowRule rule)
rule - flow rule to checkpublic static boolean checkClusterConcurrentField(FlowRule rule)
public static boolean isWindowConfigValid(int sampleCount,
int windowIntervalMs)
Copyright © 2021 Alibaba Group. All rights reserved.