@@ -1441,19 +1441,12 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
14411441 const NKikimr::NMiniKQL::TTypeEnvironment& typeEnv,
14421442 const THashMap<TString, TString>& secureParams,
14431443 const THashMap<TString, TString>& taskParams,
1444- const TVector<TString>& readRanges)
1444+ const TVector<TString>& readRanges,
1445+ IRandomProvider* randomProvider
1446+ )
14451447 {
1446- if (TaskRunner) {
1447- for (auto & [channelId, channel] : InputChannelsMap) {
1448- channel.Channel = TaskRunner->GetInputChannel (channelId);
1449- }
1450- }
14511448 auto collectStatsLevel = StatsModeToCollectStatsLevel (RuntimeSettings.StatsMode );
14521449 for (auto & [inputIndex, source] : SourcesMap) {
1453- if constexpr (!TDerived::HasAsyncTaskRunner) {
1454- source.Buffer = TaskRunner->GetSource (inputIndex);
1455- Y_ABORT_UNLESS (source.Buffer );
1456- }
14571450 Y_ABORT_UNLESS (AsyncIoFactory);
14581451 const auto & inputDesc = Task.GetInputs (inputIndex);
14591452 Y_ABORT_UNLESS (inputDesc.HasSource ());
@@ -1487,9 +1480,8 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
14871480 this ->RegisterWithSameMailbox (source.Actor );
14881481 }
14891482 for (auto & [inputIndex, transform] : InputTransformsMap) {
1490- if constexpr (!TDerived::HasAsyncTaskRunner) {
1491- transform.ProgramBuilder .ConstructInPlace (TaskRunner->GetTypeEnv (), *FunctionRegistry);
1492- std::tie (transform.InputBuffer , transform.Buffer ) = TaskRunner->GetInputTransform (inputIndex);
1483+ Y_ABORT_UNLESS (TaskRunner);
1484+ transform.ProgramBuilder .ConstructInPlace (typeEnv, *FunctionRegistry);
14931485 Y_ABORT_UNLESS (AsyncIoFactory);
14941486 const auto & inputDesc = Task.GetInputs (inputIndex);
14951487 CA_LOG_D (" Create transform for input " << inputIndex << " " << inputDesc.ShortDebugString ());
@@ -1515,43 +1507,33 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
15151507 throw yexception () << " Failed to create input transform " << inputDesc.GetTransform ().GetType () << " : " << ex.what ();
15161508 }
15171509 this ->RegisterWithSameMailbox (transform.Actor );
1518- }
1519- }
1520- if (TaskRunner) {
1521- for (auto & [channelId, channel] : OutputChannelsMap) {
1522- channel.Channel = TaskRunner->GetOutputChannel (channelId);
1523- }
15241510 }
15251511 for (auto & [outputIndex, transform] : OutputTransformsMap) {
1526- if (TaskRunner) {
1527- transform.ProgramBuilder .ConstructInPlace (TaskRunner->GetTypeEnv (), *FunctionRegistry);
1528- std::tie (transform.Buffer , transform.OutputBuffer ) = TaskRunner->GetOutputTransform (outputIndex);
1529- Y_ABORT_UNLESS (AsyncIoFactory);
1530- const auto & outputDesc = Task.GetOutputs (outputIndex);
1531- CA_LOG_D (" Create transform for output " << outputIndex << " " << outputDesc.ShortDebugString ());
1532- try {
1533- std::tie (transform.AsyncOutput , transform.Actor ) = AsyncIoFactory->CreateDqOutputTransform (
1534- IDqAsyncIoFactory::TOutputTransformArguments {
1535- .OutputDesc = outputDesc,
1536- .OutputIndex = outputIndex,
1537- .StatsLevel = collectStatsLevel,
1538- .TxId = TxId,
1539- .TransformOutput = transform.OutputBuffer ,
1540- .Callback = static_cast <TOutputTransformCallbacks*>(this ),
1541- .SecureParams = secureParams,
1542- .TaskParams = taskParams,
1543- .TypeEnv = typeEnv,
1544- .HolderFactory = holderFactory,
1545- .ProgramBuilder = *transform.ProgramBuilder
1546- });
1547- } catch (const std::exception& ex) {
1548- throw yexception () << " Failed to create output transform " << outputDesc.GetTransform ().GetType () << " : " << ex.what ();
1549- }
1550- this ->RegisterWithSameMailbox (transform.Actor );
1512+ transform.ProgramBuilder .ConstructInPlace (typeEnv, *FunctionRegistry);
1513+ Y_ABORT_UNLESS (AsyncIoFactory);
1514+ const auto & outputDesc = Task.GetOutputs (outputIndex);
1515+ CA_LOG_D (" Create transform for output " << outputIndex << " " << outputDesc.ShortDebugString ());
1516+ try {
1517+ std::tie (transform.AsyncOutput , transform.Actor ) = AsyncIoFactory->CreateDqOutputTransform (
1518+ IDqAsyncIoFactory::TOutputTransformArguments {
1519+ .OutputDesc = outputDesc,
1520+ .OutputIndex = outputIndex,
1521+ .StatsLevel = collectStatsLevel,
1522+ .TxId = TxId,
1523+ .TransformOutput = transform.OutputBuffer ,
1524+ .Callback = static_cast <TOutputTransformCallbacks*>(this ),
1525+ .SecureParams = secureParams,
1526+ .TaskParams = taskParams,
1527+ .TypeEnv = typeEnv,
1528+ .HolderFactory = holderFactory,
1529+ .ProgramBuilder = *transform.ProgramBuilder
1530+ });
1531+ } catch (const std::exception& ex) {
1532+ throw yexception () << " Failed to create output transform " << outputDesc.GetTransform ().GetType () << " : " << ex.what ();
15511533 }
1534+ this ->RegisterWithSameMailbox (transform.Actor );
15521535 }
15531536 for (auto & [outputIndex, sink] : SinksMap) {
1554- if (TaskRunner) { sink.Buffer = TaskRunner->GetSink (outputIndex); }
15551537 Y_ABORT_UNLESS (AsyncIoFactory);
15561538 const auto & outputDesc = Task.GetOutputs (outputIndex);
15571539 Y_ABORT_UNLESS (outputDesc.HasSink ());
@@ -1569,7 +1551,7 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
15691551 .TaskParams = taskParams,
15701552 .TypeEnv = typeEnv,
15711553 .HolderFactory = holderFactory,
1572- .RandomProvider = TaskRunner ? TaskRunner-> GetRandomProvider () : nullptr
1554+ .RandomProvider = randomProvider
15731555 });
15741556 } catch (const std::exception& ex) {
15751557 throw yexception () << " Failed to create sink " << outputDesc.GetSink ().GetType () << " : " << ex.what ();
0 commit comments