public final class DatabaseDiscoveryRule extends Object implements org.apache.shardingsphere.infra.rule.identifier.scope.DatabaseRule, org.apache.shardingsphere.infra.rule.identifier.type.DataSourceContainedRule, org.apache.shardingsphere.infra.rule.identifier.type.DynamicDataSourceContainedRule, org.apache.shardingsphere.infra.rule.identifier.type.exportable.ExportableRule
| 构造器和说明 |
|---|
DatabaseDiscoveryRule(String databaseName,
Map<String,DataSource> dataSourceMap,
AlgorithmProvidedDatabaseDiscoveryRuleConfiguration ruleConfig,
org.apache.shardingsphere.infra.instance.InstanceContext instanceContext) |
DatabaseDiscoveryRule(String databaseName,
Map<String,DataSource> dataSourceMap,
DatabaseDiscoveryRuleConfiguration ruleConfig,
org.apache.shardingsphere.infra.instance.InstanceContext instanceContext) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
closeHeartBeatJob() |
Optional<DatabaseDiscoveryDataSourceRule> |
findDataSourceRule(String dataSourceName)
Find data source rule.
|
Map<String,Collection<String>> |
getDataSourceMapper() |
Map<String,Object> |
getExportData() |
String |
getPrimaryDataSourceName(String dataSourceName) |
Collection<String> |
getReplicaDataSourceNames(String dataSourceName) |
DatabaseDiscoveryDataSourceRule |
getSingleDataSourceRule()
Get single data source rule.
|
String |
getType() |
void |
restartHeartBeatJob(org.apache.shardingsphere.infra.rule.event.DataSourceStatusChangedEvent event) |
void |
updateStatus(org.apache.shardingsphere.infra.rule.event.DataSourceStatusChangedEvent event) |
public DatabaseDiscoveryRule(String databaseName, Map<String,DataSource> dataSourceMap, DatabaseDiscoveryRuleConfiguration ruleConfig, org.apache.shardingsphere.infra.instance.InstanceContext instanceContext)
public DatabaseDiscoveryRule(String databaseName, Map<String,DataSource> dataSourceMap, AlgorithmProvidedDatabaseDiscoveryRuleConfiguration ruleConfig, org.apache.shardingsphere.infra.instance.InstanceContext instanceContext)
public DatabaseDiscoveryDataSourceRule getSingleDataSourceRule()
public Optional<DatabaseDiscoveryDataSourceRule> findDataSourceRule(String dataSourceName)
dataSourceName - data source namepublic Map<String,Collection<String>> getDataSourceMapper()
getDataSourceMapper 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.DataSourceContainedRulepublic void restartHeartBeatJob(org.apache.shardingsphere.infra.rule.event.DataSourceStatusChangedEvent event)
restartHeartBeatJob 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.DynamicDataSourceContainedRulepublic void closeHeartBeatJob()
closeHeartBeatJob 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.DynamicDataSourceContainedRulepublic String getPrimaryDataSourceName(String dataSourceName)
getPrimaryDataSourceName 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.DynamicDataSourceContainedRulepublic Collection<String> getReplicaDataSourceNames(String dataSourceName)
getReplicaDataSourceNames 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.DynamicDataSourceContainedRulepublic void updateStatus(org.apache.shardingsphere.infra.rule.event.DataSourceStatusChangedEvent event)
updateStatus 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.DynamicDataSourceContainedRulepublic Map<String,Object> getExportData()
getExportData 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.exportable.ExportableRulepublic String getType()
getType 在接口中 org.apache.shardingsphere.infra.rule.ShardingSphereRuleCopyright © 2022 The Apache Software Foundation. All rights reserved.