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

Function MakeSequencedMergedGenerator

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

Source from the content-addressed store, hash-verified

1483
1484template <typename T>
1485Result<AsyncGenerator<T>> MakeSequencedMergedGenerator(
1486 AsyncGenerator<AsyncGenerator<T>> source, int max_subscriptions) {
1487 if (max_subscriptions < 0) {
1488 return Status::Invalid("max_subscriptions must be a positive integer");
1489 }
1490 if (max_subscriptions == 1) {
1491 return Status::Invalid("Use MakeConcatenatedGenerator if max_subscriptions is 1");
1492 }
1493 AsyncGenerator<AsyncGenerator<T>> autostarting_source = MakeMappedGenerator(
1494 std::move(source),
1495 [](const AsyncGenerator<T>& sub) { return MakeAutoStartingGenerator(sub); });
1496 AsyncGenerator<AsyncGenerator<T>> sub_readahead =
1497 MakeSerialReadaheadGenerator(std::move(autostarting_source), max_subscriptions - 1);
1498 return MakeConcatenatedGenerator(std::move(sub_readahead));
1499}
1500
1501/// \brief Create a generator that takes in a stream of generators and pulls from each
1502/// 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