Java Code Examples for com.alibaba.csp.sentinel.slots.clusterbuilder.ClusterBuilderSlot#resetClusterNodes()

The following examples show how to use com.alibaba.csp.sentinel.slots.clusterbuilder.ClusterBuilderSlot#resetClusterNodes() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SampleCountProperty.java    From Sentinel with Apache License 2.0 5 votes vote down vote up
/**
 * Update the {@link #SAMPLE_COUNT}. All {@link ClusterNode}s will be reset if newSampleCount
 * is different from {@link #SAMPLE_COUNT}.
 *
 * @param newSampleCount New sample count to set. This value must be divisor of 1000.
 */
public static void updateSampleCount(int newSampleCount) {
    if (newSampleCount != SAMPLE_COUNT) {
        SAMPLE_COUNT = newSampleCount;
        ClusterBuilderSlot.resetClusterNodes();
    }
    RecordLog.info("SAMPLE_COUNT updated to: " + SAMPLE_COUNT);
}
 
Example 2
Source File: IntervalProperty.java    From Sentinel-Dashboard-Nacos with Apache License 2.0 5 votes vote down vote up
/**
 * Update the {@link #INTERVAL}, All {@link ClusterNode}s will be reset if newInterval is
 * different from {@link #INTERVAL}
 *
 * @param newInterval New interval to set.
 */
public static void updateInterval(int newInterval) {
    if (newInterval != INTERVAL) {
        INTERVAL = newInterval;
        ClusterBuilderSlot.resetClusterNodes();
    }
    RecordLog.info("[IntervalProperty] INTERVAL updated to: " + INTERVAL);
}
 
Example 3
Source File: IntervalProperty.java    From Sentinel with Apache License 2.0 5 votes vote down vote up
/**
 * Update the {@link #INTERVAL}, All {@link ClusterNode}s will be reset if newInterval is
 * different from {@link #INTERVAL}
 *
 * @param newInterval New interval to set.
 */
public static void updateInterval(int newInterval) {
    if (newInterval != INTERVAL) {
        INTERVAL = newInterval;
        ClusterBuilderSlot.resetClusterNodes();
    }
    RecordLog.info("[IntervalProperty] INTERVAL updated to: " + INTERVAL);
}
 
Example 4
Source File: SentinelAnnotationQuarkusAdapterTest.java    From Sentinel with Apache License 2.0 4 votes vote down vote up
@BeforeEach
public void setUp() throws Exception {
    FlowRuleManager.loadRules(new ArrayList<FlowRule>());
    ClusterBuilderSlot.resetClusterNodes();
}
 
Example 5
Source File: SentinelWebFluxIntegrationTest.java    From Sentinel with Apache License 2.0 4 votes vote down vote up
@After
public void cleanUp() {
    FlowRuleManager.loadRules(new ArrayList<>());
    ClusterBuilderSlot.resetClusterNodes();
}
 
Example 6
Source File: SentinelWebFluxIntegrationTest.java    From Sentinel with Apache License 2.0 4 votes vote down vote up
@Before
public void setUp() {
    FlowRuleManager.loadRules(new ArrayList<>());
    ClusterBuilderSlot.resetClusterNodes();
}
 
Example 7
Source File: SentinelSpringMvcIntegrationTest.java    From Sentinel with Apache License 2.0 4 votes vote down vote up
@After
public void cleanUp() {
    FlowRuleManager.loadRules(null);
    ClusterBuilderSlot.resetClusterNodes();
}
 
Example 8
Source File: ClientFilterTest.java    From Sentinel with Apache License 2.0 4 votes vote down vote up
@After
public void cleanUp() {
    FlowRuleManager.loadRules(null);
    ClusterBuilderSlot.resetClusterNodes();
}
 
Example 9
Source File: ProviderFilterTest.java    From Sentinel with Apache License 2.0 4 votes vote down vote up
@After
public void cleanUp() {
    FlowRuleManager.loadRules(null);
    ClusterBuilderSlot.resetClusterNodes();
}
 
Example 10
Source File: CommonFilterMethodTest.java    From Sentinel with Apache License 2.0 4 votes vote down vote up
@After
public void cleanUp() {
    FlowRuleManager.loadRules(null);
    ClusterBuilderSlot.resetClusterNodes();
}
 
Example 11
Source File: CommonFilterTest.java    From Sentinel with Apache License 2.0 4 votes vote down vote up
@After
public void cleanUp() {
    FlowRuleManager.loadRules(null);
    ClusterBuilderSlot.resetClusterNodes();
}
 
Example 12
Source File: SentinelAnnotationIntegrationTest.java    From Sentinel with Apache License 2.0 4 votes vote down vote up
@Before
public void setUp() throws Exception {
    FlowRuleManager.loadRules(new ArrayList<FlowRule>());
    ClusterBuilderSlot.resetClusterNodes();
}
 
Example 13
Source File: SentinelAnnotationQuarkusAdapterTest.java    From Sentinel with Apache License 2.0 4 votes vote down vote up
@AfterEach
public void tearDown() throws Exception {
    FlowRuleManager.loadRules(new ArrayList<FlowRule>());
    ClusterBuilderSlot.resetClusterNodes();
}
 
Example 14
Source File: SentinelAnnotationInterceptorIntegrationTest.java    From Sentinel with Apache License 2.0 4 votes vote down vote up
@Before
public void setUp() throws Exception {
    FlowRuleManager.loadRules(new ArrayList<FlowRule>());
    ClusterBuilderSlot.resetClusterNodes();
    fooService = container.select(FooService.class).get();
}
 
Example 15
Source File: GreetingResourceTest.java    From Sentinel with Apache License 2.0 4 votes vote down vote up
@AfterEach
public void cleanUp() {
    ClusterBuilderSlot.resetClusterNodes();
}
 
Example 16
Source File: SentinelAnnotationIntegrationTest.java    From Sentinel with Apache License 2.0 4 votes vote down vote up
@After
public void tearDown() throws Exception {
    FlowRuleManager.loadRules(new ArrayList<FlowRule>());
    ClusterBuilderSlot.resetClusterNodes();
}
 
Example 17
Source File: SentinelAnnotationIntegrationTest.java    From Sentinel-Dashboard-Nacos with Apache License 2.0 4 votes vote down vote up
@After
public void tearDown() throws Exception {
    FlowRuleManager.loadRules(new ArrayList<FlowRule>());
    ClusterBuilderSlot.resetClusterNodes();
}
 
Example 18
Source File: SentinelWebFluxIntegrationTest.java    From Sentinel-Dashboard-Nacos with Apache License 2.0 4 votes vote down vote up
@After
public void cleanUp() {
    FlowRuleManager.loadRules(new ArrayList<>());
    ClusterBuilderSlot.resetClusterNodes();
}
 
Example 19
Source File: SentinelWebFluxIntegrationTest.java    From Sentinel-Dashboard-Nacos with Apache License 2.0 4 votes vote down vote up
@Before
public void setUp() {
    FlowRuleManager.loadRules(new ArrayList<>());
    ClusterBuilderSlot.resetClusterNodes();
}
 
Example 20
Source File: CommonFilterMethodTest.java    From Sentinel-Dashboard-Nacos with Apache License 2.0 4 votes vote down vote up
@After
public void cleanUp() {
    FlowRuleManager.loadRules(null);
    ClusterBuilderSlot.resetClusterNodes();
}