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

Function IteratorToResults

cpp/src/arrow/util/future_test.cc:84–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82
83template <typename T>
84IteratorResults<T> IteratorToResults(Iterator<T> iterator) {
85 IteratorResults<T> results;
86
87 while (true) {
88 auto res = iterator.Next();
89 if (res == IterationTraits<T>::End()) {
90 break;
91 }
92 if (res.ok()) {
93 results.values.push_back(*std::move(res));
94 } else {
95 results.errors.push_back(res.status());
96 }
97 }
98 return results;
99}
100
101// So that main thread may wait a bit for a future to be finished
102constexpr auto kYieldDuration = std::chrono::microseconds(50);

Callers

nothing calls this directly

Calls 5

push_backMethod · 0.80
EndFunction · 0.70
NextMethod · 0.45
okMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected