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

Function End

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

Source from the content-addressed store, hash-verified

218 }
219
220 Result<EndResult> End(int64_t output_len, uint8_t* output) override {
221 auto dst = output;
222 auto dst_capacity = static_cast<size_t>(output_len);
223 size_t ret;
224 int64_t bytes_written = 0;
225
226 BEGIN_COMPRESS(dst, dst_capacity, (EndResult{0, true}));
227
228 if (dst_capacity < LZ4F_compressBound(0, &prefs_)) {
229 // Output too small to end frame into
230 return EndResult{bytes_written, true};
231 }
232
233 ret = LZ4F_compressEnd(ctx_, dst, dst_capacity, nullptr /* options */);
234 if (LZ4F_isError(ret)) {
235 return LZ4Error(ret, "LZ4 end failed: ");
236 }
237 bytes_written += static_cast<int64_t>(ret);
238 DCHECK_LE(bytes_written, output_len);
239 return EndResult{bytes_written, false};
240 }
241
242#undef BEGIN_COMPRESS
243

Callers 15

AsyncGeneratorEndFunction · 0.70
PurgeMethod · 0.70
operator()Method · 0.70
PumpMethod · 0.70
CloseMethod · 0.70
IsEndMethod · 0.70
IterationEndFunction · 0.70
NextMethod · 0.70
RangeIteratorMethod · 0.70
operator*Method · 0.70
NextMethod · 0.70
NextMethod · 0.70

Calls 1

LZ4ErrorFunction · 0.85

Tested by 6

TESTFunction · 0.56
NextMethod · 0.56
NextMethod · 0.56
IteratorToResultsFunction · 0.56
IsEndMethod · 0.56
IsEndMethod · 0.56