public final class SingleTableRule extends Object implements org.apache.shardingsphere.infra.rule.identifier.scope.SchemaRule, org.apache.shardingsphere.infra.rule.identifier.type.DataNodeContainedRule, org.apache.shardingsphere.infra.rule.identifier.type.TableContainedRule, org.apache.shardingsphere.infra.rule.identifier.type.MutableDataNodeRule
| 构造器和说明 |
|---|
SingleTableRule(org.apache.shardingsphere.infra.database.type.DatabaseType databaseType,
Map<String,DataSource> dataSourceMap,
Collection<org.apache.shardingsphere.infra.rule.ShardingSphereRule> builtRules,
org.apache.shardingsphere.infra.config.properties.ConfigurationProperties props) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addDataNode(String tableName,
String dataSourceName) |
void |
dropDataNode(String tableName) |
Optional<String> |
findActualTableByCatalog(String catalog,
String logicTable) |
Optional<String> |
findFirstActualTable(String logicTable) |
Optional<String> |
findLogicTableByActualTable(String actualTable) |
Collection<String> |
getAllActualTables() |
Map<String,Collection<org.apache.shardingsphere.infra.datanode.DataNode>> |
getAllDataNodes() |
Collection<String> |
getAllTables() |
Collection<String> |
getSingleTableNames(Collection<String> logicTableNames)
Get sharding logic table names.
|
Collection<String> |
getTables() |
String |
getType() |
boolean |
isAllTablesInSameDataSource(RouteContext routeContext,
Collection<String> singleTableNames)
Judge whether all tables are in same data source or not.
|
boolean |
isNeedAccumulate(Collection<String> tables) |
boolean |
isSingleTablesInSameDataSource(Collection<String> singleTableNames)
Judge whether single tables are in same data source or not.
|
public SingleTableRule(org.apache.shardingsphere.infra.database.type.DatabaseType databaseType,
Map<String,DataSource> dataSourceMap,
Collection<org.apache.shardingsphere.infra.rule.ShardingSphereRule> builtRules,
org.apache.shardingsphere.infra.config.properties.ConfigurationProperties props)
public boolean isSingleTablesInSameDataSource(Collection<String> singleTableNames)
singleTableNames - single table namespublic boolean isAllTablesInSameDataSource(RouteContext routeContext, Collection<String> singleTableNames)
routeContext - route contextsingleTableNames - single table namespublic Collection<String> getSingleTableNames(Collection<String> logicTableNames)
logicTableNames - logic table namespublic void addDataNode(String tableName, String dataSourceName)
addDataNode 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.MutableDataNodeRulepublic void dropDataNode(String tableName)
dropDataNode 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.MutableDataNodeRulepublic Map<String,Collection<org.apache.shardingsphere.infra.datanode.DataNode>> getAllDataNodes()
getAllDataNodes 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.DataNodeContainedRulepublic Collection<String> getAllActualTables()
getAllActualTables 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.DataNodeContainedRulepublic Optional<String> findFirstActualTable(String logicTable)
findFirstActualTable 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.DataNodeContainedRulepublic boolean isNeedAccumulate(Collection<String> tables)
isNeedAccumulate 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.DataNodeContainedRulepublic Optional<String> findLogicTableByActualTable(String actualTable)
findLogicTableByActualTable 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.DataNodeContainedRulepublic Optional<String> findActualTableByCatalog(String catalog, String logicTable)
findActualTableByCatalog 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.DataNodeContainedRulepublic Collection<String> getAllTables()
getAllTables 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.DataNodeContainedRulepublic Collection<String> getTables()
getTables 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.TableContainedRulepublic String getType()
getType 在接口中 org.apache.shardingsphere.infra.rule.ShardingSphereRuleCopyright © 2021 The Apache Software Foundation. All rights reserved.