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

Method Flush

be/src/util/rle-encoding.h:450–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

448}
449
450inline int RleEncoder::Flush() {
451 if (literal_count_ > 0 || repeat_count_ > 0 || num_buffered_values_ > 0) {
452 bool all_repeat = literal_count_ == 0 &&
453 (repeat_count_ == num_buffered_values_ || num_buffered_values_ == 0);
454 // There is something pending, figure out if it's a repeated or literal run
455 if (repeat_count_ > 0 && all_repeat) {
456 FlushRepeatedRun();
457 } else {
458 DCHECK_EQ(literal_count_ % 8, 0);
459 // Buffer the last group of literals to 8 by padding with 0s.
460 for (; num_buffered_values_ != 0 && num_buffered_values_ < 8;
461 ++num_buffered_values_) {
462 buffered_values_[num_buffered_values_] = 0;
463 }
464 literal_count_ += num_buffered_values_;
465 FlushLiteralRun(true);
466 repeat_count_ = 0;
467 }
468 }
469 bit_writer_.Flush();
470 DCHECK_EQ(num_buffered_values_, 0);
471 DCHECK_EQ(literal_count_, 0);
472 DCHECK_EQ(repeat_count_, 0);
473
474 return bit_writer_.bytes_written();
475}
476
477inline void RleEncoder::CheckBufferFull() {
478 int bytes_written = bit_writer_.bytes_written();

Callers 14

LogFileFlushThreadMethod · 0.45
FillWithRleFunction · 0.45
ValidateRleMethod · 0.45
ValidateRleSkipMethod · 0.45
TEST_FFunction · 0.45
TESTFunction · 0.45
TestBitArrayValuesFunction · 0.45
TEST_FFunction · 0.45
PackUnpackFunction · 0.45
DictEncodeFunction · 0.45

Calls 1

bytes_writtenMethod · 0.45

Tested by 9

ValidateRleMethod · 0.36
ValidateRleSkipMethod · 0.36
TEST_FFunction · 0.36
TESTFunction · 0.36
TestBitArrayValuesFunction · 0.36
TEST_FFunction · 0.36
PackUnpackFunction · 0.36
DictEncodeFunction · 0.36
DeltaEncodeFunction · 0.36