MCPcopy Create free account
hub / github.com/apache/arrow / MakeSequencedMergedGenerator

Function MakeSequencedMergedGenerator

cpp/src/arrow/util/async_generator.h:1591–1605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1589
1590template <typename T>
1591Result<AsyncGenerator<T>> MakeSequencedMergedGenerator(
1592 AsyncGenerator<AsyncGenerator<T>> source, int max_subscriptions) {
1593 if (max_subscriptions < 0) {
1594 return Status::Invalid("max_subscriptions must be a positive integer");
1595 }
1596 if (max_subscriptions == 1) {
1597 return Status::Invalid("Use MakeConcatenatedGenerator if max_subscriptions is 1");
1598 }
1599 AsyncGenerator<AsyncGenerator<T>> autostarting_source = MakeMappedGenerator(
1600 std::move(source),
1601 [](const AsyncGenerator<T>& sub) { return MakeAutoStartingGenerator(sub); });
1602 AsyncGenerator<AsyncGenerator<T>> sub_readahead =
1603 MakeSerialReadaheadGenerator(std::move(autostarting_source), max_subscriptions - 1);
1604 return MakeConcatenatedGenerator(std::move(sub_readahead));
1605}
1606
1607/// \brief Create a generator that takes in a stream of generators and pulls from each
1608/// one in sequence.

Callers 3

MakeScanNodeFunction · 0.85
TEST_FFunction · 0.85

Calls 5

MakeMappedGeneratorFunction · 0.85
InvalidFunction · 0.50

Tested by 1

TEST_FFunction · 0.68