Search in sources :

Example 1 with HintModuloDatabaseShardingAlgorithm

use of io.shardingjdbc.core.integrate.fixture.HintModuloDatabaseShardingAlgorithm in project sharding-jdbc by shardingjdbc.

the class AbstractRoutingDatabaseOnlyWithHintTest method getShardingRule.

@Override
protected ShardingRule getShardingRule(final Map.Entry<DatabaseType, Map<String, DataSource>> dataSourceEntry) {
    ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
    shardingRuleConfig.setDefaultDatabaseShardingStrategyConfig(new HintShardingStrategyConfiguration(new HintModuloDatabaseShardingAlgorithm()));
    return new ShardingRule(shardingRuleConfig, dataSourceEntry.getValue().keySet());
}
Also used : HintModuloDatabaseShardingAlgorithm(io.shardingjdbc.core.integrate.fixture.HintModuloDatabaseShardingAlgorithm) ShardingRuleConfiguration(io.shardingjdbc.core.api.config.ShardingRuleConfiguration) HintShardingStrategyConfiguration(io.shardingjdbc.core.api.config.strategy.HintShardingStrategyConfiguration) ShardingRule(io.shardingjdbc.core.rule.ShardingRule)

Aggregations

ShardingRuleConfiguration (io.shardingjdbc.core.api.config.ShardingRuleConfiguration)1 HintShardingStrategyConfiguration (io.shardingjdbc.core.api.config.strategy.HintShardingStrategyConfiguration)1 HintModuloDatabaseShardingAlgorithm (io.shardingjdbc.core.integrate.fixture.HintModuloDatabaseShardingAlgorithm)1 ShardingRule (io.shardingjdbc.core.rule.ShardingRule)1