@@ -1441,19 +1441,12 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
1441
1441
const NKikimr::NMiniKQL::TTypeEnvironment& typeEnv,
1442
1442
const THashMap<TString, TString>& secureParams,
1443
1443
const THashMap<TString, TString>& taskParams,
1444
- const TVector<TString>& readRanges)
1444
+ const TVector<TString>& readRanges,
1445
+ IRandomProvider* randomProvider
1446
+ )
1445
1447
{
1446
- if (TaskRunner) {
1447
- for (auto & [channelId, channel] : InputChannelsMap) {
1448
- channel.Channel = TaskRunner->GetInputChannel (channelId);
1449
- }
1450
- }
1451
1448
auto collectStatsLevel = StatsModeToCollectStatsLevel (RuntimeSettings.StatsMode );
1452
1449
for (auto & [inputIndex, source] : SourcesMap) {
1453
- if constexpr (!TDerived::HasAsyncTaskRunner) {
1454
- source.Buffer = TaskRunner->GetSource (inputIndex);
1455
- Y_ABORT_UNLESS (source.Buffer );
1456
- }
1457
1450
Y_ABORT_UNLESS (AsyncIoFactory);
1458
1451
const auto & inputDesc = Task.GetInputs (inputIndex);
1459
1452
Y_ABORT_UNLESS (inputDesc.HasSource ());
@@ -1487,9 +1480,8 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
1487
1480
this ->RegisterWithSameMailbox (source.Actor );
1488
1481
}
1489
1482
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);
1493
1485
Y_ABORT_UNLESS (AsyncIoFactory);
1494
1486
const auto & inputDesc = Task.GetInputs (inputIndex);
1495
1487
CA_LOG_D (" Create transform for input " << inputIndex << " " << inputDesc.ShortDebugString ());
@@ -1515,43 +1507,33 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
1515
1507
throw yexception () << " Failed to create input transform " << inputDesc.GetTransform ().GetType () << " : " << ex.what ();
1516
1508
}
1517
1509
this ->RegisterWithSameMailbox (transform.Actor );
1518
- }
1519
- }
1520
- if (TaskRunner) {
1521
- for (auto & [channelId, channel] : OutputChannelsMap) {
1522
- channel.Channel = TaskRunner->GetOutputChannel (channelId);
1523
- }
1524
1510
}
1525
1511
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 ();
1551
1533
}
1534
+ this ->RegisterWithSameMailbox (transform.Actor );
1552
1535
}
1553
1536
for (auto & [outputIndex, sink] : SinksMap) {
1554
- if (TaskRunner) { sink.Buffer = TaskRunner->GetSink (outputIndex); }
1555
1537
Y_ABORT_UNLESS (AsyncIoFactory);
1556
1538
const auto & outputDesc = Task.GetOutputs (outputIndex);
1557
1539
Y_ABORT_UNLESS (outputDesc.HasSink ());
@@ -1569,7 +1551,7 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
1569
1551
.TaskParams = taskParams,
1570
1552
.TypeEnv = typeEnv,
1571
1553
.HolderFactory = holderFactory,
1572
- .RandomProvider = TaskRunner ? TaskRunner-> GetRandomProvider () : nullptr
1554
+ .RandomProvider = randomProvider
1573
1555
});
1574
1556
} catch (const std::exception & ex) {
1575
1557
throw yexception () << " Failed to create sink " << outputDesc.GetSink ().GetType () << " : " << ex.what ();
0 commit comments