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

Method GetBuffer

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

Source from the content-addressed store, hash-verified

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