// todo-lhj  make configurable RouteStrategy of
private ClusterConfig buildNormalClusterConfig(DalConnectionStringConfigure configure) {
        ClusterConfigWithNoVersion clusterConfig =
                new ClusterConfigWithNoVersion(configure.getName(), ClusterType.NORMAL, DatabaseCategory.MYSQL);
        DatabaseShardConfigImpl databaseShardConfig = new DatabaseShardConfigImpl(clusterConfig, 0);
        DatabaseConfigImpl databaseConfig = new DatabaseConfigImpl(databaseShardConfig);
        HostAndPort hostAndPort = ConnectionStringParser.parseHostPortFromURL(configure.getConnectionUrl());
        databaseConfig.setIp(hostAndPort.getHost());
        databaseConfig.setPort(hostAndPort.getPort());
        databaseConfig.setDbName(provider.getDbName());
        databaseConfig.setUid(configure.getUserName());
        databaseConfig.setPwd(configure.getPassword());
        databaseShardConfig.addDatabaseConfig(databaseConfig);
        clusterConfig.addDatabaseShardConfig(databaseShardConfig);
        // todo-lhj  make configurable RouteStrategy of
        clusterConfig.setRouteStrategyConfig(new DefaultClusterRouteStrategyConfig(RouteStrategyEnum.READ_MASTER.name()));
        clusterConfig.setCustomizedOption(new DefaultDalConfigCustomizedOption());
        return clusterConfig;
    }
databaseShardConfig.addDatabaseConfig(databaseConfig);
clusterConfig.addDatabaseShardConfig(databaseShardConfig);
// todo-lhj make configurable RouteStrategy of
clusterConfig.setRouteStrategyConfig(new DefaultClusterRouteStrategyConfig(RouteStrategyEnum.READ_MASTER.name()));
clusterConfig.setCustomizedOption(new DefaultDalConfigCustomizedOption());
DatabaseShardConfigImpl databaseShardConfig = new DatabaseShardConfigImpl(clusterConfig, 0);
DatabaseConfigImpl databaseConfig = new DatabaseConfigImpl(databaseShardConfig);
HostAndPort hostAndPort = ConnectionStringParser.parseHostPortFromURL(configure.getConnectionUrl());
databaseConfig.setIp(hostAndPort.getHost());
databaseConfig.setPort(hostAndPort.getPort());
databaseConfig.setDbName(provider.getDbName());
databaseConfig.setUid(configure.getUserName());
databaseConfig.setPwd(configure.getPassword());
databaseShardConfig.addDatabaseConfig(databaseConfig);
clusterConfig.addDatabaseShardConfig(databaseShardConfig);
// todo-lhj make configurable RouteStrategy of
clusterConfig.setRouteStrategyConfig(new DefaultClusterRouteStrategyConfig(RouteStrategyEnum.READ_MASTER.name()));
clusterConfig.setCustomizedOption(new DefaultDalConfigCustomizedOption());
return clusterConfig;
}
private ClusterConfig buildNormalClusterConfig(DalConnectionStringConfigure configure) {
ClusterConfigWithNoVersion clusterConfig =
new ClusterConfigWithNoVersion(configure.getName(), ClusterType.NORMAL, DatabaseCategory.MYSQL);
DatabaseShardConfigImpl databaseShardConfig = new DatabaseShardConfigImpl(clusterConfig, 0);
DatabaseConfigImpl databaseConfig = new DatabaseConfigImpl(databaseShardConfig);
HostAndPort hostAndPort = ConnectionStringParser.parseHostPortFromURL(configure.getConnectionUrl());
databaseConfig.setIp(hostAndPort.getHost());
databaseConfig.setPort(hostAndPort.getPort());
databaseConfig.setDbName(provider.getDbName());
databaseConfig.setUid(configure.getUserName());
databaseConfig.setPwd(configure.getPassword());
databaseShardConfig.addDatabaseConfig(databaseConfig);
clusterConfig.addDatabaseShardConfig(databaseShardConfig);
// todo-lhj make configurable RouteStrategy of
clusterConfig.setRouteStrategyConfig(new DefaultClusterRouteStrategyConfig(RouteStrategyEnum.READ_MASTER.name()));
clusterConfig.setCustomizedOption(new DefaultDalConfigCustomizedOption());
return clusterConfig;
}