/** * Load provided server global statistic (flow) configuration to property in memory. * * @param config valid cluster server flow configuration for global */ public static void loadGlobalFlowConfig(ServerFlowConfig config) { globalFlowProperty.updateValue(config); }
/** * Apply new {@link ClusterClientConfig}, while the former config will be replaced. * * @param config new config to apply */ public static void applyNewConfig(ClusterClientConfig config) { clientConfigProperty.updateValue(config); }
/** * Load {@link FlowRule}s, former rules will be replaced. * * @param rules new rules to load. */ public static void loadRules(List<FlowRule> rules) { currentProperty.updateValue(rules); }
/** * Load provided server transport configuration to property in memory. * * @param config valid cluster server transport configuration */ public static void loadGlobalTransportConfig(ServerTransportConfig config) { transportConfigProperty.updateValue(config); }
/** * Load {@link SystemRule}s, former rules will be replaced. * * @param rules new rules to load. */ public static void loadRules(List<SystemRule> rules) { currentProperty.updateValue(rules); }
/** * Apply given state to cluster mode. * * @param state valid state to apply */ public static void applyState(Integer state) { stateProperty.updateValue(state); }
/** * Load the authority rules to memory. * * @param rules list of authority rules */ public static void loadRules(List<AuthorityRule> rules) { currentProperty.updateValue(rules); }
/** * Load provided server namespace set to property in memory. * * @param namespaceSet valid namespace set */ public static void loadServerNamespaceSet(Set<String> namespaceSet) { namespaceSetProperty.updateValue(namespaceSet); }
/** * Load parameter flow rules. Former rules will be replaced. * * @param rules new rules to load. */ public static void loadRules(List<ParamFlowRule> rules) { try { currentProperty.updateValue(rules); } catch (Throwable e) { RecordLog.info("[ParamFlowRuleManager] Failed to load rules", e); } }
/** * Load server flow config for a specific namespace. * * @param namespace a valid namespace * @param config valid flow config for the namespace */ public static void loadFlowConfig(String namespace, ServerFlowConfig config) { AssertUtil.notEmpty(namespace, "namespace cannot be empty"); // TODO: Support namespace-scope server flow config. globalFlowProperty.updateValue(config); }
/** * Load {@link DegradeRule}s, former rules will be replaced. * * @param rules new rules to load. */ public static void loadRules(List<DegradeRule> rules) { try { currentProperty.updateValue(rules); } catch (Throwable e) { RecordLog.info(e.getMessage(), e); } }
/** * Load parameter flow rules for a specific namespace. The former rules of the namespace will be replaced. * * @param namespace a valid namespace * @param rules rule list */ public static void loadRules(String namespace, List<ParamFlowRule> rules) { AssertUtil.notEmpty(namespace, "namespace cannot be empty"); NamespaceFlowProperty<ParamFlowRule> property = PROPERTY_MAP.get(namespace); if (property != null) { property.getProperty().updateValue(rules); } }
/** * Load flow rules for a specific namespace. The former rules of the namespace will be replaced. * * @param namespace a valid namespace * @param rules rule list */ public static void loadRules(String namespace, List<FlowRule> rules) { AssertUtil.notEmpty(namespace, "namespace cannot be empty"); NamespaceFlowProperty<FlowRule> property = PROPERTY_MAP.get(namespace); if (property != null) { property.getProperty().updateValue(rules); } }
@Override public void receiveConfigInfo(final String configInfo) { RecordLog.info(String.format("[NacosDataSource] New property value received for (properties: %s) (dataId: %s, groupId: %s): %s", properties, dataId, groupId, configInfo)); T newValue = NacosDataSource.this.parser.convert(configInfo); // Update the new value to the property. getProperty().updateValue(newValue); } };
private void firstLoad() { try { T newValue = loadConfig(); getProperty().updateValue(newValue); } catch (Throwable e) { RecordLog.info("loadConfig exception", e); } }
private void loadAndUpdateRules() { try { T newValue = loadConfig(); if (newValue == null) { RecordLog.warn("[ApolloDataSource] WARN: rule config is null, you may have to check your data source"); } getProperty().updateValue(newValue); } catch (Throwable ex) { RecordLog.warn("[ApolloDataSource] Error when loading rule config", ex); } }
private void loadInitialConfig() { try { T newValue = loadConfig(); if (newValue == null) { RecordLog.warn("[ZookeeperDataSource] WARN: initial config is null, you may have to check your data source"); } getProperty().updateValue(newValue); } catch (Exception ex) { RecordLog.warn("[ZookeeperDataSource] Error when loading initial config", ex); } }
private void loadInitialConfig() { try { T newValue = loadConfig(); if (newValue == null) { RecordLog.warn("[RedisDataSource] WARN: initial config is null, you may have to check your data source"); } getProperty().updateValue(newValue); } catch (Exception ex) { RecordLog.warn("[RedisDataSource] Error when loading initial config", ex); } }
private void loadInitialConfig() { try { T newValue = loadConfig(); if (newValue == null) { RecordLog.warn("[NacosDataSource] WARN: initial config is null, you may have to check your data source"); } getProperty().updateValue(newValue); } catch (Exception ex) { RecordLog.warn("[NacosDataSource] Error when loading initial config", ex); } }
@Override public void run() { try { if (!isModified()) { return; } T newValue = loadConfig(); getProperty().updateValue(newValue); } catch (Throwable e) { RecordLog.info("loadConfig exception", e); } } }, recommendRefreshMs, recommendRefreshMs, TimeUnit.MILLISECONDS);