private List <TResult> ShardingExecute <TResult>(IExecutor <TResult> executor, bool serial, ExecutionContext executionContext,
                                                         CancellationToken cancellationToken = new CancellationToken())
        {
            var waitSqlExecuteResults = executionContext.GetExecutionUnits().GroupBy(o => o.GetDataSourceName())
                                        .Select(o => GetSqlExecutorGroups(serial, o))
                                        .Select(dataSourceSqlExecutorUnit => { return(executor.Execute(dataSourceSqlExecutorUnit)); })
                                        .ToArray();
            var r = waitSqlExecuteResults.SelectMany(o => o).ToList();

            return(r);
        }
Exemplo n.º 2
0
 public void Init(ExecutionContext executionContext)
 {
     SqlCommandContext = executionContext.GetSqlCommandContext();
     InputGroups.AddAll(GetExecuteGroups(executionContext.GetExecutionUnits()));
     CacheCommands();
 }