test_class.declarator: routeService = new RouteService()
test_class.modifier: private
test_class.original_string: private RouteService routeService = new RouteService();
test_class.type: RouteService
test_class.var_name: routeService
test_class.file: baymax-core/src/test/java/com/tongbanjie/baymax/router/RouteServiceTest.java
test_class.identifier: RouteServiceTest
test_class.interfaces: implements SelectTestSql
test_case.body: @Test
      public void testDoRoute() throws Exception {
          ExecutePlan plan = routeService.doRoute(single14, null);
          System.out.println(plan);
          Assert.assertEquals(ExecuteType.ALL, plan.getExecuteType());
          TrargetSqlEntity sql = plan.getSqlList().get(0);
          Assert.assertEquals("p1", sql.getPartition());
          Assert.assertEquals("table1", sql.getLogicTableName());
          Assert.assertEquals("table1_1", sql.getTargetTableName());
          Assert.assertEquals(4, plan.getSqlList().size());
      }
test_case.class_method_signature: RouteServiceTest.testDoRoute()
test_case.full_signature: @Test public void testDoRoute()
test_case.identifier: testDoRoute
test_case.invocations: doRoute println assertEquals getExecuteType get getSqlList assertEquals getPartition assertEquals getLogicTableName assertEquals getTargetTableName assertEquals size getSqlList
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDoRoute()
focal_class.declarator: logger = LoggerFactory.getLogger(RouteService.class)
focal_class.modifier: private final
focal_class.original_string: private final Logger logger = LoggerFactory.getLogger(RouteService.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.file: baymax-core/src/main/java/com/tongbanjie/baymax/router/RouteService.java
focal_class.identifier: RouteService
focal_class.interfaces: implements IRouteService
focal_class.class_method_signature: RouteService.doRoute(String sql, Map<Integer, ParameterCommand> parameterCommand)
focal_class.full_signature: public ExecutePlan doRoute(String sql, Map<Integer, ParameterCommand> parameterCommand)
focal_class.identifier: doRoute
focal_class.modifiers: public
focal_class.parameters: (String sql, Map<Integer, ParameterCommand> parameterCommand)
focal_class.return: ExecutePlan
focal_class.signature: ExecutePlan doRoute(String sql, Map<Integer, ParameterCommand> parameterCommand)
focal_class.class_method_signature: RouteService.route(List<String> tables, List<CalculateUnit> units, String sql, SqlType sqlType)
focal_class.full_signature: public ExecutePlan route(List<String> tables, List<CalculateUnit> units, String sql, SqlType sqlType)
focal_class.identifier: route
focal_class.modifiers: public
focal_class.parameters: (List<String> tables, List<CalculateUnit> units, String sql, SqlType sqlType)
focal_class.return: ExecutePlan
focal_class.signature: ExecutePlan route(List<String> tables, List<CalculateUnit> units, String sql, SqlType sqlType)
focal_class.class_method_signature: RouteService.buildExecutePlanTypeNo(String sql, String tableName, SqlType sqlType)
focal_class.full_signature: private ExecutePlan buildExecutePlanTypeNo(String sql, String tableName, SqlType sqlType)
focal_class.identifier: buildExecutePlanTypeNo
focal_class.modifiers: private
focal_class.parameters: (String sql, String tableName, SqlType sqlType)
focal_class.return: ExecutePlan
focal_class.signature: ExecutePlan buildExecutePlanTypeNo(String sql, String tableName, SqlType sqlType)
focal_class.class_method_signature: RouteService.buildExecutePlanTypeAll(PartitionTable partitionTable, SqlType sqlType)
focal_class.full_signature: private ExecutePlan buildExecutePlanTypeAll(PartitionTable partitionTable, SqlType sqlType)
focal_class.identifier: buildExecutePlanTypeAll
focal_class.modifiers: private
focal_class.parameters: (PartitionTable partitionTable, SqlType sqlType)
focal_class.return: ExecutePlan
focal_class.signature: ExecutePlan buildExecutePlanTypeAll(PartitionTable partitionTable, SqlType sqlType)
focal_class.class_method_signature: RouteService.buildExecutePlanTypePartition(PartitionTable partitionTable, SqlType sqlType, Set<TargetTableEntity> nodeSet)
focal_class.full_signature: private ExecutePlan buildExecutePlanTypePartition(PartitionTable partitionTable, SqlType sqlType, Set<TargetTableEntity> nodeSet)
focal_class.identifier: buildExecutePlanTypePartition
focal_class.modifiers: private
focal_class.parameters: (PartitionTable partitionTable, SqlType sqlType, Set<TargetTableEntity> nodeSet)
focal_class.return: ExecutePlan
focal_class.signature: ExecutePlan buildExecutePlanTypePartition(PartitionTable partitionTable, SqlType sqlType, Set<TargetTableEntity> nodeSet)
focal_class.class_method_signature: RouteService.buildParameters(Map<Integer, ParameterCommand> commonds)
focal_class.full_signature: public List<Object> buildParameters(Map<Integer, ParameterCommand> commonds)
focal_class.identifier: buildParameters
focal_class.modifiers: public
focal_class.parameters: (Map<Integer, ParameterCommand> commonds)
focal_class.return: List<Object>
focal_class.signature: List<Object> buildParameters(Map<Integer, ParameterCommand> commonds)
focal_method.body: public ExecutePlan doRoute(String sql, Map<Integer, ParameterCommand> parameterCommand) {
  
          SqlType sqlType = SqlTypeUtil.getSqlType(sql);
  
          SqlParser parser = SqlParserFactory.getParser(sqlType);
  
          if (parser == null){
              return buildExecutePlanTypeNo(sql, null, sqlType);
          }
  
          // 解析结果
          ParseResult result = new ParseResult();
  
          // 初始化解析器
          parser.init(sql, buildParameters(parameterCommand));
  
          // 解析
          parser.parse(result);
  
          // 路由
          ExecutePlan plan = route(result.getTables(), result.getCalculateUnits(), sql, sqlType);
  
          // 改写plan中sql
          parser.changeSql(result, plan);
  
          return plan;
      }
focal_method.class_method_signature: RouteService.doRoute(String sql, Map<Integer, ParameterCommand> parameterCommand)
focal_method.full_signature: public ExecutePlan doRoute(String sql, Map<Integer, ParameterCommand> parameterCommand)
focal_method.identifier: doRoute
focal_method.invocations: getSqlType getParser buildExecutePlanTypeNo init buildParameters parse route getTables getCalculateUnits changeSql
focal_method.modifiers: public
focal_method.parameters: (String sql, Map<Integer, ParameterCommand> parameterCommand)
focal_method.return: ExecutePlan
focal_method.signature: ExecutePlan doRoute(String sql, Map<Integer, ParameterCommand> parameterCommand)