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

Method CreateDCtx

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

Source from the content-addressed store, hash-verified

246 }
247
248 Result<DCtxPtr> CreateDCtx() const {
249 DCtxPtr dctx{ZSTD_createDCtx(), ZSTD_freeDCtx};
250 if (dctx == nullptr) {
251 return Status::OutOfMemory("ZSTD_DCtx create failed");
252 }
253 for (auto& [key, value] : decompression_context_params_) {
254 auto ret =
255 ZSTD_DCtx_setParameter(dctx.get(), static_cast<ZSTD_dParameter>(key), value);
256 if (ZSTD_isError(ret)) {
257 return ZSTDError(ret, "ZSTD_DCtx create failed: ");
258 }
259 }
260 return dctx;
261 }
262
263 const int compression_level_;
264 const std::vector<std::pair<int, int>> compression_context_params_;

Callers

nothing calls this directly

Calls 3

OutOfMemoryFunction · 0.85
ZSTDErrorFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected