Interface DatabaseDiscoveryProviderAlgorithm
- All Superinterfaces:
ShardingSphereAlgorithm,org.apache.shardingsphere.infra.util.spi.lifecycle.SPIPostProcessor,org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI
Database discovery provider algorithm.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcheckEnvironment(String databaseName, Collection<DataSource> dataSources) Check environment.booleanisPrimaryInstance(DataSource dataSource) Judge whether database instance is primary.loadReplicaStatus(DataSource replicaDataSource) Load replica data source status.Methods inherited from interface org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithm
getPropsMethods inherited from interface org.apache.shardingsphere.infra.util.spi.lifecycle.SPIPostProcessor
initMethods inherited from interface org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI
getType, getTypeAliases
-
Method Details
-
checkEnvironment
Check environment.- Parameters:
databaseName- database namedataSources- data sources
-
isPrimaryInstance
Judge whether database instance is primary.- Parameters:
dataSource- data source to be judged- Returns:
- is primary database instance or not
- Throws:
SQLException- SQL exception
-
loadReplicaStatus
Load replica data source status.- Parameters:
replicaDataSource- to be loaded replica data source- Returns:
- replica data source status
- Throws:
SQLException- SQL exception
-