public final class SingleTableRule extends Object implements org.apache.shardingsphere.infra.rule.identifier.scope.DatabaseRule, org.apache.shardingsphere.infra.rule.identifier.type.DataNodeContainedRule, org.apache.shardingsphere.infra.rule.identifier.type.TableContainedRule, org.apache.shardingsphere.infra.rule.identifier.type.MutableDataNodeRule, org.apache.shardingsphere.infra.rule.identifier.type.exportable.ExportableRule
| 构造器和说明 |
|---|
SingleTableRule(SingleTableRuleConfiguration ruleConfig,
String databaseName,
Map<String,DataSource> dataSourceMap,
Collection<org.apache.shardingsphere.infra.rule.ShardingSphereRule> builtRules) |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
assignNewDataSourceName()
Assign new data source name.
|
Optional<String> |
findActualTableByCatalog(String catalog,
String logicTable) |
Optional<String> |
findFirstActualTable(String logicTable) |
Optional<String> |
findLogicTableByActualTable(String actualTable) |
Optional<org.apache.shardingsphere.infra.datanode.DataNode> |
findSingleTableDataNode(String schemaName,
String tableName) |
Map<String,Collection<org.apache.shardingsphere.infra.datanode.DataNode>> |
getAllDataNodes() |
Collection<String> |
getAllTables() |
Collection<org.apache.shardingsphere.infra.datanode.DataNode> |
getDataNodesByTableName(String tableName) |
Map<String,Object> |
getExportData() |
Collection<org.apache.shardingsphere.infra.metadata.database.schema.QualifiedTable> |
getSingleTableNames(Collection<org.apache.shardingsphere.infra.metadata.database.schema.QualifiedTable> qualifiedTables)
Get single table names.
|
Collection<String> |
getTables() |
String |
getType() |
boolean |
isAllTablesInSameDataSource(RouteContext routeContext,
Collection<org.apache.shardingsphere.infra.metadata.database.schema.QualifiedTable> singleTableNames)
Judge whether all tables are in same data source or not.
|
boolean |
isNeedAccumulate(Collection<String> tables) |
boolean |
isSingleTablesInSameDataSource(Collection<org.apache.shardingsphere.infra.metadata.database.schema.QualifiedTable> singleTableNames)
Judge whether single tables are in same data source or not.
|
void |
put(String dataSourceName,
String schemaName,
String tableName) |
org.apache.shardingsphere.infra.rule.ShardingSphereRule |
reloadRule(org.apache.shardingsphere.infra.config.rule.RuleConfiguration config,
String databaseName,
Map<String,DataSource> dataSourceMap,
Collection<org.apache.shardingsphere.infra.rule.ShardingSphereRule> builtRules) |
void |
remove(Collection<String> schemaNames,
String tableName) |
void |
remove(String schemaName,
String tableName) |
public SingleTableRule(SingleTableRuleConfiguration ruleConfig, String databaseName, Map<String,DataSource> dataSourceMap, Collection<org.apache.shardingsphere.infra.rule.ShardingSphereRule> builtRules)
public String assignNewDataSourceName()
public boolean isSingleTablesInSameDataSource(Collection<org.apache.shardingsphere.infra.metadata.database.schema.QualifiedTable> singleTableNames)
singleTableNames - single table namespublic boolean isAllTablesInSameDataSource(RouteContext routeContext, Collection<org.apache.shardingsphere.infra.metadata.database.schema.QualifiedTable> singleTableNames)
routeContext - route contextsingleTableNames - single table namespublic Collection<org.apache.shardingsphere.infra.metadata.database.schema.QualifiedTable> getSingleTableNames(Collection<org.apache.shardingsphere.infra.metadata.database.schema.QualifiedTable> qualifiedTables)
qualifiedTables - qualified tablespublic void put(String dataSourceName, String schemaName, String tableName)
put 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.MutableDataNodeRulepublic void remove(String schemaName, String tableName)
remove 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.MutableDataNodeRulepublic void remove(Collection<String> schemaNames, String tableName)
remove 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.MutableDataNodeRulepublic Optional<org.apache.shardingsphere.infra.datanode.DataNode> findSingleTableDataNode(String schemaName, String tableName)
findSingleTableDataNode 在接口中 org.apache.shardingsphere.infra.rule.identifier.type.MutableDataNodeRulepublic org.apache.shardingsphere.infra.rule.ShardingSphereRule reloadRule(org.apache.shardingsphere.infra.config.rule.RuleConfiguration config,
String databaseName,
Map<String,DataSource> dataSourceMap,
Collection<org.apache.shardingsphere.infra.rule.ShardingSphereRule> builtRules)
reloadRule 在接口中 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<org.apache.shardingsphere.infra.datanode.DataNode> getDataNodesByTableName(String tableName)
getDataNodesByTableName 在接口中 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 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.