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

Function GetPerfBatches

cpp/src/arrow/flight/perf_server.cc:139–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137};
138
139Status GetPerfBatches(const perf::Token& token, const std::shared_ptr<Schema>& schema,
140 bool use_verifier, std::unique_ptr<FlightDataStream>* data_stream) {
141 std::shared_ptr<ResizableBuffer> buffer;
142 std::vector<std::shared_ptr<Array>> arrays;
143
144 const int32_t length = token.definition().records_per_batch();
145 const int32_t ncolumns = 4;
146 for (int i = 0; i < ncolumns; ++i) {
147 RETURN_NOT_OK(MakeRandomByteBuffer(length * sizeof(int64_t), default_memory_pool(),
148 &buffer, static_cast<int32_t>(i) /* seed */));
149 arrays.push_back(std::make_shared<Int64Array>(length, buffer));
150 RETURN_NOT_OK(arrays.back()->Validate());
151 }
152
153 *data_stream = std::unique_ptr<FlightDataStream>(
154 new PerfDataStream(use_verifier, token.start(),
155 token.definition().records_per_stream(), schema, arrays));
156 return Status::OK();
157}
158
159class FlightPerfServer : public FlightServerBase {
160 public:

Callers 1

DoGetMethod · 0.85

Calls 7

MakeRandomByteBufferFunction · 0.85
default_memory_poolFunction · 0.85
push_backMethod · 0.80
backMethod · 0.80
OKFunction · 0.50
ValidateMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected