From 75eb55009e4e933534bbc57381b02cd8c9c35cd0 Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Fri, 31 Jan 2025 13:14:22 -0800 Subject: [PATCH] migrate uses of legacy alias folly::io::getCodec Reviewed By: pranavtbhat Differential Revision: D68642721 fbshipit-source-id: 6ff241f1224cefa4118da6cf20668796d033c642 --- .../thrift/src/thrift/lib/cpp2/runtime/SchemaRegistry.cpp | 5 +++-- .../cpp2/transport/rocket/compression/CompressionManager.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/third-party/thrift/src/thrift/lib/cpp2/runtime/SchemaRegistry.cpp b/third-party/thrift/src/thrift/lib/cpp2/runtime/SchemaRegistry.cpp index 01a635e9332c23..be975b6cc58979 100644 --- a/third-party/thrift/src/thrift/lib/cpp2/runtime/SchemaRegistry.cpp +++ b/third-party/thrift/src/thrift/lib/cpp2/runtime/SchemaRegistry.cpp @@ -64,8 +64,9 @@ std::optional readSchema(std::string_view data) { // use of relative includes. return std::nullopt; } - auto decompressed = folly::io::getCodec(folly::compression::CodecType::ZSTD) - ->uncompress(data); + auto decompressed = + folly::compression::getCodec(folly::compression::CodecType::ZSTD) + ->uncompress(data); return CompactSerializer::deserialize(decompressed); } } // namespace diff --git a/third-party/thrift/src/thrift/lib/cpp2/transport/rocket/compression/CompressionManager.cpp b/third-party/thrift/src/thrift/lib/cpp2/transport/rocket/compression/CompressionManager.cpp index 510870f45490c6..ee67b1f7dce199 100644 --- a/third-party/thrift/src/thrift/lib/cpp2/transport/rocket/compression/CompressionManager.cpp +++ b/third-party/thrift/src/thrift/lib/cpp2/transport/rocket/compression/CompressionManager.cpp @@ -60,7 +60,7 @@ static std::unique_ptr compressBuffer( auto [codecType, level] = CompressionAlgorithmSelector::toCodecTypeAndLevel(compressionAlgorithm); - return folly::io::getCodec(codecType, level)->compress(buffer.get()); + return folly::compression::getCodec(codecType, level)->compress(buffer.get()); } static std::unique_ptr uncompressBuffer( @@ -69,7 +69,8 @@ static std::unique_ptr uncompressBuffer( auto [codecType, level] = CompressionAlgorithmSelector::toCodecTypeAndLevel(compressionAlgorithm); try { - return folly::io::getCodec(codecType, level)->uncompress(buffer.get()); + return folly::compression::getCodec(codecType, level) + ->uncompress(buffer.get()); } catch (const std::exception& e) { throw TApplicationException( TApplicationException::INVALID_TRANSFORM,