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

Method FillByteBuffer

be/src/exec/text/hdfs-text-scanner.cc:515–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

513}
514
515Status HdfsTextScanner::FillByteBuffer(MemPool* pool, bool* eosr, int num_bytes) {
516 *eosr = false;
517
518 if (decompressor_.get() == nullptr) {
519 Status status;
520 if (num_bytes > 0) {
521 if (!stream_->GetBytes(num_bytes,
522 reinterpret_cast<uint8_t**>(&byte_buffer_ptr_), &byte_buffer_read_size_,
523 &status)) {
524 DCHECK(!status.ok());
525 return status;
526 }
527 } else {
528 DCHECK_EQ(num_bytes, 0);
529 RETURN_IF_ERROR(stream_->GetBuffer(false,
530 reinterpret_cast<uint8_t**>(&byte_buffer_ptr_), &byte_buffer_read_size_));
531 }
532 *eosr = stream_->eosr();
533 } else if (decompressor_->supports_streaming()) {
534 DCHECK_EQ(num_bytes, 0);
535 RETURN_IF_ERROR(DecompressStreamToBuffer(
536 reinterpret_cast<uint8_t**>(&byte_buffer_ptr_), &byte_buffer_read_size_,
537 pool, eosr));
538 } else {
539 DCHECK_EQ(num_bytes, 0);
540 RETURN_IF_ERROR(DecompressFileToBuffer(reinterpret_cast<uint8_t**>(&byte_buffer_ptr_),
541 &byte_buffer_read_size_));
542 *eosr = byte_buffer_read_size_ == 0 ? true : stream_->eosr();
543 }
544
545 if (decoder_.get() != nullptr) {
546 SCOPED_TIMER(decode_timer_);
547 RETURN_IF_ERROR(decoder_->DecodeBuffer(reinterpret_cast<uint8_t**>(&byte_buffer_ptr_),
548 &byte_buffer_read_size_, pool, *eosr, decompressor_.get() != nullptr, context_));
549 }
550
551 byte_buffer_end_ = byte_buffer_ptr_ + byte_buffer_read_size_;
552 return Status::OK();
553}
554
555Status HdfsTextScanner::FindFirstTuple(MemPool* pool) {
556 DCHECK_EQ(scan_state_, SCAN_RANGE_INITIALIZED);

Callers

nothing calls this directly

Calls 8

OKFunction · 0.85
supports_streamingMethod · 0.80
DecodeBufferMethod · 0.80
getMethod · 0.65
GetBytesMethod · 0.45
okMethod · 0.45
GetBufferMethod · 0.45
eosrMethod · 0.45

Tested by

no test coverage detected