public final class DataSourceRegistryService extends Object implements SchemaBasedRegistryService<Map<String,org.apache.shardingsphere.infra.config.datasource.DataSourceConfiguration>>
| Constructor and Description |
|---|
DataSourceRegistryService(RegistryCenterRepository repository) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isExisted(String schemaName)
Judge whether schema configuration existed.
|
Map<String,org.apache.shardingsphere.infra.config.datasource.DataSourceConfiguration> |
load(String schemaName)
Load configurations.
|
void |
persist(String schemaName,
Map<String,org.apache.shardingsphere.infra.config.datasource.DataSourceConfiguration> dataSourceConfigs)
Persist configurations.
|
void |
persist(String schemaName,
Map<String,org.apache.shardingsphere.infra.config.datasource.DataSourceConfiguration> dataSourceConfigs,
boolean isOverwrite)
Persist configurations.
|
void |
update(DataSourceAddedSQLNotificationEvent event)
Update data source configurations for add.
|
void |
update(DataSourceDroppedSQLNotificationEvent event)
Update data source configurations for drop.
|
public DataSourceRegistryService(RegistryCenterRepository repository)
public void persist(String schemaName, Map<String,org.apache.shardingsphere.infra.config.datasource.DataSourceConfiguration> dataSourceConfigs, boolean isOverwrite)
SchemaBasedRegistryServicepersist in interface SchemaBasedRegistryService<Map<String,org.apache.shardingsphere.infra.config.datasource.DataSourceConfiguration>>schemaName - schema namedataSourceConfigs - configurationsisOverwrite - is overwritepublic void persist(String schemaName, Map<String,org.apache.shardingsphere.infra.config.datasource.DataSourceConfiguration> dataSourceConfigs)
SchemaBasedRegistryServicepersist in interface SchemaBasedRegistryService<Map<String,org.apache.shardingsphere.infra.config.datasource.DataSourceConfiguration>>schemaName - schema namedataSourceConfigs - configurationspublic Map<String,org.apache.shardingsphere.infra.config.datasource.DataSourceConfiguration> load(String schemaName)
SchemaBasedRegistryServiceload in interface SchemaBasedRegistryService<Map<String,org.apache.shardingsphere.infra.config.datasource.DataSourceConfiguration>>schemaName - schema namepublic boolean isExisted(String schemaName)
SchemaBasedRegistryServiceisExisted in interface SchemaBasedRegistryService<Map<String,org.apache.shardingsphere.infra.config.datasource.DataSourceConfiguration>>schemaName - schema namepublic void update(DataSourceAddedSQLNotificationEvent event)
event - data source added eventpublic void update(DataSourceDroppedSQLNotificationEvent event)
event - data source dropped eventCopyright © 2021 The Apache Software Foundation. All rights reserved.