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

Function Flush

cpp/src/arrow/util/compression_lz4.cc:198–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196 }
197
198 Result<FlushResult> Flush(int64_t output_len, uint8_t* output) override {
199 auto dst = output;
200 auto dst_capacity = static_cast<size_t>(output_len);
201 size_t ret;
202 int64_t bytes_written = 0;
203
204 BEGIN_COMPRESS(dst, dst_capacity, (FlushResult{0, true}));
205
206 if (dst_capacity < LZ4F_compressBound(0, &prefs_)) {
207 // Output too small to flush into
208 return FlushResult{bytes_written, true};
209 }
210
211 ret = LZ4F_flush(ctx_, dst, dst_capacity, nullptr /* options */);
212 if (LZ4F_isError(ret)) {
213 return LZ4Error(ret, "LZ4 flush failed: ");
214 }
215 bytes_written += static_cast<int64_t>(ret);
216 DCHECK_LE(bytes_written, output_len);
217 return FlushResult{bytes_written, false};
218 }
219
220 Result<EndResult> End(int64_t output_len, uint8_t* output) override {
221 auto dst = output;

Callers 13

FlushMethod · 0.85
PrintMethod · 0.85
PrintMethod · 0.85
LogMethod · 0.85
FlushMethod · 0.85
WriteMethod · 0.85
SetBufferSizeMethod · 0.85
SeekMethod · 0.85
AppendAndOutputMethod · 0.85
FlushMethod · 0.85
CloseMethod · 0.85
CloseMethod · 0.85

Calls 1

LZ4ErrorFunction · 0.85

Tested by

no test coverage detected