提交 9a8008b3 编写于 作者: H haocao

Refactor orchestration yaml configuration.

上级 9523bc7d
......@@ -18,7 +18,8 @@
package io.shardingjdbc.orchestration.yaml;
import io.shardingjdbc.orchestration.api.config.OrchestrationConfiguration;
import io.shardingjdbc.orchestration.reg.api.RegistryCenterConfiguration;
import io.shardingjdbc.orchestration.reg.etcd.EtcdConfiguration;
import io.shardingjdbc.orchestration.reg.zookeeper.ZookeeperConfiguration;
import lombok.Getter;
import lombok.Setter;
......@@ -33,7 +34,9 @@ public class YamlOrchestrationConfiguration {
private String name;
private RegistryCenterConfiguration registryCenter;
private EtcdConfiguration etcd;
private ZookeeperConfiguration zookeeper;
private boolean overwrite;
......@@ -43,6 +46,6 @@ public class YamlOrchestrationConfiguration {
* @return orchestration master-slave rule configuration from yaml
*/
public OrchestrationConfiguration getOrchestrationConfiguration() {
return new OrchestrationConfiguration(getName(), registryCenter, overwrite);
return new OrchestrationConfiguration(getName(), null != etcd ? etcd : zookeeper, overwrite);
}
}
......@@ -28,6 +28,6 @@ masterSlaveRule:
orchestration:
name: demo_ds_ms
overwrite: true
registryCenter: !!io.shardingjdbc.orchestration.reg.zookeeper.ZookeeperConfiguration
zookeeper:
namespace: orchestration-yaml-test
serverLists: localhost:3181
......@@ -58,6 +58,6 @@ shardingRule:
orchestration:
name: demo_ds_ms
overwrite: true
registryCenter: !!io.shardingjdbc.orchestration.reg.zookeeper.ZookeeperConfiguration
zookeeper:
namespace: orchestration-yaml-test
serverLists: localhost:3181
......@@ -55,6 +55,6 @@ shardingRule:
orchestration:
name: demo_ds_ms
overwrite: true
registryCenter: !!io.shardingjdbc.orchestration.reg.zookeeper.ZookeeperConfiguration
zookeeper:
namespace: orchestration-yaml-test
serverLists: localhost:3181
......@@ -44,6 +44,6 @@ shardingRule:
orchestration:
name: demo_ds_ms
overwrite: true
registryCenter: !!io.shardingjdbc.orchestration.reg.zookeeper.ZookeeperConfiguration
zookeeper:
namespace: orchestration-yaml-test
serverLists: localhost:3181
......@@ -39,6 +39,6 @@ shardingRule:
orchestration:
name: demo_ds_ms
overwrite: true
registryCenter: !!io.shardingjdbc.orchestration.reg.zookeeper.ZookeeperConfiguration
zookeeper:
namespace: orchestration-yaml-test
serverLists: localhost:3181
......@@ -83,6 +83,6 @@ shardingRule:
orchestration:
name: demo_ds_ms
overwrite: true
registryCenter: !!io.shardingjdbc.orchestration.reg.zookeeper.ZookeeperConfiguration
zookeeper:
namespace: orchestration-yaml-test
serverLists: localhost:3181
......@@ -81,6 +81,6 @@ shardingRule:
orchestration:
name: demo_ds_ms
overwrite: true
registryCenter: !!io.shardingjdbc.orchestration.reg.zookeeper.ZookeeperConfiguration
zookeeper:
namespace: orchestration-yaml-test
serverLists: localhost:3181
......@@ -54,6 +54,6 @@ shardingRule:
orchestration:
name: demo_ds_ms
overwrite: true
registryCenter: !!io.shardingjdbc.orchestration.reg.zookeeper.ZookeeperConfiguration
zookeeper:
namespace: orchestration-yaml-test
serverLists: localhost:3181
......@@ -54,6 +54,6 @@ shardingRule:
orchestration:
name: demo_ds_ms
overwrite: true
registryCenter: !!io.shardingjdbc.orchestration.reg.zookeeper.ZookeeperConfiguration
zookeeper:
namespace: orchestration-yaml-test
serverLists: localhost:3181
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册