Class RouteContext
java.lang.Object
org.apache.shardingsphere.infra.route.context.RouteContext
Route context.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanJudge whether route context contains table sharding or not.findTableMapper(String logicDataSourceName, String actualTableName) Find table mapper.Get actual data source names.getActualTableNameGroups(String actualDataSourceName, Set<String> logicTableNames) Get actual tables groups.getDataSourceLogicTablesMap(Collection<String> actualDataSourceNames) Get map relationship between actual data source and logic tables.booleanJudge is route for single database and table only or not.voidputRouteUnit(RouteMapper dataSourceMapper, Collection<RouteMapper> tableMappers) Put route unit.
-
Constructor Details
-
RouteContext
public RouteContext()
-
-
Method Details
-
isSingleRouting
public boolean isSingleRouting()Judge is route for single database and table only or not.- Returns:
- is route for single database and table only or not
-
getActualDataSourceNames
Get actual data source names.- Returns:
- actual data source names
-
getActualTableNameGroups
public List<Set<String>> getActualTableNameGroups(String actualDataSourceName, Set<String> logicTableNames) Get actual tables groups.Actual tables in same group are belong one logic name.
- Parameters:
actualDataSourceName- actual data source namelogicTableNames- logic table names- Returns:
- actual table groups
-
getDataSourceLogicTablesMap
public Map<String,Set<String>> getDataSourceLogicTablesMap(Collection<String> actualDataSourceNames) Get map relationship between actual data source and logic tables.- Parameters:
actualDataSourceNames- actual data source names- Returns:
- map relationship between data source and logic tables
-
findTableMapper
Find table mapper.- Parameters:
logicDataSourceName- logic data source nameactualTableName- actual table name- Returns:
- table mapper
-
putRouteUnit
Put route unit.- Parameters:
dataSourceMapper- database mappertableMappers- table mapper collection
-
containsTableSharding
public boolean containsTableSharding()Judge whether route context contains table sharding or not.- Returns:
- whether route context contains table sharding or not
-