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

Method GetBytes

be/src/exec/scanner-context.inline.h:34–56  ·  view source on GitHub ↗

Handle the fast common path where all the bytes are in the first buffer. This is the path used by sequence/rc/parquet file formats to read a very small number (i.e. single int) of bytes.

Source from the content-addressed store, hash-verified

32/// is the path used by sequence/rc/parquet file formats to read a very small number
33/// (i.e. single int) of bytes.
34inline bool ScannerContext::Stream::GetBytes(int64_t requested_len, uint8_t** buffer,
35 int64_t* out_len, Status* status, bool peek) {
36 if (UNLIKELY(requested_len < 0)) {
37 *status = ReportInvalidRead(requested_len);
38 return false;
39 }
40 if (UNLIKELY(requested_len == 0)) {
41 *out_len = 0;
42 return true;
43 }
44 if (LIKELY(requested_len <= *output_buffer_bytes_left_)) {
45 *out_len = requested_len;
46 *buffer = *output_buffer_pos_;
47 if (LIKELY(!peek)) {
48 total_bytes_returned_ += *out_len;
49 AdvanceBufferPos(*out_len, output_buffer_pos_, output_buffer_bytes_left_);
50 }
51 return true;
52 }
53 DCHECK_GT(requested_len, 0);
54 *status = GetBytesInternal(requested_len, buffer, peek, out_len);
55 return status->ok();
56}
57
58inline bool ScannerContext::Stream::ReadBytes(int64_t length, uint8_t** buf,
59 Status* status, bool peek) {

Callers 9

ReadSyncMethod · 0.45
SkipToSyncMethod · 0.45
DecompressStreamMethod · 0.45
ReadBlockHeaderMethod · 0.45
ReadPageHeaderMethod · 0.45
FillBytesToBufferMethod · 0.45
FillByteBufferMethod · 0.45

Calls 1

okMethod · 0.45

Tested by

no test coverage detected