- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中io.shardingsphere.core.yaml.sharding.YamlShardingRuleConfiguration
类的一些代码示例,展示了YamlShardingRuleConfiguration
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlShardingRuleConfiguration
类的具体详情如下:
包路径:io.shardingsphere.core.yaml.sharding.YamlShardingRuleConfiguration
类名称:YamlShardingRuleConfiguration
暂无
代码示例来源:origin: io.shardingsphere/sharding-orchestration-core
/**
* Load sharding rule configuration.
*
* @param data data
* @return sharding rule configuration
*/
public static ShardingRuleConfiguration loadShardingRuleConfiguration(final String data) {
return new Yaml().loadAs(data, YamlShardingRuleConfiguration.class).getShardingRuleConfiguration();
}
代码示例来源:origin: io.shardingsphere/sharding-orchestration-core
/**
* Dump sharding rule configuration.
*
* @param shardingRuleConfig sharding rule configuration
* @return YAML string
*/
public static String dumpShardingRuleConfiguration(final ShardingRuleConfiguration shardingRuleConfig) {
return new Yaml(new DefaultYamlRepresenter()).dumpAsMap(new YamlShardingRuleConfiguration(shardingRuleConfig));
}
代码示例来源:origin: io.shardingsphere/sharding-jdbc-orchestration
private static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final YamlShardingRuleConfiguration yamlConfig,
final Map<String, Object> configMap, final Properties props, final OrchestrationConfiguration orchestrationConfig) throws SQLException {
if (null == yamlConfig) {
return new OrchestrationShardingDataSource(orchestrationConfig);
} else {
ShardingDataSource shardingDataSource = new ShardingDataSource(
dataSourceMap, new ShardingRule(yamlConfig.getShardingRuleConfiguration(), dataSourceMap.keySet()), configMap, props);
return new OrchestrationShardingDataSource(shardingDataSource, orchestrationConfig);
}
}
代码示例来源:origin: io.shardingsphere/sharding-jdbc-core
/**
* Create sharding data source.
*
* @param dataSourceMap data source map
* @param yamlFile yaml file for rule configuration of databases and tables sharding without data sources
* @return sharding data source
* @throws SQLException SQL exception
* @throws IOException IO exception
*/
public static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final File yamlFile) throws SQLException, IOException {
YamlShardingConfiguration config = YamlShardingConfiguration.unmarshal(yamlFile);
return ShardingDataSourceFactory.createDataSource(
dataSourceMap, config.getShardingRule().getShardingRuleConfiguration(), config.getConfigMap(), config.getProps());
}
代码示例来源:origin: io.shardingsphere/sharding-jdbc-core
/**
* Create sharding data source.
*
* @param dataSourceMap data source map
* @param yamlBytes yaml bytes for rule configuration of databases and tables sharding without data sources
* @return sharding data source
* @throws SQLException SQL exception
* @throws IOException IO exception
*/
public static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final byte[] yamlBytes) throws SQLException, IOException {
YamlShardingConfiguration config = YamlShardingConfiguration.unmarshal(yamlBytes);
return ShardingDataSourceFactory.createDataSource(
dataSourceMap, config.getShardingRule().getShardingRuleConfiguration(), config.getConfigMap(), config.getProps());
}
}
代码示例来源:origin: io.shardingsphere/sharding-jdbc-core
/**
* Create sharding data source.
*
* @param yamlFile yaml file for rule configuration of databases and tables sharding with data sources
* @return sharding data source
* @throws SQLException SQL exception
* @throws IOException IO exception
*/
public static DataSource createDataSource(final File yamlFile) throws SQLException, IOException {
YamlShardingConfiguration config = YamlShardingConfiguration.unmarshal(yamlFile);
return ShardingDataSourceFactory.createDataSource(
config.getDataSources(), config.getShardingRule().getShardingRuleConfiguration(), config.getConfigMap(), config.getProps());
}
代码示例来源:origin: io.shardingsphere/sharding-jdbc-core
/**
* Create sharding data source.
*
* @param yamlBytes yaml bytes for rule configuration of databases and tables sharding with data sources
* @return sharding data source
* @throws SQLException SQL exception
* @throws IOException IO exception
*/
public static DataSource createDataSource(final byte[] yamlBytes) throws SQLException, IOException {
YamlShardingConfiguration config = YamlShardingConfiguration.unmarshal(yamlBytes);
return ShardingDataSourceFactory.createDataSource(
config.getDataSources(), config.getShardingRule().getShardingRuleConfiguration(), config.getConfigMap(), config.getProps());
}
目录 集成sharding jdbc 1. 引入依赖 2. 配置分表规则 问题 集成多数据源
Apache ShardingSphere 是一个开源的分布式数据库,它还有一个用户和开发人员需要的生态系统,为之提供了定制和云原生的体验。 Apache ShardingSphere
谈到分库分表中间件时,我们自然而然的会想到 ShardingSphere-JDBC 。 这篇文章,我们聊聊 ShardingSphere-JDBC 相关知识点,并实战演示一番。
本文整理了Java中io.shardingsphere.core.yaml.sharding.YamlShardingRuleConfiguration类的一些代码示例,展示了YamlSharding
本文整理了Java中org.apache.shardingsphere.core.yaml.YamlAuthentication类的一些代码示例,展示了YamlAuthentication类的具体用法
本文整理了Java中org.apache.shardingsphere.core.yaml.sharding.YamlShardingRuleConfiguration类的一些代码示例,展示了Yaml
本文整理了Java中org.apache.shardingsphere.core.yaml.masterslave.YamlMasterSlaveRuleConfiguration类的一些代码示例,展
本文整理了Java中org.apache.shardingsphere.orchestration.yaml.config.YamlOrchestrationConfiguration类的一些代码示例
本文整理了Java中org.apache.shardingsphere.core.yaml.sharding.YamlKeyGeneratorConfiguration类的一些代码示例,展示了Yaml
本文整理了Java中io.shardingsphere.core.yaml.masterslave.YamlMasterSlaveRuleConfiguration.getMasterSlaveRul
本文整理了Java中io.shardingsphere.core.yaml.sharding.YamlShardingRuleConfiguration.getShardingRuleConfigur
本文整理了Java中org.apache.shardingsphere.core.yaml.YamlAuthentication.getUsername()方法的一些代码示例,展示了YamlAuthe
本文整理了Java中org.apache.shardingsphere.core.yaml.YamlAuthentication.getPassword()方法的一些代码示例,展示了YamlAuthe
本文整理了Java中org.apache.shardingsphere.core.yaml.sharding.YamlShardingRuleConfiguration.getShardingRule
本文整理了Java中org.apache.shardingsphere.core.yaml.masterslave.YamlMasterSlaveRuleConfiguration.getMaster
本文整理了Java中org.apache.shardingsphere.orchestration.yaml.config.YamlOrchestrationConfiguration.getOrch
我是一名优秀的程序员,十分优秀!