MCPcopy Create free account
hub / github.com/apache/impala / CopyIoToBoundary

Method CopyIoToBoundary

be/src/exec/scanner-context.cc:353–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351}
352
353Status ScannerContext::Stream::CopyIoToBoundary(int64_t num_bytes) {
354 DCHECK(io_buffer_ != nullptr);
355 DCHECK_GT(io_buffer_bytes_left_, 0);
356 DCHECK_GE(io_buffer_bytes_left_, num_bytes);
357 RETURN_IF_ERROR(boundary_buffer_->Append(io_buffer_pos_, num_bytes));
358 boundary_buffer_bytes_left_ += num_bytes;
359 boundary_buffer_pos_ = reinterpret_cast<uint8_t*>(boundary_buffer_->buffer()) +
360 boundary_buffer_->len() - boundary_buffer_bytes_left_;
361 AdvanceBufferPos(num_bytes, &io_buffer_pos_, &io_buffer_bytes_left_);
362 // If all data from I/O buffer was returned or copied to boundary buffer, we don't need
363 // I/O buffer.
364 if (io_buffer_bytes_left_ == 0) ReturnIoBuffer();
365 output_buffer_pos_ = &boundary_buffer_pos_;
366 output_buffer_bytes_left_ = &boundary_buffer_bytes_left_;
367 return Status::OK();
368}
369
370void ScannerContext::Stream::ReturnIoBuffer() {
371 DCHECK(io_buffer_ != nullptr);

Callers

nothing calls this directly

Calls 4

OKFunction · 0.85
AppendMethod · 0.45
bufferMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected