@@ -1469,19 +1469,12 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
1469
1469
const NKikimr::NMiniKQL::TTypeEnvironment& typeEnv,
1470
1470
const THashMap<TString, TString>& secureParams,
1471
1471
const THashMap<TString, TString>& taskParams,
1472
- const TVector<TString>& readRanges)
1472
+ const TVector<TString>& readRanges,
1473
+ IRandomProvider* randomProvider
1474
+ )
1473
1475
{
1474
- if (TaskRunner) {
1475
- for (auto & [channelId, channel] : InputChannelsMap) {
1476
- channel.Channel = TaskRunner->GetInputChannel (channelId);
1477
- }
1478
- }
1479
1476
auto collectStatsLevel = StatsModeToCollectStatsLevel (RuntimeSettings.StatsMode );
1480
1477
for (auto & [inputIndex, source] : SourcesMap) {
1481
- if constexpr (!TDerived::HasAsyncTaskRunner) {
1482
- source.Buffer = TaskRunner->GetSource (inputIndex);
1483
- Y_ABORT_UNLESS (source.Buffer );
1484
- }
1485
1478
Y_ABORT_UNLESS (AsyncIoFactory);
1486
1479
const auto & inputDesc = Task.GetInputs (inputIndex);
1487
1480
Y_ABORT_UNLESS (inputDesc.HasSource ());
@@ -1515,9 +1508,8 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
1515
1508
this ->RegisterWithSameMailbox (source.Actor );
1516
1509
}
1517
1510
for (auto & [inputIndex, transform] : InputTransformsMap) {
1518
- if constexpr (!TDerived::HasAsyncTaskRunner) {
1519
- transform.ProgramBuilder .ConstructInPlace (TaskRunner->GetTypeEnv (), *FunctionRegistry);
1520
- std::tie (transform.InputBuffer , transform.Buffer ) = TaskRunner->GetInputTransform (inputIndex);
1511
+ Y_ABORT_UNLESS (TaskRunner);
1512
+ transform.ProgramBuilder .ConstructInPlace (typeEnv, *FunctionRegistry);
1521
1513
Y_ABORT_UNLESS (AsyncIoFactory);
1522
1514
const auto & inputDesc = Task.GetInputs (inputIndex);
1523
1515
CA_LOG_D (" Create transform for input " << inputIndex << " " << inputDesc.ShortDebugString ());
@@ -1543,43 +1535,33 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
1543
1535
throw yexception () << " Failed to create input transform " << inputDesc.GetTransform ().GetType () << " : " << ex.what ();
1544
1536
}
1545
1537
this ->RegisterWithSameMailbox (transform.Actor );
1546
- }
1547
- }
1548
- if (TaskRunner) {
1549
- for (auto & [channelId, channel] : OutputChannelsMap) {
1550
- channel.Channel = TaskRunner->GetOutputChannel (channelId);
1551
- }
1552
1538
}
1553
1539
for (auto & [outputIndex, transform] : OutputTransformsMap) {
1554
- if (TaskRunner) {
1555
- transform.ProgramBuilder .ConstructInPlace (TaskRunner->GetTypeEnv (), *FunctionRegistry);
1556
- std::tie (transform.Buffer , transform.OutputBuffer ) = TaskRunner->GetOutputTransform (outputIndex);
1557
- Y_ABORT_UNLESS (AsyncIoFactory);
1558
- const auto & outputDesc = Task.GetOutputs (outputIndex);
1559
- CA_LOG_D (" Create transform for output " << outputIndex << " " << outputDesc.ShortDebugString ());
1560
- try {
1561
- std::tie (transform.AsyncOutput , transform.Actor ) = AsyncIoFactory->CreateDqOutputTransform (
1562
- IDqAsyncIoFactory::TOutputTransformArguments {
1563
- .OutputDesc = outputDesc,
1564
- .OutputIndex = outputIndex,
1565
- .StatsLevel = collectStatsLevel,
1566
- .TxId = TxId,
1567
- .TransformOutput = transform.OutputBuffer ,
1568
- .Callback = static_cast <TOutputTransformCallbacks*>(this ),
1569
- .SecureParams = secureParams,
1570
- .TaskParams = taskParams,
1571
- .TypeEnv = typeEnv,
1572
- .HolderFactory = holderFactory,
1573
- .ProgramBuilder = *transform.ProgramBuilder
1574
- });
1575
- } catch (const std::exception & ex) {
1576
- throw yexception () << " Failed to create output transform " << outputDesc.GetTransform ().GetType () << " : " << ex.what ();
1577
- }
1578
- this ->RegisterWithSameMailbox (transform.Actor );
1540
+ transform.ProgramBuilder .ConstructInPlace (typeEnv, *FunctionRegistry);
1541
+ Y_ABORT_UNLESS (AsyncIoFactory);
1542
+ const auto & outputDesc = Task.GetOutputs (outputIndex);
1543
+ CA_LOG_D (" Create transform for output " << outputIndex << " " << outputDesc.ShortDebugString ());
1544
+ try {
1545
+ std::tie (transform.AsyncOutput , transform.Actor ) = AsyncIoFactory->CreateDqOutputTransform (
1546
+ IDqAsyncIoFactory::TOutputTransformArguments {
1547
+ .OutputDesc = outputDesc,
1548
+ .OutputIndex = outputIndex,
1549
+ .StatsLevel = collectStatsLevel,
1550
+ .TxId = TxId,
1551
+ .TransformOutput = transform.OutputBuffer ,
1552
+ .Callback = static_cast <TOutputTransformCallbacks*>(this ),
1553
+ .SecureParams = secureParams,
1554
+ .TaskParams = taskParams,
1555
+ .TypeEnv = typeEnv,
1556
+ .HolderFactory = holderFactory,
1557
+ .ProgramBuilder = *transform.ProgramBuilder
1558
+ });
1559
+ } catch (const std::exception & ex) {
1560
+ throw yexception () << " Failed to create output transform " << outputDesc.GetTransform ().GetType () << " : " << ex.what ();
1579
1561
}
1562
+ this ->RegisterWithSameMailbox (transform.Actor );
1580
1563
}
1581
1564
for (auto & [outputIndex, sink] : SinksMap) {
1582
- if (TaskRunner) { sink.Buffer = TaskRunner->GetSink (outputIndex); }
1583
1565
Y_ABORT_UNLESS (AsyncIoFactory);
1584
1566
const auto & outputDesc = Task.GetOutputs (outputIndex);
1585
1567
Y_ABORT_UNLESS (outputDesc.HasSink ());
@@ -1597,7 +1579,7 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
1597
1579
.TaskParams = taskParams,
1598
1580
.TypeEnv = typeEnv,
1599
1581
.HolderFactory = holderFactory,
1600
- .RandomProvider = TaskRunner ? TaskRunner-> GetRandomProvider () : nullptr
1582
+ .RandomProvider = randomProvider
1601
1583
});
1602
1584
} catch (const std::exception & ex) {
1603
1585
throw yexception () << " Failed to create sink " << outputDesc.GetSink ().GetType () << " : " << ex.what ();
0 commit comments