Search in sources :

Example 6 with ParamFlowClusterConfig

use of com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowClusterConfig in project spring-boot-student by wyh-spring-ecosystem-student.

the class InMemParamFlowRuleStore method preProcess.

@Override
protected ParamFlowRuleEntity preProcess(ParamFlowRuleEntity entity) {
    if (entity != null && entity.isClusterMode()) {
        ParamFlowClusterConfig config = entity.getClusterConfig();
        if (config == null) {
            config = new ParamFlowClusterConfig();
        }
        // Set cluster rule id.
        config.setFlowId(entity.getId());
    }
    return entity;
}
Also used : ParamFlowClusterConfig(com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowClusterConfig)

Example 7 with ParamFlowClusterConfig

use of com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowClusterConfig in project XHuiCloud by sindaZeng.

the class InMemParamFlowRuleStore method preProcess.

@Override
protected ParamFlowRuleEntity preProcess(ParamFlowRuleEntity entity) {
    if (entity != null && entity.isClusterMode()) {
        ParamFlowClusterConfig config = entity.getClusterConfig();
        if (config == null) {
            config = new ParamFlowClusterConfig();
        }
        // Set cluster rule id.
        config.setFlowId(entity.getId());
    }
    return entity;
}
Also used : ParamFlowClusterConfig(com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowClusterConfig)

Example 8 with ParamFlowClusterConfig

use of com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowClusterConfig in project RuoYi-Cloud-Plus by JavaLionLi.

the class InMemParamFlowRuleStore method preProcess.

@Override
protected ParamFlowRuleEntity preProcess(ParamFlowRuleEntity entity) {
    if (entity != null && entity.isClusterMode()) {
        ParamFlowClusterConfig config = entity.getClusterConfig();
        if (config == null) {
            config = new ParamFlowClusterConfig();
        }
        // Set cluster rule id.
        config.setFlowId(entity.getId());
    }
    return entity;
}
Also used : ParamFlowClusterConfig(com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowClusterConfig)

Aggregations

ParamFlowClusterConfig (com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowClusterConfig)8 ParamFlowRule (com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule)3 ParamFlowRuleEntity (com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.ParamFlowRuleEntity)2 Test (org.junit.Test)2 ClusterParamMetric (com.alibaba.csp.sentinel.cluster.flow.statistic.metric.ClusterParamMetric)1 HashSet (java.util.HashSet)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1