qsLI commented on issue #8174:
URL: https://github.com/apache/shardingsphere/issues/8174#issuecomment-727919667
`Map<String, DataSource> result = new HashMap<>();
result.put("ds0", ds0);
ShardingRuleConfiguration shardingRuleConfig = new
ShardingRuleConfiguration();
shardingRuleConfig.getTableRuleConfigs()
.add(getOrderTableRuleConfiguration());
shardingRuleConfig.getBindingTableGroups()
.add("meb_discount_coupons");
shardingRuleConfig.getBroadcastTables()
.add("meb_discount_type");
shardingRuleConfig.getBroadcastTables()
.add("sys_holiday");
final Properties keyGeneratorProperties = new Properties();
keyGeneratorProperties.put("id.generate.remote", idGenerateRemote);
shardingRuleConfig.setDefaultKeyGeneratorConfig(
new KeyGeneratorConfiguration("ATOUR-FLAKE", "coupon_id",
keyGeneratorProperties));
shardingRuleConfig.setDefaultTableShardingStrategyConfig(new
InlineShardingStrategyConfiguration("meb_id",
"meb_discount_coupons_${meb_id % " + shardingTableNodes + "}"));
Properties properties = new Properties();
/*
* 开启sql日志
*/
properties.setProperty(ShardingPropertiesConstant.SQL_SHOW.getKey(),
String.valueOf(showSql));
properties.setProperty(ShardingPropertiesConstant.MAX_CONNECTIONS_SIZE_PER_QUERY.getKey(),
String.valueOf(4));
return ShardingDataSourceFactory.createDataSource(result,
shardingRuleConfig, properties);`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]