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

Method Compress

cpp/src/arrow/util/compression_zstd.cc:199–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197 }
198
199 Result<int64_t> Compress(int64_t input_len, const uint8_t* input,
200 int64_t output_buffer_len, uint8_t* output_buffer) override {
201 ARROW_ASSIGN_OR_RAISE(auto cctx, CreateCCtx());
202 size_t ret =
203 ZSTD_compress2(cctx.get(), output_buffer, static_cast<size_t>(output_buffer_len),
204 input, static_cast<size_t>(input_len));
205 if (ZSTD_isError(ret)) {
206 return ZSTDError(ret, "ZSTD compression failed: ");
207 }
208 return static_cast<int64_t>(ret);
209 }
210
211 Result<std::shared_ptr<Compressor>> MakeCompressor() override {
212 ARROW_ASSIGN_OR_RAISE(auto cctx, CreateCCtx());

Callers

nothing calls this directly

Calls 2

ZSTDErrorFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected