shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/federate/original/table/FilterableTableScanExecutor.java
/**
     * Execute.
     *
     * @param tableMetaData federation table meta data
     * @param scanContext filterable table scan context
     * @return query results
     */
Execute.
@param tableMetaData federation table meta data
@param scanContext filterable table scan context
@return query results
Execute . @param tableMetaData federation table meta data @param scanContext filterable table scan context @return query results
public Collection<QueryResult> execute(final FederationTableMetaData tableMetaData, final FilterableTableScanContext scanContext) {
        ExecutionContext context = executionContextGenerator.generate(tableMetaData, scanContext);
        try {
            ExecutionGroupContext<JDBCExecutionUnit> executionGroupContext = prepareEngine.prepare(context.getRouteContext(), context.getExecutionUnits());
            ExecuteProcessEngine.initialize(context.getLogicSQL(), executionGroupContext, props);
            Collection<QueryResult> result = jdbcExecutor.execute(executionGroupContext, callback).stream().map(each -> (QueryResult) each).collect(Collectors.toList());
            ExecuteProcessEngine.finish(executionGroupContext.getExecutionID());
            return result;
        } catch (final SQLException ex) {
            throw new ShardingSphereException(ex);
        } finally {
            ExecuteProcessEngine.clean();
        }
    }
public Collection < QueryResult > execute ( final FederationTableMetaData tableMetaData , final FilterableTableScanContext scanContext ) { ExecutionContext context = executionContextGenerator . generate ( tableMetaData , scanContext ) ; try { ExecutionGroupContext < JDBCExecutionUnit > executionGroupContext = prepareEngine . prepare ( context . getRouteContext ( ) , context . getExecutionUnits ( ) ) ; ExecuteProcessEngine . initialize ( context . getLogicSQL ( ) , executionGroupContext , props ) ; Collection < QueryResult > result = jdbcExecutor . execute ( executionGroupContext , callback ) . stream ( ) . map ( each -> ( QueryResult ) each ) . collect ( Collectors . toList ( ) ) ; ExecuteProcessEngine . finish ( executionGroupContext . getExecutionID ( ) ) ; return result ; } catch ( final SQLException ex ) { throw new ShardingSphereException ( ex ) ; } finally { ExecuteProcessEngine . clean ( ) ; } }
Execute.
Execute .