Skip to content

Commit

Permalink
migrate uses of legacy alias folly::io::StreamCodec
Browse files Browse the repository at this point in the history
Reviewed By: Skory, skrueger

Differential Revision: D68536730

fbshipit-source-id: 4408bf3071dc2aff7a83d522b931b58343995f97
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Jan 24, 2025
1 parent 5462d5a commit 464735f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions proxygen/lib/utils/ZstdStreamCompressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ZstdStreamCompressor::ZstdStreamCompressor(int compressionLevel,
independent_(independentChunks) {
}

folly::io::StreamCodec& ZstdStreamCompressor::getCodec() {
folly::compression::StreamCodec& ZstdStreamCompressor::getCodec() {
if (!codec_) {
codec_ = folly::compression::getStreamCodec(folly::io::CodecType::ZSTD,
compressionLevel_);
Expand All @@ -45,8 +45,9 @@ std::unique_ptr<folly::IOBuf> ZstdStreamCompressor::compress(
in = &clone;
}

auto op = last || independent_ ? folly::io::StreamCodec::FlushOp::END
: folly::io::StreamCodec::FlushOp::FLUSH;
auto op = last || independent_
? folly::compression::StreamCodec::FlushOp::END
: folly::compression::StreamCodec::FlushOp::FLUSH;
auto& codec = getCodec();
if (independent_) {
codec.resetStream(in->length());
Expand All @@ -70,7 +71,7 @@ std::unique_ptr<folly::IOBuf> ZstdStreamCompressor::compress(

out->append(outrange.begin() - out->tail());

if (op == folly::io::StreamCodec::FlushOp::END) {
if (op == folly::compression::StreamCodec::FlushOp::END) {
codec_.reset();
}

Expand Down
4 changes: 2 additions & 2 deletions proxygen/lib/utils/ZstdStreamCompressor.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ class ZstdStreamCompressor : public StreamCompressor {
}

private:
folly::io::StreamCodec& getCodec();
folly::compression::StreamCodec& getCodec();

std::unique_ptr<folly::io::StreamCodec> codec_;
std::unique_ptr<folly::compression::StreamCodec> codec_;
const int compressionLevel_;
const bool independent_;
bool error_ = false;
Expand Down
4 changes: 2 additions & 2 deletions proxygen/lib/utils/test/ZstdTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ void compressThenDecompressPieces(
size_t i = 0;
for (const auto& piece : input_pieces) {
const auto end = ++i == input_pieces.size();
const auto op = end ? folly::io::StreamCodec::FlushOp::END
: folly::io::StreamCodec::FlushOp::FLUSH;
const auto op = end ? folly::compression::StreamCodec::FlushOp::END
: folly::compression::StreamCodec::FlushOp::FLUSH;
auto irange = piece->coalesce();
if (!end && irange.size() == 0) {
continue;
Expand Down

0 comments on commit 464735f

Please sign in to comment.