Skip to content

Commit

Permalink
migrate uses of legacy alias folly::io::getCodec
Browse files Browse the repository at this point in the history
Reviewed By: pranavtbhat

Differential Revision: D68642721

fbshipit-source-id: 6ff241f1224cefa4118da6cf20668796d033c642
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Jan 31, 2025
1 parent 58ad784 commit 75eb550
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ std::optional<type::Schema> 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<type::Schema>(decompressed);
}
} // namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static std::unique_ptr<folly::IOBuf> 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<folly::IOBuf> uncompressBuffer(
Expand All @@ -69,7 +69,8 @@ static std::unique_ptr<folly::IOBuf> 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,
Expand Down

0 comments on commit 75eb550

Please sign in to comment.