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

Method GetBuffer

cpp/src/arrow/ipc/reader.cc:250–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248 }
249
250 Status GetBuffer(int buffer_index, std::shared_ptr<Buffer>* out) {
251 auto* buffers = metadata_->buffers();
252 CHECK_FLATBUFFERS_NOT_NULL(buffers, "RecordBatch.buffers");
253 if (buffer_index >= static_cast<int>(buffers->size())) {
254 return Status::IOError("buffer_index out of range.");
255 }
256 const flatbuf::Buffer* buffer = buffers->Get(buffer_index);
257 if (buffer->length() == 0) {
258 // Should never return a null buffer here.
259 // (zero-sized buffer allocations are cheap)
260 return AllocateBuffer(0).Value(out);
261 } else {
262 return ReadBuffer(buffer->offset(), buffer->length(), out);
263 }
264 }
265
266 Result<int64_t> GetVariadicCount(int i) {
267 auto* variadic_counts = metadata_->variadicBufferCounts();

Callers 10

ToArrayDataMethod · 0.45
AllNullShortCircuitMethod · 0.45
PropagateSingleMethod · 0.45
ExecIntoArrayDataMethod · 0.45
ExecMethod · 0.45
ExecMethod · 0.45
ExecMethod · 0.45
StringDataTransformFunction · 0.45

Calls 8

IOErrorFunction · 0.85
buffersMethod · 0.80
AllocateBufferFunction · 0.50
sizeMethod · 0.45
GetMethod · 0.45
lengthMethod · 0.45
ValueMethod · 0.45
offsetMethod · 0.45

Tested by

no test coverage detected