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

Method ProcessBlock

be/src/util/compress.cc:129–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129Status GzipCompressor::ProcessBlock(bool output_preallocated,
130 int64_t input_length, const uint8_t* input, int64_t* output_length,
131 uint8_t** output) {
132 DCHECK_GE(input_length, 0);
133 DCHECK(!output_preallocated || (output_preallocated && *output_length > 0));
134 int64_t max_compressed_len = MaxOutputLen(input_length);
135 if (!output_preallocated) {
136 if (!reuse_buffer_ || buffer_length_ < max_compressed_len || out_buffer_ == nullptr) {
137 DCHECK(memory_pool_ != nullptr) << "Can't allocate without passing in a mem pool";
138 buffer_length_ = max_compressed_len;
139 out_buffer_ = memory_pool_->Allocate(buffer_length_);
140 }
141 *output = out_buffer_;
142 *output_length = buffer_length_;
143 } else if (*output_length < max_compressed_len) {
144 return Status("GzipCompressor::ProcessBlock: output length too small");
145 }
146
147 RETURN_IF_ERROR(Compress(input_length, input, output_length, *output));
148 return Status::OK();
149}
150
151Status GzipCompressor::ValidateCompressionLevel(int compression_level) {
152 if (compression_level >= Z_BEST_SPEED && compression_level <= Z_BEST_COMPRESSION) {

Callers 15

TestCompressionFunction · 0.45
GetRecordMethod · 0.45
ReadCompressedBlockMethod · 0.45
ProcessRangeMethod · 0.45
CreateCompressedThriftFunction · 0.45
DecompressThriftFunction · 0.45
DeserializeMethod · 0.45
WaitForAsyncReadMethod · 0.45
TryCompressMethod · 0.45
TryCompressMethod · 0.45
SerializeMethod · 0.45

Calls 9

CompressFunction · 0.85
OKFunction · 0.85
AcquireDataMethod · 0.80
push_backMethod · 0.80
StatusClass · 0.70
getMethod · 0.65
AllocateMethod · 0.45
ClearMethod · 0.45
strMethod · 0.45

Tested by 7

TestCompressionFunction · 0.36
CompressAndDecompressMethod · 0.36
CompressMethod · 0.36
TEST_FFunction · 0.36