use of io.mycat.route.function.ReloadFunction in project Mycat_plus by coderczp.
the class RuleDataPathChildrenCacheListener method reloadRuleData.
private void reloadRuleData(String name) {
String tableName = name.substring(name.lastIndexOf("_") + 1, name.indexOf("."));
String ruleName = name.substring(0, name.indexOf("."));
Map<String, SchemaConfig> schemaConfigMap = MycatServer.getInstance().getConfig().getSchemas();
for (SchemaConfig schemaConfig : schemaConfigMap.values()) {
TableConfig tableConfig = schemaConfig.getTables().get(tableName.toUpperCase());
if (tableConfig == null)
continue;
RuleConfig rule = tableConfig.getRule();
AbstractPartitionAlgorithm function = rule.getRuleAlgorithm();
if (function instanceof ReloadFunction) {
((ReloadFunction) function).reload();
}
}
}
use of io.mycat.route.function.ReloadFunction in project Mycat-Server by MyCATApache.
the class RuleDataPathChildrenCacheListener method reloadRuleData.
private void reloadRuleData(String name) {
String tableName = name.substring(name.lastIndexOf("_") + 1, name.indexOf("."));
String ruleName = name.substring(0, name.indexOf("."));
Map<String, SchemaConfig> schemaConfigMap = MycatServer.getInstance().getConfig().getSchemas();
for (SchemaConfig schemaConfig : schemaConfigMap.values()) {
TableConfig tableConfig = schemaConfig.getTables().get(tableName.toUpperCase());
if (tableConfig == null)
continue;
RuleConfig rule = tableConfig.getRule();
AbstractPartitionAlgorithm function = rule.getRuleAlgorithm();
if (function instanceof ReloadFunction) {
((ReloadFunction) function).reload();
}
}
}
Aggregations